TL;DR
icanhazdadjoke is a dedicated API for dad jokes — intentionally cheesy, pun-filled one-liners that make you groan and smile. Each joke has a unique ID, a joke text, and a permalink on their website. The API supports getting a random joke, searching by keyword (handy for themed joke sessions), and retrieving specific jokes by ID. Set the Accept header to application/json for structured JSON, or text/plain for raw joke text. No API key, no rate limits advertised.
Quick start: https://icanhazdadjoke.com/
No API key needed — just make a request!
https://icanhazdadjoke.com/
How to Use This API
1. Random Joke (JSON)
Set the Accept header to request JSON:
curl -H "Accept: application/json" https://icanhazdadjoke.com/
Returns: {"id": "abc123", "joke": "Why don't scientists trust atoms? They make up everything!", "status": 200}
2. Random Joke (Plain Text)
curl -H "Accept: text/plain" https://icanhazdadjoke.com/
3. Search Jokes
Find jokes about a specific topic:
https://icanhazdadjoke.com/search?term=pirate&limit=5
4. Get Joke by ID
https://icanhazdadjoke.com/j/{jokeId}
5. JavaScript — Fetch Dad Joke
fetch('https://icanhazdadjoke.com/', {
headers: { 'Accept': 'application/json' }
})
.then(res => res.json())
.then(data => {
console.log(data.joke);
console.log(`Joke ID: ${data.id}`);
})
.catch(err => console.error('No jokes for you:', err));
6. Python — Get Multiple Jokes
import requests
headers = {'Accept': 'application/json'}
# Random joke
resp = requests.get('https://icanhazdadjoke.com/', headers=headers)
print(f"Random: {resp.json()['joke']}\n")
# Search for food jokes
resp = requests.get(
'https://icanhazdadjoke.com/search',
params={'term': 'food', 'limit': 3},
headers=headers
)
jokes = resp.json()['results']
for j in jokes:
print(f"- {j['joke']}")
Frequently Asked Questions
- How many dad jokes are available?
- The database contains thousands of dad jokes contributed by the community. New jokes can be submitted via the website.
- Do I need an API key?
- No. icanhazdadjoke is completely free with no authentication required. Just set the appropriate
Acceptheader. - How do I get JSON output?
- Set the
Acceptrequest header toapplication/json. Without it, the API returns HTML (showing the joke on a webpage). - Can I search for jokes by keyword?
- Yes, use
/search?term=keyword. Results include matching jokes with pagination support via thepageparameter. - What format does the search response use?
- JSON with fields: current_page, limit, next_page, previous_page, results (array of joke objects), search_term, status, and total_jokes.
- Are there rate limits?
- No documented rate limits. The API is designed for fun and casual use, but please be reasonable with request volume.
API Details
- API URL
https://icanhazdadjoke.com/- Documentation
- icanhazdadjoke.com/api
- Category
- Fun
- Authentication
- Not Required
- Geographic Coverage
- Global
What You Can Build
- Morning dad joke email subscription — start every day with a groan
- Slack bot that posts random dad jokes in #watercooler at lunchtime
- Alexa skill that tells dad jokes on voice command
- Joke-of-the-day widget for your team's internal dashboard
- Android/iOS widget that shows a fresh dad joke on your home screen