Search…
⌃K
Links
🎲

Random

All kinds of jokes of different types
get
https://api.night-api.com/
jokes
Random joke
Lists of available categories:
  • global
  • dev
  • dark
  • limit
  • beauf
  • blondes
const axios = require("axios");
​
axios.get('https://api.night-api.com/jokes', {
headers: {
authorization: "API token"
}
})
.then(function (response) {
console.log(response.data);
})
Or with the NPM module
const { NightAPI } = require('night-api');
const api = new NightAPI('YOUR_API_KEY');
​
const blague = await api.jokes.random(); // Return: Promise
With this method, you can specify certain categories that you do not want to receive.
const { NightAPI } = require('night-api');
const api = new NightAPI('YOUR_API_KEY');
​
const blague = await api.jokes.random({
disallow: ['dark', 'limit']
}); // Return: Promise