Skip to main content

TorBox Python SDK

Python client for the TorBox API. Generated from the OpenAPI spec and published automatically when the API changes.

pip install torbox-sdk==9.3.1.20261125.4

Python 3.9+. The import name is torbox.

Quick start

from torbox import TorBox

client = TorBox(api_key="YOUR_API_KEY")          # https://torbox.app/settings
me = client.user.get_user_data()                  # returns `data`, typed
print(me.email)

client.torrents.create_torrent(magnet="magnet:?xt=urn:btih:...")
client.torrents.create_torrent(file=("ubuntu.torrent", open("ubuntu.torrent", "rb").read()))

Groups: torrents, usenet, web_downloads, user, general, notifications, rss, integrations, queued, stream, tags, assistant, vendors. Every method has the name of its operationId (see the reference); docs/ lists them all.

Authentication

The key is sent as Authorization: Bearer <key>. The download link endpoints (request_*_download_link*) take it as the token query parameter: the client fills it in for you.

url = client.torrents.request_torrent_download_link(torrent_id=123, file_id=0)

Pagination

List endpoints take offset and limit:

for torrent in client.paginate(client.torrents.get_torrent_list, page_size=100):
    print(torrent.id, torrent.name)

Errors

Every API answer is the envelope {success, error, detail, data}. Methods return data; anything else raises TorBoxError:

from torbox import TorBoxError

try:
    client.torrents.create_torrent(magnet="...")
except TorBoxError as e:
    e.status   # 403
    e.error    # "PLAN_RESTRICTED_FEATURE"  (stable code, branch on it)
    e.detail   # message you can show to users
    e.data

Request validation errors (422) have error == "VALIDATION_ERROR". Error codes: api-docs.torbox.app/docs/errors.

Retries and timeouts

429 and 503 are retried (default 3 times), waiting for Retry-After or backing off exponentially. Every request has a timeout (default 30 s).

client = TorBox(api_key="...", timeout=10, max_retries=5, base_url="https://api.torbox.app")
client.user.get_user_data(_request_timeout=60)   # per call

Raw access

The generated client is underneath: client.api_client, and client.torrents.get_torrent_list_with_http_info(...) returns status, headers and the full envelope without unwrapping.

Example

examples/quickstart.py

Metadata

Release files for torbox-sdk 9.3.1.20261125.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for torbox-sdk 9.3.1.20261125.4
File Size Uploaded Provenance Actions
torbox_sdk-9.3.1.20261125.4.tar.gz 138.2 kB With provenance Details for torbox_sdk-9.3.1.20261125.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for torbox-sdk 9.3.1.20261125.4
File Interpreter ABI Platform Actions
torbox_sdk-9.3.1.20261125.4-py3-none-any.whl Python 3 none any Details for torbox_sdk-9.3.1.20261125.4-py3-none-any.whl

Total release size: 526.0 kB

Release files / torbox_sdk-9.3.1.20261125.4.tar.gz

Download URL torbox_sdk-9.3.1.20261125.4.tar.gz
Size 138.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5f2ec901b73c6026aa648c6fe42b3b3d0b7537ead5b4d130816e0f46f0c3e9c8
BLAKE2b-256 checksum
How to use checksums
ec2d5a42cd5ed700673212b9594436478a1747ea52d85c96ca7051bbbf896cce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / torbox_sdk-9.3.1.20261125.4-py3-none-any.whl

Download URL torbox_sdk-9.3.1.20261125.4-py3-none-any.whl
Size 387.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
482c301b593ac7586eef0b093b80745991c4002ff10639d89923d02ee3e9af07
BLAKE2b-256 checksum
How to use checksums
665173cee33a715d39f926b358fcf10f2836d8def73ae44544d9ed09db26edec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for torbox-sdk 9.3.1.20261125.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for torbox_sdk-9.3.1.20261125.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page