BTN API

getTorrentsBrowse

Schema

Get the torrents browse page

Deprecated

Deprecated. Use getTorrents instead.

Equivalent to getTorrents with an empty search.

Request

A JSON-RPC call is a POST of a single envelope object. There is no jsonrpc field, and id must be present and non-empty — an empty or absent id is treated as a notification and the server returns no body at all.

curl -sS -X POST https://api.broadcasthe.net/ \
  -H 'Content-Type: application/json' \
  -d '{"id":1,"method":"getTorrentsBrowse","params":{"key":"YOUR_API_KEY"}}'
<?php

$body = json_encode([
    'id' => 1,
    'method' => 'getTorrentsBrowse',
    'params' => [
        'key' => 'YOUR_API_KEY',
    ],
]);

$ch = curl_init("https://api.broadcasthe.net/");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);

// Errors arrive as {"id":…, "result":null, "error":{…}} - result is present and null
// alongside error, so check for the error key rather than a falsy result.
if (isset($response['error'])) {
    throw new RuntimeException($response['error']['message'], $response['error']['code']);
}

var_dump($response['result']);
import requests

response = requests.post(
    "https://api.broadcasthe.net/",
    json={
        "id": 1,
        "method": "getTorrentsBrowse",
        "params": {
            "key": "YOUR_API_KEY",
        },
    },
    timeout=30,
)
response.raise_for_status()
payload = response.json()

# result is present and null alongside error, so test for "error" itself.
if "error" in payload:
    raise RuntimeError(f'{payload["error"]["code"]}: {payload["error"]["message"]}')

print(payload["result"])
const response = await fetch("https://api.broadcasthe.net/", {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "id": 1,
    "method": "getTorrentsBrowse",
    "params": {
      "key": "YOUR_API_KEY"
    }
  }),
})

const payload = await response.json()

// result is present and null alongside error, so test for the error key itself.
if (payload.error) {
  throw new Error(`${payload.error.code}: ${payload.error.message}`)
}

console.log(payload.result)

Try it

Requests run against the live site, and count against your quota.

Fill in key first.

Request

{
  "id": 1,
  "method": "getTorrentsBrowse",
  "params": {}
}

Response

Not run yet.

Parameters

  • keystringrequired

    API key

  • resultsNumericInputoptional

    A whole number, sent either as a JSON number or as a string containing one. 5 and "5" are equivalent, and both are accepted wherever this type appears.

  • offsetNumericInputoptional

Result

On success the response is {"id": …, "result": …}. The shape of result is:

  • resultsstring (numeric)required
  • torrentsmap<string, Torrent>optional
    map<string, Torrent>

    An object keyed by ID — every value has the shape below.

    • GroupNamestringrequired
    • GroupIDstring (numeric)required
    • TorrentIDstring (numeric)required
    • SeriesIDstring (numeric)required
    • Seriesstringrequired
    • SeriesBannerstring | nullrequired
    • SeriesPosterstring | nullrequired
    • YoutubeTrailerstring | nullrequired
    • Category"Episode" | "Season"required
    • Snatchedstring (numeric)required
    • Seedersstring (numeric)required
    • Leechersstring (numeric)required
    • Sourcestringrequired
    • Containerstringrequired
    • Codecstringrequired
    • Resolutionstringrequired
    • Originstringrequired
    • ReleaseNamestringrequired
    • Sizestring (numeric)required
    • Timestring (numeric)required
    • TvdbIDstring | nullrequired
    • TvrageIDstring | nullrequired
    • ImdbIDstring | nullrequired
    • InfoHashstringrequired
    • Tagsstring[]required
    • Genresstring[]required
    • DownloadURLstringrequired

Errors

On failure the response is {"id": …, "result": null, "error": {"code": …, "message": …}}. Note that result is present and null alongsideerror, so test for the error key rather than for a falsy result.

CodeMessage
-32001Invalid API Key
-32002Call Limit Exceeded
-32003User Account Disabled
-32004IP address needs authorization - please check your notices on BTN
-32004Unauthorized IP address

-32004 is the most likely failure on a first call: the API allowlists source IPs, and an unrecognised one is recorded for approval rather than accepted. See authorisation.