API

dadjokechampion.com can be used as an API for fetching a random joke.

Calling the API

Authentication

No authentication is required to use the dadjokechampion.com API.

API response format

All API endpoints follow their respective browser URLs, but we adjust the response formatting to be more suited for an API based on the provided HTTP Accept header.

Accepted Accept headers:

  • application/json - JSON response (default response format)
  • application/xml - XML response

Endpoints

Fetch a random dad joke

GET https://api.dadjokechampion.com/joke/random fetch a random dad joke.

        
$ curl -H "Accept: application/json" https://api.dadjokechampion.com/joke/{shortid}
{
    "shortId": "t9PVKTyc",
    "jokeText": "Why do standup comedians perform poorly in Hawaii? Because the audience only responds in a low ha."
}
            
        

Fetch a dad joke

GET https://api.dadjokechampion.com/joke/{shortid} fetch a specific dad joke.

        
$ curl -H "Accept: application/json" https://api.dadjokechampion.com/joke/{shortid}
{
    "shortId": "t9PVKTyc",
    "jokeText": "Why do standup comedians perform poorly in Hawaii? Because the audience only responds in a low ha."
}