Official Joke API
Random setup-and-punchline jokes from a free, no-key endpoint.
What it does
The Official Joke API is a simple open dataset of setup/punchline jokes in a few types (general, knock-knock, programming, dad). Endpoints for a single random joke, ten at once, by type, or by id.
Base URL
Authentication
None. /random_joke, /jokes/random, /jokes/ten, /jokes/{type}/random, /jokes/{id}. Reliability note: it runs on Google App Engine and has had intermittent downtime — keep a fallback.
Code examples
curl -s https://official-joke-api.appspot.com/random_joke curl -s https://official-joke-api.appspot.com/jokes/programming/random
const [j] = await fetch(
"https://official-joke-api.appspot.com/jokes/programming/random"
).then(r => r.json());
console.log(`${j.setup} ... ${j.punchline}`);Rate limits & quotas
No key or documented rate limit. /jokes/ten is the efficient call — grab ten and rotate client-side rather than hitting /random_joke repeatedly. Note /jokes/{type}/random returns an array with one element.
Key response fields
| id | Joke id |
| type | general, knock-knock, programming, dad |
| setup | The lead-in |
| punchline | The payoff |
Common errors
| (array vs object) | /random_joke returns one object; /jokes/random and /jokes/{type}/random return a one-element array. |
| 503 / timeout | App Engine instance cold or down — retry, then fall back to a bundled joke. |
| 404 | Unknown id or type. |
When to use it (and alternatives)
Fine for a lightweight joke feed where the occasional outage doesn’t matter. For filtering, safe-mode and more categories use JokeAPI; for dad jokes, icanhazdadjoke.
FAQ
Is this API reliable?
It has had periods of downtime on its free App Engine hosting. Fetch /jokes/ten, cache them, and bundle a few jokes locally as a fallback.
Why does my code get an array sometimes and an object other times?
/random_joke → object. /jokes/random and the per-type random endpoints → array of one. Normalise on your side.
Can I filter content?
Not really — the dataset is small and generally clean, but there is no safe-mode or blacklist. Use JokeAPI if you need guarantees.
New to APIs?
Short guides for working with this API — and any other.