icanhazdadjoke picks its response format from the Accept header: application/json, text/plain, or an HTML page by default.
None — no key, no signup. Every example runs as-is.
Full reference: https://icanhazdadjoke.com/api
The Accept header is what gets you JSON.
curl https://icanhazdadjoke.com/ \
-H "Accept: application/json"
{
"id": "71wsPKeF6h",
"joke": "What did the dog say to the two trees? Bark bark.",
"status": 200
}
Paginated with page and limit.
curl "https://icanhazdadjoke.com/search?term=cat&limit=2" \
-H "Accept: application/json"
{
"current_page": 1,
"limit": 2,
"next_page": 2,
"previous_page": 1,
"results": [
{
"id": "8UnrHe2T0g",
"joke": "‘Put the cat out’ … ‘I didn’t realize it was on fire"
},
{
"id": "daaUfibh",
"joke": "Why was the big cat disqualified from the race? Because it was a cheetah."
}
],
"search_term": "cat",
"status": 200,
"total_jokes": 11,
"total_pages": 6
}