JokeAPI API
Overview
JokeAPI is a free, no-auth REST API that returns programming, miscellaneous, and dark jokes in single-part or two-part formats. It supports extensive filtering options so you can exclude categories like NSFW, racist, or sexist content to keep jokes appropriate. It is one of the easiest APIs for beginners to start with since no sign-up is required.
Beginner Tip
Use the blacklistFlags parameter to exclude offensive content (e.g., ?blacklistFlags=nsfw,racist) and specify a category like Programming or Misc to get more relevant jokes.
Measurement Record
What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.
- Request
- GET https://v2.jokeapi.dev/joke/Programming?blacklistFlags=nsfw
- Result
- HTTP 200 · application/json · 387 bytes
- Response time
- 282 ms (median of 3) · fastest 278 ms
- Transport
- TLSv1.3 · TLS_AES_256_GCM_SHA384 · certificate issued by Google Trust Services
- Browser CORS
- Allowed — Access-Control-Allow-Origin: *
- Rate limit
- 120 per window (119 remaining at test time)
- Served by
- cloudflare
- Recorded
- 2026-08-10
Fields Returned
Top-level fields present in the response we captured, with the type and value we actually received.
| Field | Type | Value received |
|---|---|---|
| error | boolean | false |
| category | string | Programming |
| type | string | single |
| joke | string | "Knock, knock." "Who's there?" [very long pa… |
| flags | object | {6 fields} |
| id | integer | 36 |
| safe | boolean | true |
| lang | string | en |
Captured Response
Captured from a real request to https://v2.jokeapi.dev/joke/Programming?blacklistFlags=nsfw on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.
{
"error": false,
"category": "Programming",
"type": "single",
"joke": "\"Knock, knock.\"\n\"Who's there?\"\n\n[very long pause]\n\n\"Java.\"",
"flags": {
"nsfw": false,
"religious": false,
"political": false,
"racist": false,
"sexist": false,
"explicit": false
},
"id": 36,
"safe": true,
"lang": "en"
} Field Reference
type Format of the joke: single (one field) or twopart (setup + delivery). joke The full joke text when type is single. category The category this joke belongs to, such as Programming or Dark. id Unique identifier for the joke, useful for linking directly to a specific joke. Implementation Example
Calls a real endpoint of this API. Replace any placeholder credentials with your own key.
const url = "https://v2.jokeapi.dev/joke/Programming?blacklistFlags=nsfw";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
How This API Fails
We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.
{
"error": true,
"internalError": false,
"code": 106,
"message": "No matching joke found",
"causedBy": [
"No jokes were found that match your provided filter(s)."
],
"additionalInfo": "The specified flags are invalid. Got: \"!!!invalid!!!\" - Possible flags are: \"nsfw, religious, political, racist, sexist, explicit\".",
"timestamp": 1786391782968
} Common Errors & Troubleshooting
Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.
Measured Score Breakdown
Live HTTP request to the API endpoint
Fully tested on Aug 10, 2026
Technical Specifications
Related Tags
Recipes Using JokeAPI
Build something with this API. Each recipe includes step-by-step instructions and code outlines.
Similar APIs
View All →Animal Crossing: New Horizons
⭐ Beginner's PickThe Animal Crossing: New Horizons API gives you free access to in-game data including villagers, critters, fossils, art, music, and furniture.
Autochess VNG
The Autochess VNG API provides game data for the Autochess VNG mobile game including heroes, items, and races.
Barter.VG
Barter.VG aggregates data about PC games, DLC, bundles, giveaways, and trading from Steam and other platforms.
Digimon Information
⭐ Beginner's PickThe Digimon Information API provides easy access to data about Digimon creatures, including their names, levels, types, and images.
Genshin Impact
⭐ Beginner's PickThe Genshin Impact API provides detailed game data including characters, weapons, artifacts, enemies, and domains from the popular action RPG.