Geek-Jokes API

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

Overview

Geek-Jokes API delivers random programming and technology-themed jokes as plain text with a single GET request. It needs no API key or registration, making it one of the simplest APIs you can call. It is a perfect first API for beginners who want to practice making HTTP requests and handling text responses.

💡

Beginner Tip

The API returns a single plain text joke by default — not JSON — so do not try to parse the response with JSON.parse(). Add ?format=json to the URL to get a proper JSON response instead.

Available Data

joke text (setup/punchline)
joke category
joke type (single/twopart)
randomly generated data
customizable output format

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

joke The text of a random geek or programming-themed joke (only returned when using ?format=json)

Implementation Example

const url = "https://github.com/sameerkumar18/geek-joke-api";
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

JSON.parse error The default response is plain text, not JSON
Add ?format=json to the URL to get a proper JSON response with a joke field
CORS error in browser Some browser environments restrict cross-origin plain text responses
Use ?format=json which has proper CORS headers, or fetch from a Node.js backend
Connection refused or 502 The community-hosted API occasionally goes offline
Add error handling to catch fetch failures and display a fallback joke from a local array

Matrix Score Breakdown

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

Fully tested on Apr 5, 2026

Technical Specifications

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

Similar APIs

View All →