Automation Support

To help connect SABnzbd to other utilities, some automation functions are available through the web-interface.

In the commands, substitute elements in <> by proper values.
Example: add one newzbin report id:
http://host:port/sabnzbd/api?mode=addid&name=123456&cat="movies"

These commands give a one line response. Either "ok\n" or "error\n".
Only the shutdown command will give no response.

When the web interface username and password are set, you need to add two extra parameters:
ma_username and ma_password.
So the above example will become:
http://host:port/sabnzbd/api?mode=addid&ma_username=USER&ma_password=PASSWORD&name=123456&cat="movies"

Upload an NZB file, the <name> is the pathless name of the filename

http://host:port/sabnzbd/api?mode=addfile&name=<filename>&cat=<category>&pp=<job-option>&script=<script>

Omitted parameters (cat, pp or script) will get default values.
If you want to force an empty parameter, use an empty string, e.g. script="".

Send the URL from where SABnzbd must download an NZB file

http://host:port/sabnzbd/api?mode=addurl&name=<url>&cat=<category>&pp=<job-option>&script=<script>

Send the newzbin report id that SABnzbd must fetch

http://host:port/sabnzbd/api?mode=addid&name=<newzbin-id>&cat=<category>&pp=<job-option>&script=<script>

Pause the downloading of SABnzbd

http://host:port/sabnzbd/api?mode=pause

Resume the downloading of SABnzbd

http://host:port/sabnzbd/api?mode=resume

Shutdown SABnzbd

http://host:port/sabnzbd/api?mode=shutdown

Set the autoshutdown feature of SABnzbd on (1) or off (0)

http://host:port/sabnzbd/api?mode=autoshutdown&name=<0|1>

Brief queue status report (json or xml)

http://host:port/sabnzbd/api?mode=qstatus&output=json|xml

Returns a JSON object containing:

"paused" <pause-status>,
"kbpersec" <downloadspeed in KB/sec>,
"mbleft" <MB to be downloaded>,
"mb" <MB that have been downloaded>,
"noofslots" <number of jobs in the queue>,
"diskspace1" <free space on download_dir disk>,
"diskspace2" <free space on complete_dir disk>,
"jobs" <queue object>
where <queue object> is an array of the following objects:
"id" <job id>,
"filename" <name of job>,
"mb" <MB of job>,
"mbleft" <MB left>,
"msgid" <newzbin msgid>

or return an XML object:

<qstatus>
    <paused></paused>
    <kbpersec></kbpersec>
    <mbleft></mbleft>
    <mb></mb>
    <noofslots></nofslots>
    <diskspace1></diskspace1>
    <diskspace2></diskspace2>
    <jobs>
        <job>
            <id></id>
            <filename></filename>
            <mb></mb>
            <mbleft></mbleft>
            <msgid></msgid>
        </job>
    </jobs>
</qstatus>

Set speed limit

http://host:port/sabnzbd/api?mode=config&name=speedlimit&value=400

Set the download speed limit.

Set action for empty queue

http://host:port/sabnzbd/api?mode=queue&name=change_complete_action&value=<action>

Action to be executed when the download queue becomes empty:

  • script_xxx, where 'xxx' is a script from the list returned by the api call get_scripts.
  • shutdown_pc
  • hibernate_pc
  • shutdown_program

Warnings overview

http://host:port/sabnzbd/api?mode=warnings&output=json|xml

Returns a JSON or XML object containing an array of warning strings.

Category list

http://host:port/sabnzbd/api?mode=get_cats&output=json|xml

Returns a JSON or XML object containing an array of category strings.

Script list

http://host:port/sabnzbd/api?mode=get_scripts&output=json|xml

Returns a JSON or XML object containing an array of script strings.

Version

http://host:port/sabnzbd/api?mode=version&output=json|xml

Returns a JSON or XML object containing the version of SABnzbd.

page_revision: 11, last_edited: 1219599019|%e %b %Y, %H:%M %Z (%O ago)
Unless stated otherwise Content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License