๐Ÿ“ƒ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

Request Body

{
    "status": 200,
    "content": {
        "type": "link",
        "target": "https://night-api.com",
        "status": "Safe" // Status of danger on website by google AI
    }
}
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