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.2026112508

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.2026112508

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.2026112508
File Size Uploaded Provenance Actions
torbox_sdk-9.3.2026112508.tar.gz 139.0 kB With provenance Details for torbox_sdk-9.3.2026112508.tar.gz

Built distribution (wheel)

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

Total release size: 527.7 kB

Release files / torbox_sdk-9.3.2026112508.tar.gz

Download URL torbox_sdk-9.3.2026112508.tar.gz
Size 139.0 kB
Tags Source
SHA-256 checksum
How to use checksums
51bef8ea7127de471be25edd0f2e51e5fba61d19cff599342ac72a814293393b
BLAKE2b-256 checksum
How to use checksums
22498392be672b22ab7ee312aa8ac0a05a1ed39a293922025aca1a8193bafe07
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.2026112508-py3-none-any.whl

Download URL torbox_sdk-9.3.2026112508-py3-none-any.whl
Size 388.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f96cc5a6cc7669e61256db0ed00da25f9fb14a23af906a613422b8c7fb78f6f
BLAKE2b-256 checksum
How to use checksums
707591c3f8d88271d954538da2b2c6702623867b0b8499846deef53e5cdcab3b
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.2026112508

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.2026112508.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