SABnzbd API client written in TypeScript licensed under the MIT. It supports all of the API calls listed in the version 3.4.0 documentation (https://sabnzbd.org/wiki/advanced/api). It's still under active development and I welcome issue reports and pull requests.
npm install --save sabnzbd-api
You can find the API documentation at https://zordtk.github.io/sabnzbd-api/docs/, you should also read SABnzbd's API documentation at https://sabnzbd.org/wiki/advanced/api
const SABnzbd = require("sabnzbd-api");
let client = new SABnzbd.Client("http://example.com/sabnzbd", "apikey");
client.version().then(version => {
console.log(version);
}).catch(error => {
console.log(error.message);
});
const SABnzbd = require("sabnzbd-api");
let client = new SABnzbd.Client("http://example.com/sabnzbd", "apikey");
client.addUrl('url-to-nzb').then(results => {
if( results.status )
console.log('Added NZB');
else
console.log('Failed to add NZB: ' + results.error);
}).catch(error => {
console.log(error.message);
});
const SABnzbd = require("sabnzbd-api");
const fs = require("fs");
const FormData = require("form-data");
let client = new SABnzbd.Client("http://example.com/sabnzbd", "apikey");
let formData = new FormData();
formData.append("name", fs.createReadStream("/path/to/file"));
client.addFile(formData).then(results => {
if( results.status )
console.log('Added NZB');
else
console.log('Failed to add NZB: ' + results.error);
}).catch(error => {
console.log(error.message);
});
Generated using TypeDoc