JokeAPI
v2.jokeapi.dev · Developer Tools
Programming, pun, dark, spooky, and miscellaneous jokes. Filter by type, category, language, and flags. No API key required.
Authentication
No authentication requiredFree to use with no key needed.
Sample Requests
GET
Get a programming joke
Get a random programming joke.
https://v2.jokeapi.dev/joke/Programming
Hover any highlighted part to learn what it does
curl -X GET "https://v2.jokeapi.dev/joke/Programming"
import requests
response = requests.get(
"https://v2.jokeapi.dev/joke/Programming",
)
print(response.json())const url = 'https://v2.jokeapi.dev/joke/Programming'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://v2.jokeapi.dev/joke/Programming"
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://v2.jokeapi.dev/joke/Programming")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://v2.jokeapi.dev/joke/Programming";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
GET
Safe joke for all audiences
Get a safe joke suitable for all audiences.
https://v2.jokeapi.dev/joke/Any?safe_mode=
Hover any highlighted part to learn what it does
curl -X GET "https://v2.jokeapi.dev/joke/Any?safe_mode="
import requests
params = {
"safe_mode": ""
}
response = requests.get(
"https://v2.jokeapi.dev/joke/Any",
params=params,
)
print(response.json())const url = new URL('https://v2.jokeapi.dev/joke/Any');
url.searchParams.set('safe_mode', '');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://v2.jokeapi.dev/joke/Any")
q := baseURL.Query()
q.Set("safe_mode", "")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://v2.jokeapi.dev/joke/Any")
uri.query = URI.encode_www_form({
"safe_mode" => ""
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://v2.jokeapi.dev/joke/Any?" . http_build_query([
"safe_mode" => ""
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- No API key needed
- GET https://v2.jokeapi.dev/joke/Programming
- Categories: Programming, Misc, Dark, Pun, Spooky, Christmas
- Add ?safe-mode to avoid offensive content
- Add &type=single or &type=twopart
What can you build with JokeAPI?
JokeAPI is a Developer Tools API. Developers commonly use developer tools APIs for:
- automating code review and quality checks
- integrating CI/CD pipelines and build systems
- managing feature flags and A/B tests
- monitoring errors and application performance
- generating and validating test data
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. JokeAPI is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide