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
  3. QR Code

Generator

Generate a QR Code

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

Headers

Name
Type
Description

authorization*

String

Your API key

Request Body

Name
Type
Description

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"
})
PreviousQR CodeNextReader

Last updated 2 years ago

Was this helpful?

๐Ÿ—๏ธ
๐Ÿ“ธ
๐Ÿ”