JokeAPI API

⭐ Beginner's Pick Games & Comics / No Auth Required Beginner HTTPS CORS
Free to Use Varies (check documentation)

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.

Available Data

joke text (setup/punchline)
joke category
joke type (single/twopart)

Example Response

JSON Response
{
  "error": false,
  "category": "Programming",
  "type": "twopart",
  "setup": "Why do programmers prefer dark mode?",
  "delivery": "Because light attracts bugs.",
  "id": 42,
  "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.
setup The question or premise of the joke when type is twopart.
delivery The punchline of the joke when type is twopart.
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

// ⚠️ Note: This URL may be a documentation page. Check official docs for actual API endpoint.
const url = "https://sv443.net/jokeapi/v2/";
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.

Common Errors & Troubleshooting

Error object in response An invalid category name or unknown query parameter was used.
Check valid category names (Programming, Misc, Dark, Pun, Spooky, Christmas) and valid flag names in the docs.
Joke not appropriate for audience No blacklist flags were set, allowing all content types.
Add blacklistFlags=nsfw,racist,sexist,explicit to the query string to filter out inappropriate content.
429 Too Many Requests You have exceeded the 120 requests per minute rate limit.
Cache joke responses for a few minutes and slow down the frequency of API calls.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 5/20
🔒 Security 15/15
🛠 Developer XP 20/20
✓ Reliability 7/15
Response Time 1019ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS YES
Category Games & Comics
Difficulty Beginner
Verified: 2026-04-04

Recipes Using JokeAPI

Build something with this API. Each recipe includes step-by-step instructions and code outlines.

Similar APIs

View All →