Chuck Norris once broke the law. They are still trying to put it back together.
Hey, you! Have you ever felt a BURNING desire to have access to Chuck Norris jokes in your code project, whenever and wherever the situation calls for it (as it has SURELY called for it at some point)? Of course you have, who hasn't! So let's jump straight into today's API: the Chuck Norris Jokes API.
Chuck Norris won on TV's "Jeopardy" game show by answering every question with "Who is Chuck Norris."
Getting started with the Chuck Norris Jokes API is pretty simple; all you have to do is send a GET request to the jokes endpoint, depending on what kind of a joke you want (if you just want a random one, jokes/random
works perfectly fine!). You don't need anything special to access it, so have fun throwing Chuck Norris jokes around your next web project!
Chuck Norris keeps a shotgun in his wallet.
When you make a GET request to the API, it returns a JSON object that looks like this:
{
"categories": [],
"created_at": "2020-01-05 13:42:18.823766",
"icon_url": "https://api.chucknorris.io/img/avatar/chuck-norris.png",
"id": "uyvvbkzaqlo5ao1v7sxx4a",
"updated_at": "2020-01-05 13:42:18.823766",
"url": "https://api.chucknorris.io/jokes/uyvvbkzaqlo5ao1v7sxx4a",
"value": "There?s an order to the universe: space, time, Chuck Norris.... Just kidding, Chuck Norris is first."
}
You can get a list of valid categories by visiting or making a request to the categories endpoint (https://api.chucknorris.io/jokes/categories). You can get random jokes from a category of your choosing by simply adding a category parameter with the value being your chosen category. For example, if you made a request to https://api.chucknorris.io/jokes/random?category=dev, you could get a response like this:
{
"categories": [
"dev"
],
"created_at": "2020-01-05 13:42:19.324003",
"icon_url": "https://api.chucknorris.io/img/avatar/chuck-norris.png",
"id": "7tuczvb2rpy-xn7alkmz0w",
"updated_at": "2020-01-05 13:42:19.324003",
"url": "https://api.chucknorris.io/jokes/7tuczvb2rpy-xn7alkmz0w",
"value": "Chuck Norris's OSI network model has only one layer - Physical."
}
Here's what each part of these responses mean:
-
"categories"
holds an array of categories being used for the search. -
"created_at"
and"updated_at"
are simply dates showing when the joke was added to / updated in the database, something you don't really have to worry about. -
"icon-url"
is an avatar image of Chuck Norris himself! -
"url"
is the url directly to the joke on the api's website, and"id"
references the joke's actual ID to be appended to the basic url. - Most importantly,
"value"
is the actual joke! You need to access this value to be able to save or use the joke anywhere.
Chuck Norris made Minute Maid lemonade in 59 seconds.
To use this on a website, you'd want to access and display at LEAST the value
... value. Optionally, you can also display the icon for fun, the urls so that people can find the jokes they like again later on, and what categories were used for the search if you allow people to choose.
If the endless applications of this API aren't immediately apparent, let's go over some potential uses of it:
- An informational Chuck Norris Facts website!
- A Chuck Norris History page!
- Chuck Norris Trivia Night!
- Informing the uninformed visitors of your websites of the greatness that is Chuck Norris!
- Official Government Websites that wish to warn foul ruffians, various ne'er-do-wells, and uncouth law-breakers of the threat that is Chuck Norris!
- Entertaining users of your otherwise boring, non-Chuck-Norris-ified applications with comedic AND factual Chuck Norris jokes!
- Many, many more!
Chuck Norris invented beer & pizza. He also invented the wheel but it doesn't taste as good at a Superbowl parties.
Well, that pretty much wraps up this blog! Naturally, the Chuck Norris Jokes API is THE most interesting application on the internet, so there's not much to be said about that. I'd love to explore it further, but unfortunately, I'd likely disintegrate while doing so just from the sheer awesomeness that is Chuck Norris.
So, that's all from me this time! Just remember: If Chuck Norris is on your side, then Nationwide becomes irrelevant.