๐Ÿ“ƒReader

With the QRcode reader you can verify if the link is not dangerous for you or users

Read a QR Code

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

Headers

NameTypeDescription

authorization*

String

Your API key

Request Body

NameTypeDescription

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

Or with the module

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

PS: read function take Buffer or URL parameter

Last updated