API Directory › 🎉 Fun & Random › JokeAPI
No authHTTPSCORS

JokeAPI

Programming and general jokes with filtering and safe-mode — no key.

Auth
No auth needed
HTTPS
Yes
CORS
Yes
Open JokeAPI docs ↗

What it does

JokeAPI (v2) serves programming, pun, spooky, Christmas and miscellaneous jokes, single-line or two-part (setup/delivery), with strong filtering: category selection, a blacklist for unsafe content, language, type, keyword search and safe-mode.

Base URL

https://v2.jokeapi.dev

Authentication

None. /joke/{Category} where Category is Any, Programming, Misc, Pun, Spooky, Christmas or Dark (comma-separated). Filter with ?blacklistFlags=, ?type=, ?safe-mode, ?contains=, ?amount=, ?lang=.

Code examples

curl
curl -s "https://v2.jokeapi.dev/joke/Programming?type=single&safe-mode"
curl -s "https://v2.jokeapi.dev/joke/Any?blacklistFlags=nsfw,racist,sexist,explicit&amount=3"
JavaScript
const j = await fetch(
  "https://v2.jokeapi.dev/joke/Programming?safe-mode"
).then(r => r.json());
console.log(j.type === "single" ? j.joke : `${j.setup} ... ${j.delivery}`);

Rate limits & quotas

120 requests/minute per IP — over that returns HTTP 429 with a Retry-After. Use ?amount=N (up to 10) to batch. Always set safe-mode or a thorough blacklistFlags list for anything user-facing.

Key response fields

errorfalse on success; true with message/causedBy otherwise
typesingle or twopart
jokeThe joke (single type)
setup / deliveryThe two halves (twopart type)
category / flags / safe / langMetadata — flags is an object of booleans

Common errors

error:true, code 106No joke matched your filters — loosen categories/flags.
429Over 120/minute.
error:true, code 108The lang requested has no matching jokes.
(unsafe content slipped through)Combine safe-mode with an explicit blacklistFlags list.

When to use it (and alternatives)

The most configurable joke API — good when you need safe, category-controlled humour for a bot or app. For dad jokes specifically, icanhazdadjoke; for a simple setup/punchline feed, Official Joke API.

FAQ

How do I keep it family-friendly?

Add ?safe-mode (a curated safe subset) and blacklistFlags=nsfw,religious,political,racist,sexist,explicit. Belt and braces.

Can I get several jokes in one call?

Yes — ?amount=5 (max 10). The response then has a jokes array and an amount field.

What is the Dark category?

Edgier jokes. Exclude it (don’t list it, and use safe-mode) for general audiences; only include it deliberately.

New to APIs?

Short guides for working with this API — and any other.

🛠️ Handy LarzOS tools

Free tools to help you work with this API.

JSON Formatter

Related Fun & Random APIs

← Back

More Fun & Random APIs · All 196 APIs