Translations:Stat API/15/ru
NodeJS
const https = require('https'); const options = { host: 'kaminari.click', port: 443, path: '/api/stat/get', method: 'POST', headers: { 'Authorization': 'Bearer <YOUR API_TOKEN>' } }; https .get(options, (resp) => { let data = ''; resp.on('data', (chunk) => { data += chunk; }); resp.on('end', () => { try { data = JSON.parse(data); } catch { console.log(data); } }); }) .on("error", (err) => { console.log("Error: " + err.message); });