Random Joke API

This is a simple API that returns a random joke. You can filter the jokes by tags and keywords. To make sure they are safe for work, you could use the exclude-tags parameter to exclude jokes with certain tags such as "nsfw" or "religious".

If you want to filter the jokes using include-tags or exclude-tags you can use one or more of the following:

This API wraps the random jokes endpoint by Humor API. Check out the tutorial about writing a joke and meme app using this API.

  • animal
  • clean
  • one_liner
  • food
  • sexual
  • relationship
  • religious
  • racist
  • sport
  • kids
  • holiday
  • knock_knock
  • nerdy
  • law
  • political
  • q_a
  • school
  • christmas
  • chuck_norris
  • dark
  • nsfw
  • analogy
  • jewish
  • yo_mama
  • sexist
  • blondes
  • deep_thoughts
  • insults
  • animal
  • clean
  • one_liner
  • food
  • sexual
  • relationship
  • religious
  • racist
  • sport
  • kids
  • holiday
  • knock_knock
  • nerdy
  • law
  • political
  • q_a
  • school
  • christmas
  • chuck_norris
  • dark
  • nsfw
  • analogy
  • jewish
  • yo_mama
  • sexist
  • blondes
  • deep_thoughts
  • insults
GET
https://api.apileague.com/retrieve-random-joke
Example Request and Response
GET
https://api.apileague.com/{{ examples.getRandomJoke }}
{
    "joke": "What do you call a boxing match between two aardvarks?\nA snout bout!"
}
cURL
Java
Javascript
Python
Go
C#
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}

Frequently Asked Questions

Can I filter jokes by category?

Yes, you can use the `include-tags` parameter to find jokes in specific categories like "nerdy", "dad", or "programming", and `exclude-tags` to avoid others.

Are the jokes safe for work?

You can ensure jokes are safe for work by excluding tags like "nsfw", "racist", "sexist", or "sexual".

How many jokes are in the database?

The API has access to a large and growing database of thousands of jokes across many different categories.

How is the Random Joke API different from the Search Jokes API?

The Random Joke API returns a single random joke, potentially filtered by tags, while the Search Jokes API allows you to search for specific jokes using keywords.

Questions? Need Help? Ask Away