LogoLogo
  • 👥About us
  • 💾Changelogs
    • 🌐API
    • 📲Module
  • ⛔Rate-Limit
  • ✨Start with the NPM module
  • Module
    • 📸Images
      • 🐬Animals
    • 🎮Games
      • 🎮Garry's Mod
      • 🎮Minecraft
      • 🎮FiveM
  • Joke
    • 🤣Jokes
      • 🎲Random
      • 📋Category
      • 🆔ID
  • Images
    • 🐙Animals
      • 🐕Dog
      • 🐈Cat
      • 🦊Fox
      • 🦒Giraffe
      • 🦘Kangaroo
      • 🦁Lion
      • 🐒Quokka
      • 🐺Wolf
      • 🦎Lézard
      • 🐆Léopard
      • 🐒Singes
      • 🦚Paon
      • 🐹Hamster
    • 🥘SFW
      • 🎲Random
      • 📋Category
      • 🆔ID
    • 🔞NSFW
      • 🎲Random
      • 📋Category
      • 🆔ID
    • 🏗️Utils
      • 📸QR Code
        • 🔁Generator
        • 📃Reader
      • 🔐Captcha
      • ℹ️IP infos
  • Games
    • 🎮Games
      • 🎮Garry's Mod
      • 🎮Minecraft
      • 🎮FiveM
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Joke
  2. Jokes

Random

All kinds of jokes of different types

Random joke

GET https://api.night-api.com/jokes

Génère une blague aléatoirement.

Query Parameters

Name
Type
Description

disallow

string

To avoid the generation of certain categories of jokes

Headers

Name
Type
Description

authorization*

String

Your API key

{
    "status": 200,
    "content": {
        "id": 44,
        "type": "global",
        "blague": "Que dit un canard quand il va aux toilettes ?",
        "reponse": "Je vais au petit coin."
    }
}
{ 
    status: 400, 
    error: "Bad disallow query provided"
}

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
PreviousJokesNextCategory

Last updated 2 years ago

Was this helpful?

🤣
🎲