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. Images
  2. Utils

Captcha

Generate a QR Code

GET https://api.night-api.com/images/captcha

Headers

Name
Type
Description

authorization*

String

Your API key

Request Body

Name
Type
Description

codeSize

Number

Size of the code to generate between 4 and 10

Default : 6

{ 
    status: 200, 
    content: { 
        code: 'ju0bm1', 
        codeSize: 6, 
        image: { 
            type: 'Buffer', 
            data: [Array] 
        } 
    }
}
{
    "status": 400,
    "content": "Invalid Key"
}

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'));
})

Or with the module

// 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);
PreviousReaderNextIP infos

Last updated 2 years ago

Was this helpful?

๐Ÿ—๏ธ
๐Ÿ”