chucknorris.io

chucknorris.io

Personality

JSON API for hand curated Chuck Norris jokes. The Chuck Norris app existed even before slack existed. Start retrieving random Chuck Norris facts by just typing /chuck into your slack console. Additionally you can type /chuck {category_name} to get a random joke from a given category. Type /chuck -cat to show a list of all available categories. You can also try the free text search by sending /chuck ? {search_term}. Fool your coworkers by personalizing your Chuck Facts with /chuck @{user_name}.

Visit API

πŸ“š Documentation & Examples

Everything you need to integrate with chucknorris.io

πŸš€ Quick Start Examples

chucknorris.io Javascript Examplejavascript
// chucknorris.io API Example
const response = await fetch('https://api.chucknorris.io', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

const data = await response.json();
console.log(data);

Chuck Norris API

The Chuck Norris API is a public API that provides access to a database of Chuck Norris jokes. It is available at https://api.chucknorris.io. In this blog post, we will explore some example JavaScript code for using this API.

Getting a Random Joke

To get a random Chuck Norris joke, we can use the following JavaScript code:

fetch('https://api.chucknorris.io/jokes/random')
  .then(response => response.json())
  .then(data => {
    console.log(data.value);
  });

This code makes a fetch request to the URL https://api.chucknorris.io/jokes/random and gets a JSON response. We then extract the joke text from the response and log it to the console.

Getting a Categorized Joke

If we want to get a Chuck Norris joke that is categorized, we can use the following JavaScript code:

fetch('https://api.chucknorris.io/jokes/random?category=dev')
  .then(response => response.json())
  .then(data => {
    console.log(data.value);
  });

This code makes a fetch request to the URL https://api.chucknorris.io/jokes/random?category=dev, which gets a random joke related to the category specified in the category parameter. In this example, we are requesting a joke about development (dev).

Searching for Jokes

To search for Chuck Norris jokes, we can use the following JavaScript code:

fetch('https://api.chucknorris.io/jokes/search?query=computer')
  .then(response => response.json())
  .then(data => {
    console.log(data.result[0].value);
  });

This code makes a fetch request to the URL https://api.chucknorris.io/jokes/search?query=computer, which searches for jokes that contain the word "computer". The data.result array contains the results of the search, and we extract the first joke from the array.

Conclusion

The Chuck Norris API is a fun and easy-to-use API for getting Chuck Norris jokes. With the example JavaScript code in this blog post, you can easily get a random joke, a categorized joke, or search for jokes containing specific keywords. Give it a try and have some laughs!

πŸ“Š 30-Day Uptime History

Daily uptime tracking showing online vs offline minutes

Jun 3Jun 5Jun 7Jun 9Jun 11Jun 13Jun 15Jun 17Jun 19Jun 21Jun 23Jun 25Jun 27Jun 29Jul 204008001440Minutes
Online
Offline

Related APIs in Personality