Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Night API Documentation, to explain you how to use the API and the NPM module properly
Voici les rate-limites pour les différentes routes de l'API
Jokes - 5 req/sec
(⭐10 req/sec
)
Games - 4 req/sec
(⭐ 8 req/sec
)
Animals - 10 req/sec*
(⭐ 20 req/sec*
)
NSFW - 10 req/sec
(⭐ 20 req/sec
)
SFW - 10 req/sec
(⭐ 20 req/sec
)
Generateurs (QRcode, Captcha, reader) - 3 req/sec
(⭐ 5 req/sec
)
IP infos - 10 req/sec
(⭐ 20 req/sec
)
L'étoile "⭐" indique le rate-limites pour les membres premium * : La rate-limit s'applique à toute requete pour une image d'animaux
The differents methods to get images with the NPM module
Differents images types exist in the API, currently there are three and here they are:
Animals: You will receive only animals image
SFW: You will receive only SFW (Safe For Work) images
NSFW: You will receive only NSFW (Not Safe For Work) images
Currently we have 13 animals available on the API:
Animals available:
Dog
Cat
Fox
Giraffe
Kangaroo
Lion
Quokka
Wolf
Lézard
Léopard
Singes
Paon
Hamster
This API requires an API key to be sent along with your requests: Get yours by creating an account
Currently there are 13 animals available on the API:
View all the changelogs of the API and the NPM module since the start of the project
The changelogs since the start of Night-API
The changelogs since the start of Night-API
This API requires an API key to be sent along with your requests: Get yours by creating an account
// You can add an ID in the parameter of the function to get an image with an precise ID
// Or without ID parameter for random images
// Return: Promise
const image = await api.animals.dog();
const image = await api.animals.cat(5);
const image = await api.animals.fox(10);
const image = await api.animals.giraffe(7);
const image = await api.animals.kangaroo(1);
const image = await api.animals.lion();
const image = await api.animals.quokka();
const image = await api.animals.wolf();
const image = await api.animals.lezard();
const image = await api.animals.leopard();
const image = await api.animals.singes();
const image = await api.animals.paon();
const image = await api.animals.hamster();
const fivem = await api.games.fivem("play.blueislandrp.com"); // Return: Promise
ID
Number
An image ID
authorization*
String
Your API key
const axios = require("axios");
axios.get('https://api.night-api.com/images/animals/dog', {
headers: {
authorization: "Your API token"
}
})
.then(function (response) {
console.log(response.data);
})
{
status: 400,
content: 'Clé invalide'
}
{
"status": 200,
"content": {
"id": 8100,
"url": "https://cdn.night-api.com/api/images/animals/dog/n02097298_8858.jpg"
}
}
ID
Number
An image ID
authorization*
String
Your API key
const axios = require("axios");
axios.get('https://api.night-api.com/images/animals/fox', {
headers: {
authorization: "Your API token"
}
})
.then(function (response) {
console.log(response.data);
})
{
status: 400,
content: 'Clé invalide'
}
{
"status": 200,
"content": {
"id": 20,
"url": "https://cdn.night-api.com/api/images/animals/fox/buvjE7yp4g3J7niFSpby.jpg"
}
}
You can simply install dependence on your project from NPM:
$ npm install night-api
// ES6 (includes typings)
import { NightAPI } from 'night-api';
// CommonJS
const { NightAPI } = require('night-api');
To use the API, you need an authentication key that you can get by connecting or register to Night-API
const api = new NightAPI('YOUR_API_KEY');
Choose which Category of joke you would like to have
GET
https://api.night-api.com/jokes/:type
type*
string
Type of jokes to get (global, beauf, dev, limit, dark)
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 type provided"
}
Lists of available categories:
global
dev
dark
limit
beauf
blondes
const axios = require("axios");
axios.get('https://api.night-api.com/jokes/global', {
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.byCategory('dev'); // Return: Promise
GET
https://api.night-api.com/images/animals/lion/:id
ID
Number
An image ID
authorization*
String
Your API key
{
status: 400,
content: 'Clé invalide'
}
{
"status": 200,
"content": {
"id": 85,
"url": "https://cdn.night-api.com/api/images/animals/lion/vSQyFukiLqADzWuj0opr.jpg"
}
}
const axios = require("axios");
axios.get('https://api.night-api.com/images/animals/lion', {
headers: {
authorization: "Your API token"
}
})
.then(function (response) {
console.log(response.data);
})
GET
https://api.night-api.com/images/animals/leopard/:id
ID
Number
An image ID
authorization*
String
Your API key
{
status: 400,
content: 'Clé invalide'
}
{
"status": 200,
"content": {
"id": 30,
"url": "https://cdn.night-api.com/api/images/animals/leopard/L65sgTJWVLaEnvi4455AaBIobg3U1v.png"
}
}
const axios = require("axios");
axios.get('https://api.night-api.com/images/animals/leopard', {
headers: {
authorization: "Your API token"
}
})
.then(function (response) {
console.log(response.data);
})
The differents methods to get game server information with the NPM module
Differents games exist in the API, currently there are three and here they are:
Garry's Mod: Get information of a Garry's Mod server by his IP
Minecraft: Get information of a Minecraft server by his IP
FiveM: Get information of a FiveM server by his IP
The QRcode category have two part:
QRcode generator: You can generate a QRcode of your choice
QRcode reader: You can read the data of a QRcode (For detect dangerous QRcode or other)
Basic information to know before using the SFW API
This API requires an API key to be sent along with your requests: Get yours by creating an account
Different methods exist to have SFW images, currently there are three and here they are:
Random SFW: You have random images
SFW images by category: You will receive only the images of which you indicated the category
SFW images by ID: You will receive the images of which you indicate the ID
Here is an example of what each method returns
{
"status": 200,
"content": {
"id": 34,
"type": "holo",
"url": "https://cdn.night-api.com/api/images/sfw/holo/75f9fcb764921bfaedc9e4182db02.jpg"
}
}
Basic information to know before using the Jokes API
This API requires an API key to be sent along with your requests: Get yours by creating an account
Different methods exist to have jokes, currently there are three and here they are:
: You can only choose which category of joke you do not want to have
: You will receive only the jokes of which you indicated the category
: You will receive the jokes of which you indicate the ID
Here is an example of what each method returns
authorization*
String
Your API key
const axios = require("axios");
axios.get('https://api.night-api.com/images/sfw', {
headers: {
authorization: "Your API token"
}
})
.then(function (response) {
console.log(response.data);
})
// Return: Promise
const { NightAPI } = require('night-api');
const api = new NightAPI('YOUR_API_KEY');
const image = await api.sfw.fetchImage(); // Random images
{
"status": 200,
"content": {
"id": 34,
"type": "holo",
"url": "https://cdn.night-api.com/api/images/sfw/holo/75f9fcb764921bfaedc9e4182db02.jpg"
}
}
{
"status": 400,
"content": "Invalid key"
}
ID
Number
An image ID
authorization*
String
Your API key
const axios = require("axios");
axios.get('https://api.night-api.com/images/animals/singes', {
headers: {
authorization: "Your API token"
}
})
.then(function (response) {
console.log(response.data);
})
{
status: 400,
content: 'Clé invalide'
}
{
"status": 200,
"content": {
"id": 11,
"url": "https://cdn.night-api.com/api/images/animals/singes/8qNt9tHHyQePblna9Xc7vDBKC2vl7a.png"
}
}
type*
String
The type of SFW mage to get
authorization*
String
Your API key
const axios = require("axios");
axios.get('https://api.night-api.com/images/sfw/holo', {
headers: {
authorization: "Your API token"
}
})
.then(function (response) {
console.log(response.data);
})
// Return: Promise
const { NightAPI } = require('night-api');
const api = new NightAPI('YOUR_API_KEY');
const image = await api.sfw.fetchImage("holo"); // Random images of category "holo"
{
"status": 200,
"content": {
"id": 34,
"type": "holo",
"url": "https://cdn.night-api.com/api/images/sfw/holo/75f9fcb764921bfaedc9e4182db02.jpg"
}
}
{
"status": 400,
"content": "Bad type provided"
}
ID
Number
An image ID
authorization*
String
Your API key
const axios = require("axios");
axios.get('https://api.night-api.com/images/animals/kangaroo', {
headers: {
authorization: "Your API token"
}
})
.then(function (response) {
console.log(response.data);
})
{
status: 400,
content: 'Clé invalide'
}
{
"status": 200,
"content": {
"id": 20,
"url": "https://cdn.night-api.com/api/images/animals/kangaroo/Dlf291qsSZSP5CnElpTd.jpg"
}
}
Number
The image ID
authorization*
String
Your API key
const axios = require("axios");
axios.get('https://api.night-api.com/images/sfw/5', {
headers: {
authorization: "Your API token"
}
})
.then(function (response) {
console.log(response.data);
})
// Return: Promise
const { NightAPI } = require('night-api');
const api = new NightAPI('YOUR_API_KEY');
const image = await api.sfw.fetchImage(5); // Image with ID 5
{
"status": 200,
"content": {
"id": 34,
"type": "holo",
"url": "https://cdn.night-api.com/api/images/sfw/holo/75f9fcb764921bfaedc9e4182db02.jpg"
}
}
{
"status": 400,
"content": "Bad type provided"
}
ID
Number
An image ID
authorization*
String
Your API key
const axios = require("axios");
axios.get('https://api.night-api.com/images/animals/lezard', {
headers: {
authorization: "Your API token"
}
})
.then(function (response) {
console.log(response.data);
})
{
status: 400,
content: 'Clé invalide'
}
{
"status": 200,
"content": {
"id": 19,
"url": "https://cdn.night-api.com/api/images/animals/lezard/ECbzuiDnjG31eMpgqVUJ8Lq7n4inm4.png"
}
}
ID
Number
An image ID
authorization*
String
Your API key
const axios = require("axios");
axios.get('https://api.night-api.com/images/animals/giraffe', {
headers: {
authorization: "Your API token"
}
})
.then(function (response) {
console.log(response.data);
})
{
status: 400,
content: 'Clé invalide'
}
{
"status": 200,
"content": {
"id": 66,
"url": "https://cdn.night-api.com/api/images/animals/giraffe/VPtYnonS49dQoSROTwfV.jpg"
}
}
ID
Number
An image ID
authorization*
String
Your API key
const axios = require("axios");
axios.get('https://api.night-api.com/images/animals/quokka', {
headers: {
authorization: "Your API token"
}
})
.then(function (response) {
console.log(response.data);
})
{
status: 400,
content: 'Clé invalide'
}
{
"status": 200,
"content": {
"id": 31,
"url": "https://cdn.night-api.com/api/images/animals/quokka/FZe2h2UJXtxBVsR48cbf.png"
}
}
All kinds of jokes of different types
GET
https://api.night-api.com/jokes
Génère une blague aléatoirement.
disallow
string
To avoid the generation of certain categories of jokes
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
GET
https://api.night-api.com/images/animals/paon/:id
ID
Number
An image ID
authorization*
String
Your API key
{
status: 400,
content: 'Clé invalide'
}
{
"status": 200,
"content": {
"id": 18,
"url": "https://cdn.night-api.com/api/images/animals/paon/HSpg6YgX92xnPY16AsoJxVXPs8KVQE.png"
}
}
const axios = require("axios");
axios.get('https://api.night-api.com/images/animals/paon', {
headers: {
authorization: "Your API token"
}
})
.then(function (response) {
console.log(response.data);
})
Choose a specific joke by its ID
GET
https://api.night-api.com/jokes/:id
id*
number
ID de la blague à récupérer (Entre 1 et 900)
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 ID provided",
}
const axios = require("axios");
axios.get('https://api.night-api.com/jokes/44', {
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.byID(50); // Return: Promise
GET
https://api.night-api.com/images/animals/hamster/:id
ID
Number
An image ID
authorization*
String
Your API key
{
status: 400,
content: 'Clé invalide'
}
{
"status": 200,
"content": {
"id": 61,
"url": "https://cdn.night-api.com/api/images/animals/hamster/ToI1QDI7f2NVHaujjz67s9NWFDUsxx.png"
}
}
const axios = require("axios");
axios.get('https://api.night-api.com/images/animals/hamster', {
headers: {
authorization: "Your API token"
}
})
.then(function (response) {
console.log(response.data);
})
{
"status": 200, //The status allows to know if the joke was found or not
"content": {
"id": 44, // The unique identifier
"type": "global", // The category of the joke
"blague": "Que dit un canard quand il va aux toilettes ?", // The joke
"reponse": "Je vais au petit coin." // The answer
}
}
Basic information to know before using the NSFW API
This API requires an API key to be sent along with your requests: Get yours by creating an account
Different methods exist to have NSFW images, currently there are three and here they are:
: You have random images
: You will receive only the images of which you indicated the category
: You will receive the images of which you indicate the ID
Here is an example of what each method returns
authorization*
String
Your API key
const axios = require("axios");
axios.get('https://api.night-api.com/images/nsfw', {
headers: {
authorization: "Your API token"
}
})
.then(function (response) {
console.log(response.data);
})
// Return: Promise
const { NightAPI } = require('night-api');
const api = new NightAPI('YOUR_API_KEY');
const image = await api.nsfw.fetchImage(); // Random images
{
"status": 200,
"content": {
"id": 23,
"type": "ass",
"url": "https://cdn.night-api.com/api/images/nsfw/ass/4208ec0c4590ed4622e451f386e39.jpg"
}
}
{
"status": 400,
"content": "Invalid key"
}
id*
Number
The id of NSFW image to get
authorization*
String
Your API key
const axios = require("axios");
axios.get('https://api.night-api.com/images/nsfw/5', {
headers: {
authorization: "Your API token"
}
})
.then(function (response) {
console.log(response.data);
})
// Return: Promise
const { NightAPI } = require('night-api');
const api = new NightAPI('YOUR_API_KEY');
const image = await api.nsfw.fetchImage(5); // Image with the ID 5
{
"status": 200,
"content": {
"id": 23,
"type": "ass",
"url": "https://cdn.night-api.com/api/images/nsfw/ass/4208ec0c4590ed4622e451f386e39.jpg"
}
}
{
"status": 400,
"content": "Bad type provided"
}
authorization*
String
Your API key
codeSize
Number
Size of the code to generate between 4 and 10
Default : 6
const axios = require("axios");
const { writeFileSync } = require('fs');
axios.get('https://api.night-api.com/images/captcha', {
headers: {
authorization: "Your API token"
},
data: {
codeSize: 9 // Between 4 and 10
}
})
.then(async function (res) {
console.log(res.data);
writeFileSync(`${__dirname}/captcha.png`, Buffer.from(res.data.content.image, 'base64'));
})
// Return: Promise
const { NightAPI } = require('night-api');
const api = new NightAPI('YOUR_API_KEY');
const captha = await api.captcha.generate(); // Generate captcha
// You can use this function for choose the number of caracters beetween 4 and 10
const captha = await api.captcha.generate(6);
{
status: 200,
content: {
code: 'ju0bm1',
codeSize: 6,
image: {
type: 'Buffer',
data: [Array]
}
}
}
{
"status": 400,
"content": "Invalid Key"
}
Choose which Category of joke you would like to have
GET
https://api.night-api.com/images/nsfw/:type
type*
String
The type of NSFW image to get
authorization*
String
Your API key
{
"status": 200,
"content": {
"id": 23,
"type": "ass",
"url": "https://cdn.night-api.com/api/images/nsfw/ass/4208ec0c4590ed4622e451f386e39.jpg"
}
}
{
"status": 400,
"content": "Bad type provided"
}
Lists of available NSFW categories:
Anal
Ass
Boobs
Gonewild
Hanal
Hass
Hboobs
Hentai
Hkitsune
Hmidriff
Hneko
Hthigh
Neko
Paizuri
Pgif
Pussy
Tentacle
Thigh
Yaoi
const axios = require("axios");
axios.get('https://api.night-api.com/images/nsfw/ass', {
headers: {
authorization: "Your API token"
}
})
.then(function (response) {
console.log(response.data);
})
Or with the module
// Return: Promise
const { NightAPI } = require('night-api');
const api = new NightAPI('YOUR_API_KEY');
const image = await api.nsfw.fetchImage("anal"); // Random images of category "anal"
GET
https://api.night-api.com/images/animals/cat/:id
ID
Number
An image ID
authorization*
String
Your API key
{
status: 400,
content: 'Clé invalide'
}
{
"status": 200,
"content": {
"id": 760,
"url": "https://cdn.night-api.com/api/images/animals/cat/pb.jpg"
}
}
const axios = require("axios");
axios.get('https://api.night-api.com/images/animals/cat', {
headers: {
authorization: "Your API token"
}
})
.then(function (response) {
console.log(response.data);
})
{
"status": 200,
"content": {
"id": 23,
"type": "ass",
"url": "https://cdn.night-api.com/api/images/nsfw/ass/4208ec0c4590ed4622e451f386e39.jpg"
}
}
ip*
String
IP adress
authorization*
String
Your API key
{
"status": 400,
"content": "Invalid Key"
}
const axios = require("axios");
axios.get('https://api.night-api.com/general/ipinfo/8.8.8.8', {
headers: {
authorization: "Your API token"
}
})
.then(function (response) {
console.log(response.data);
})
// Return: Promise
const { NightAPI } = require('night-api');
const api = new NightAPI('YOUR_API_KEY');
const ip = await api.ipinfo.getInfos('8.8.8.8'); // Get infos about IP
{
"status": 200,
"content": {
"ip": "8.8.8.8",
"continent": {
"code": "NA",
"geoname_id": 6255149,
"names": {
"de": "Nordamerika",
"en": "North America",
"es": "Norteamérica",
"fr": "Amérique du Nord",
"ja": "北アメリカ",
"pt-BR": "América do Norte",
"ru": "Северная Америка",
"zh-CN": "北美洲"
}
},
"country": {
"geoname_id": 6252001,
"iso_code": "US",
"names": {
"de": "Vereinigte Staaten",
"en": "United States",
"es": "Estados Unidos",
"fr": "États Unis",
"ja": "アメリカ",
"pt-BR": "EUA",
"ru": "США",
"zh-CN": "美国"
}
},
"location": {
"accuracy_radius": 1000,
"latitude": 37.751,
"longitude": -97.822,
"time_zone": "America/Chicago"
},
"registered_country": {
"geoname_id": 6252001,
"iso_code": "US",
"names": {
"de": "Vereinigte Staaten",
"en": "United States",
"es": "Estados Unidos",
"fr": "États Unis",
"ja": "アメリカ",
"pt-BR": "EUA",
"ru": "США",
"zh-CN": "美国"
}
},
"autonomous_system_number": 15169,
"autonomous_system_organization": "GOOGLE",
"is_v4": true,
"is_v6": false,
"ip_version": 4,
"privacy": {
"is_mobile": false,
"is_bad": false,
"is_bogon": false,
"is_datacenter": false,
"is_proxy": false,
"is_vpn": true,
"is_tor": false
}
}
}
IP*
String
Server IP
authorization*
String
Your API key
{
"status": 504,
"content": "It seems that the server is not responding"
}
{
"status": 200,
"content": {
"name": "Hypixel Network [1.8-1.18] EASTER EVENT - MINIGAME, SALE, AND MORE!",
"map": "",
"password": false,
"raw": {
"vanilla": {
"name": "",
"map": "",
"password": false,
"raw": {
"version": {
"name": "Requires MC 1.8 / 1.18",
"protocol": 47
},
"players": {
"max": 200000,
"online": 61388,
"sample": []
},
"description": " §aHypixel Network §c[1.8-1.18]\n §e§lEASTER EVENT §7- §b§lMINIGAME, SALE, AND MORE!"
},
"maxplayers": 200000,
"players": [
{
"name": "",
"raw": {}
},
{
"name": "",
"raw": {}
},
{
"name": "",
"raw": {}
},
{
"name": "",
"raw": {}
},
{
"name": "",
"raw": {}
},
],
"bots": [],
"ping": 0,
"connect": "mc.hypixel.net:25565"
}
}
ID
Number
An image ID
authorization*
String
Your API key
const axios = require("axios");
axios.get('https://api.night-api.com/images/animals/wolf', {
headers: {
authorization: "Your API token"
}
})
.then(function (response) {
console.log(response.data);
})
{
status: 400,
content: 'Clé invalide'
}
{
"status": 200,
"content": {
"id": 47,
"url": "https://cdn.night-api.com/api/images/animals/wolf/phgkrPvHBjF2eVy9effDXDGK5dvy35.png"
}
}
Basic information to know before using the Games API
Currently the game part of the api only supports three game categories which are the following:
The use of the api is explained in more detail in the following pages
Here is an example of what the API will return when you make a request
{
"status": 200,
"content": {
"name": "◘ MonolithServers.com | Custom City Roleplay",
"map": "rp_monoford_v1k",
"password": false,
"raw": {
"protocol": 17,
"folder": "garrysmod",
"game": "MONOLITH V2.0.20",
"appId": 4000,
"numplayers": 12,
"numbots": 4,
"listentype": "d",
"environment": "l",
"secure": 1,
"version": "2021.12.15",
"steamid": "85568392923366953",
"tags": [
" gm:darkrp gmc:rp loc:us ver:220317"
]
},
"maxplayers": 127,
"players": [
{
"name": "The cool boy",
"raw": {
"score": 0,
"time": 15035.7216796875
}
},
{
"name": "banana flavored vlasic pickles",
"raw": {
"score": 0,
"time": 2115.999755859375
}
},
{
"name": "breiceheidd",
"raw": {
"score": 0,
"time": 2097.3330078125
}
},
{
"name": "Hex",
"raw": {
"score": 0,
"time": 1926.66650390625
}
},
{
"name": "ShadowStalker182",
"raw": {
"score": 0,
"time": 1852.8868408203125
}
},
{
"name": "Frank Watson",
"raw": {
"score": 0,
"time": 1848.66650390625
}
},
{
"name": "battlekingbg",
"raw": {
"score": 0,
"time": 1571.2220458984375
}
},
{
"name": "carl",
"raw": {
"score": 0,
"time": 1357.7218017578125
}
},
{
"name": "Wyzmeister",
"raw": {
"score": 0,
"time": 1322.2774658203125
}
},
{
"name": "RX55927R11DEZ",
"raw": {
"score": 0,
"time": 1110.7772216796875
}
},
],
"bots": [
{
"name": "TheGrimReaper",
"raw": {
"score": 0,
"time": 27391.92578125
}
},
{
"name": "Llama",
"raw": {
"score": 0,
"time": 27362.06640625
}
},
],
"connect": "208.103.169.58:27015",
"ping": 116
}
}
GET
https://api.night-api.com/images/qrcode
authorization*
String
Your API key
backgroundDimming
String
Color of the dimming mask above the background image.
logoImage
String
Logo image to be displayed at the center of the QR code.
Accepts a data:
string in web browsers or a Buffer in Node.js.
When set to undefined
or null
, the logo is disabled.
logoCornerRadius
Number
Corner radius of the logo image in pixels.
backgroundImage
String
Background image to be used in the QR code.
Accepts a data:
string in web browsers or a Buffer in Node.js.
autoColor
Boolean
Automatically calculate the colorDark value from the QR code's background.
colorLight
String
Color of the empty areas on the QR code.
colorDark
String
Color of the blocks on the QR code.
size
Number
Size of the QR code in pixel.
text*
String
Text to be encoded in the QR code.
{
status: 200,
content: {
type: 'Buffer',
data: [
137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13,
73, 72, 68, 82, 0, 0, 1, 244, 0, 0, 1, 244,
8, 6, 0, 0, 0, 203, 214, 223, 138, 0, 0, 0,
6, 98, 75, 71, 68, 0, 255, 0, 255, 0, 255, 160,
189, 167, 147, 0, 0, 32, 0, 73, 68, 65, 84, 120,
156, 236, 221, 121, 120, 85, 245, 157, 63, 240, 247, 57,
231, 174, 185, 185, 217, 73, 66, 54, 18, 194, 190, 133,
69, 109, 1, 177, 173, 27, 34, 83, 28, 117, 164, 237,
60, 51, 173, 117,
... 17703 more items
]
}
}
{
"status": 400,
"content": "Invalid Key"
}
List of available parameters to put in the body or in the module function
text Required
size
colorDark
colorLight
autoColor
backgroundImage
backgroundDimming
logoImage
logoCornerRadius
const axios = require("axios");
const { writeFileSync } = require("fs");
axios.get('https://api.night-api.com/images/qrcode', {
headers: {
authorization: "Your API token"
},
data: {
text: "https://night-api.com/"
}
})
.then(function (res) {
writeFileSync(`${__dirname}/qrcode.png`, Buffer.from(res.data.content, 'base64'));
console.log(res.data);
})
Or with the module
// Return: Promise
const { NightAPI } = require('night-api');
const api = new NightAPI('YOUR_API_KEY');
const qrcode = await api.qrcode.generate({
text: "https://night-api.com"
})
Developed by Facepunch Studio
GET
https://api.night-api.com/game/garrysmod/:IP
IP*
String
Server IP
authorization*
String
Your API key
{
"status": 200,
"content": {
"name": "◘ MonolithServers.com | Custom City Roleplay",
"map": "rp_monoford_v1k",
"password": false,
"raw": {
"protocol": 17,
"folder": "garrysmod",
"game": "MONOLITH V2.0.20",
"appId": 4000,
"numplayers": 53,
"numbots": 4,
"listentype": "d",
"environment": "l",
"secure": 1,
"version": "2021.12.15",
"steamid": "85568392923366953",
"tags": [
" gm:darkrp gmc:rp loc:us ver:220317"
]
},
"maxplayers": 127,
"players": [
{
"name": "The cool boy",
"raw": {
"score": 0,
"time": 15035.7216796875
}
},
{
"name": "Austin Hunter",
"raw": {
"score": 0,
"time": 13854.888671875
}
},
{
"name": "Austin452",
"raw": {
"score": 0,
"time": 13744.111328125
}
},
{
"name": "Death Merchant",
"raw": {
"score": 0,
"time": 12984.4443359375
}
},
{
"name": "romeoosm",
"raw": {
"score": 0,
"time": 10391.2216796875
}
},
{
"name": "coosty",
"raw": {
"score": 0,
"time": 9399.7216796875
}
},
{
"name": "ScriptKitty",
"raw": {
"score": 0,
"time": 9230.7216796875
}
},
{
"name": "-Broken-",
"raw": {
"score": 0,
"time": 8514.6669921875
}
},
{
"name": "DKDiamond",
"raw": {
"score": 0,
"time": 7995.27734375
}
},
... // The list has been shortened
],
"connect": "208.103.169.58:27015",
"ping": 116
}
}
{
"status": 504,
"content": "It seems that the server is not responding"
}
authorization*
String
Your API key
image*
Buffer or URL
The image in Buffer or URL.
const axios = require("axios");
const { readFileSync } = require("fs");
axios.get('https://api.night-api.com/images/qrcode/reader', {
headers: {
authorization: "Your API token"
},
data: {
image: readFileSync(`${__dirname}/qrcode.png`)
}
})
.then(function (response) {
console.log(response.data);
})
const { readFileSync } = require('fs');
const { NightAPI } = require('night-api');
const api = new NightAPI("API_key");
const qrcode = readFileSync('./qrcode.png');
const QRcode_infos = api.qrcode.read(qrcode);
// OR with QRcode URL
const QRcode_infos = api.qrcode.read("https://mydomain.com/qrcode.png");
console.log(QRcode_infos);
{
"status": 200,
"content": {
"type": "link",
"target": "https://night-api.com",
"status": "Safe" // Status of danger on website by google AI
}
}
{
"status": 400,
"content": "Invalid Key"
}
{
"status": 200,
"content": {
"type": "geo", // Type of the QRcode
"data": { // The QRcode but with tried data by the API (change beetween different QRcode data)
"latitude": "48.85837",
"longitude": "2.29448"
},
"target": "geo:48.85837,2.29448" // The data of the QRcode
}
}
All changelogs are now on the site:
Website fivem.net
GET
https://api.night-api.com/game/fivem/:IP
IP*
String
Server IP
authorization*
String
Your API key
{
"status": 200,
"content": {
"name": "^0[FR/QC/BE] ^6☔ RevoLife ^0| 🔓 FREE-ACCESS | 💸 ^1CHOISIS TON START - ^6💻 ^1Développement Révolutionnaire ^7& Actif 🌟 | 🔊 ^0 https://discord.gg/RevoLife",
"map": "",
"password": false,
"raw": {
"sv_maxclients": "512",
"clients": "18",
"challenge": "xxx\u0000",
"gamename": "CitizenFX",
"protocol": "4",
"hostname": "^0[FR/QC/BE] ^6☔ RevoLife ^0| 🔓 FREE-ACCESS | 💸 ^1CHOISIS TON START - ^6💻 ^1Développement Révolutionnaire ^7& Actif 🌟 | 🔊 ^0 https://discord.gg/RevoLife",
"gametype": "",
"mapname": "",
"iv": "1202128614",
"info": {
"enhancedHostSupport": true,
"resources": ["hardcap", "mCore", "_cfx_internal", "gksphone", "admin", "mAutoEcole", "yarn", "chat", "rVip", "mFramework", "screenshot-basic", "pma-voice", "mNotif", "webpack", "Mowgli", "mysql-async", "rJail", "speedometer", "streamings", "SeaShield", "JD_logs"],
"server": "FXServer-master SERVER v1.0.0.5369 win32",
"vars": {
"Cheveux": "✂️ Notre serveur dispose de Cheuveux moddées exclusives",
"JD_logs": "V1.3.0",
"Véhicules": "🚗 Notre serveur dispose de Véhicules moddées exclusives",
"Vêtements": "👔 Notre serveur dispose de Vêtements moddées exclusives",
"banner_connecting": "",
"banner_detail": "",
"crédit": "Base Développé par CyberPro x Omar.",
"developpement": "Notre serveur dispose d'un Développement Unique et OPTIMISER. ( 512 Joueurs ) 🌙",
"discord": "discord.gg/revolife",
"gamename": "gta5",
"locale": "fr-FR",
"onesync_enabled": "true",
"sv_enforceGameBuild": "2372",
"sv_enhancedHostSupport": "false",
"sv_lan": "false",
"sv_licenseKeyToken": "2285227xl1cdjregsudazpq4_4764139:c12a8238b2dd16da5bb1979cc17d8bbe2a11c31fb8ad995d101394791708a611",
"sv_maxClients": "512",
"sv_projectDesc": "Contenu exceptionnel",
"sv_projectName": "[FR] RevoLife",
"sv_scriptHookAllowed": "false",
"tags": "roleplay, rp, fr, qc, blg, rp strict, esx, custom cars, custom, drugs, reallife, serious, discord, economy, serious rp, seriousrp, fivem, customcars, custom scripts, realistic, life, lspd, cops, jobs, vrp, freeaccess, white, list, vehicules import, vanilla, vehicules, france, 64, slots, 64 slots, esx, roleplay, default, rp, vrp, police, lspd, cars, ems, drugs, jobs, reallife, custom, serious, discord, economy, cops, serious rp, fun, racing, mafia, drifting, seriousrp, 100 slots, 100"
},
"version": 1202128614
},
"players": [{
"endpoint": "127.0.0.1",
"id": 6,
"identifiers": ["license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "discord:xxxxxxxxxxxxxxxxxx", "fivem:xxxxxxx", "license2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"], // The informations has been censored by the Night Group Dev
"name": "lucie",
"ping": 84
}, {
"endpoint": "127.0.0.1",
"id": 11,
"identifiers": ["license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "discord:xxxxxxxxxxxxxxxxxx", "fivem:xxxxxxx", "license2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"], // The informations has been censored by the Night Group Dev
"name": "kevinldn",
"ping": 22
}, {
"endpoint": "127.0.0.1",
"id": 1,
"identifiers": ["license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "discord:xxxxxxxxxxxxxxxxxx", "fivem:xxxxxxx", "license2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"],
"name": "Tom",
"ping": 41
}, {
"endpoint": "127.0.0.1",
"id": 9,
"identifiers": ["license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "discord:xxxxxxxxxxxxxxxxxx", "fivem:xxxxxxx", "license2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"],
"name": "Lil",
"ping": 56
}, {
"endpoint": "127.0.0.1",
"id": 7,
"identifiers": ["license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "discord:xxxxxxxxxxxxxxxxxx", "fivem:xxxxxxx", "license2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"],
"name": "Aurelien Fratelie | alvineee",
"ping": 75
}, {
"endpoint": "127.0.0.1",
"id": 13,
"identifiers": ["license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "discord:xxxxxxxxxxxxxxxxxx", "fivem:xxxxxxx", "license2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"],
"name": "~r~Omar ~w~El ~r~Feo",
"ping": 31
}, {
"endpoint": "127.0.0.1",
"id": 25,
"identifiers": ["license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "discord:xxxxxxxxxxxxxxxxxx", "fivem:xxxxxxx", "license2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"],
"name": "Supras_",
"ping": 40
}, {
"endpoint": "127.0.0.1",
"id": 18,
"identifiers": ["license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "discord:xxxxxxxxxxxxxxxxxx", "fivem:xxxxxxx", "license2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"],
"name": "144HZ",
"ping": 42
}, {
"endpoint": "127.0.0.1",
"id": 19,
"identifiers": ["license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "discord:xxxxxxxxxxxxxxxxxx", "fivem:xxxxxxx", "license2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"],
"name": "GODRICK",
"ping": 1331
}, {
"endpoint": "127.0.0.1",
"id": 20,
"identifiers": ["license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "discord:xxxxxxxxxxxxxxxxxx", "fivem:xxxxxxx", "license2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"],
"name": "Funny",
"ping": 124
}, {
"endpoint": "127.0.0.1",
"id": 27,
"identifiers": ["license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "discord:xxxxxxxxxxxxxxxxxx", "fivem:xxxxxxx", "license2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"],
"name": "G-S | Natoux.exe",
"ping": 30
}, {
"endpoint": "127.0.0.1",
"id": 21,
"identifiers": ["license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "discord:xxxxxxxxxxxxxxxxxx", "fivem:xxxxxxx", "license2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"],
"name": "Jean Woods",
"ping": 61
}, {
"endpoint": "127.0.0.1",
"id": 26,
"identifiers": ["license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "discord:xxxxxxxxxxxxxxxxxx", "fivem:xxxxxxx", "license2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"],
"name": "Souverain Paolo !",
"ping": 36
}, {
"endpoint": "127.0.0.1",
"id": 28,
"identifiers": ["license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "discord:xxxxxxxxxxxxxxxxxx", "fivem:xxxxxxx", "license2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"],
"name": "Bock Hobkins",
"ping": 34
}, {
"endpoint": "127.0.0.1",
"id": 30,
"identifiers": ["license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "discord:xxxxxxxxxxxxxxxxxx", "fivem:xxxxxxx", "license2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"],
"name": "HazizzzYZ",
"ping": 69
}, {
"endpoint": "127.0.0.1",
"id": 29,
"identifiers": ["license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "discord:xxxxxxxxxxxxxxxxxx", "fivem:xxxxxxx", "license2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"],
"name": "Ronpich",
"ping": 51
}, {
"endpoint": "127.0.0.1",
"id": 32,
"identifiers": ["license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "discord:xxxxxxxxxxxxxxxxxx", "fivem:xxxxxxx", "license2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"],
"name": "Louis Anderson",
"ping": 59
}, {
"endpoint": "127.0.0.1",
"id": 33,
"identifiers": ["license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "discord:xxxxxxxxxxxxxxxxxx", "fivem:xxxxxxx", "license2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"],
"name": "667\"Obz",
"ping": 49
}]
},
"maxplayers": "512",
"players": [{
"name": "lucie",
"raw": {
"ping": 84
}
}, {
"name": "kevinldn",
"raw": {
"ping": 22
}
}, {
"name": "Tom",
"raw": {
"ping": 41
}
}, {
"name": "Lil",
"raw": {
"ping": 56
}
}, {
"name": "Aurelien Fratelie | alvineee",
"raw": {
"ping": 75
}
}, {
"name": "~r~Omar ~w~El ~r~Feo",
"raw": {
"ping": 31
}
}, {
"name": "Supras_",
"raw": {
"ping": 40
}
}, {
"name": "144HZ",
"raw": {
"ping": 42
}
}, {
"name": "GODRICK",
"raw": {
"ping": 1331
}
}, {
"name": "Funny",
"raw": {
"ping": 124
}
}, {
"name": "G-S | Natoux.exe",
"raw": {
"ping": 30
}
}, {
"name": "Jean Woods",
"raw": {
"ping": 61
}
}, {
"name": "Souverain Paolo !",
"raw": {
"ping": 36
}
}, {
"name": "Bock Hobkins",
"raw": {
"ping": 34
}
}, {
"name": "HazizzzYZ",
"raw": {
"ping": 69
}
}, {
"name": "Ronpich",
"raw": {
"ping": 51
}
}, {
"name": "Louis Anderson",
"raw": {
"ping": 59
}
}, {
"name": "667\"Obz",
"raw": {
"ping": 49
}
}],
"bots": [],
"connect": "play.blueislandrp.com:30120",
"ping": 25
}
}
{
"status": 504,
"content": "It seems that the server is not responding"
}