JokeAPI

FREE
By Sv443
Updated 2 months ago
Entertainment
9/10
Popularity Score
366ms
Latency
95%
Success Rate

JokeAPI API Documentation

A carefully formatted and easy to use RESTful joke API that serves jokes in JSON, XML or YAML format from many categories while also offering many filtering methods.

View API Details
GETAvailable joke categories
GETInformation about JokeAPI
GETJoke endpoint
GETAvailable joke categories

This endpoint serves all available categories

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Optional Parameters
formatSTRING
OPTIONALFile format of the payload. Use "json", "xml" or "yaml" or leave empty/invalid to default to "json"
blacklistFlagsSTRING
OPTIONALUse this to filter out certain jokes. More information: https://sv443.net/jokeapi#flags
Code Snippet
unirest.get("https://jokeapi.p.rapidapi.com/categories?format=json")
.header("X-RapidAPI-Host", "jokeapi.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://jokeapi.p.rapidapi.com/categories
Request Method: GET
Response Headers
Response Body

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.get("https://jokeapi.p.rapidapi.com/categories?format=json")
.header("X-RapidAPI-Host", "jokeapi.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication