📃Reader
Read a QR Code
GET
https://api.night-api.com/images/qrcode/reader
Headers
Name
Type
Description
authorization*
String
Your API key
Request Body
Name
Type
Description
image*
Buffer or URL
The image in Buffer or URL.
{
"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
Was this helpful?