JSON API

A free JSON API for searching torrents and fetching the latest additions — use it in your own website, app or script. No API key, no registration. CORS is enabled (Access-Control-Allow-Origin: *), so you can call it straight from a browser.

Base URL: https://yourbittorrent.com  ·  All endpoints are GET and return application/json (UTF-8).

Search torrents

GET /api/search.json
ParameterRequiredDescription
qyesSearch terms, max 100 characters. Quotes, parentheses and @ are stripped.
categorynoFilter by category — numeric id or name, see the table below. Example: category=movies or category=1.
verifiedno1 = only verified torrents.
sortnoseeds (default), peers, size or added.
ordernodesc (default) or asc.
limitnoResults per page, 1–100. Default 20.
pagenoPage number, starting at 1. page × limit may not exceed 1000.
curl "https://yourbittorrent.com/api/search.json?q=ubuntu&category=software&limit=5"

Latest torrents

GET /api/latest.json

The newest torrents on the site, newest first. Takes the same category, verified, limit and page parameters as search (no q, no sort).

curl "https://yourbittorrent.com/api/latest.json?category=movies&verified=1&limit=10"

Response format

{
  "status": "ok",
  "endpoint": "search",
  "page": 1,
  "limit": 20,
  "count": 20,
  "total_found": 1006,
  "query": "ubuntu",
  "results": [
    {
      "id": 38839040,
      "name": "Ubuntu-22.04-desktop-amd64",
      "infohash": "2c6b6858d61da9543d4231a71db4b1c9264b0685",
      "magnet": "magnet:?xt=urn:btih:2c6b6858d61da9...&dn=Ubuntu-22.04-desktop-amd64",
      "torrent_file": "https://yourbittorrent.com/down/38839040.torrent",
      "url": "https://yourbittorrent.com/torrent/38839040/ubuntu-22-04-desktop-amd64.html",
      "category": "Software",
      "category_id": 5,
      "size_bytes": 3654957056,
      "size": "3.4 GB",
      "seeds": 47,
      "peers": 1,
      "verified": true,
      "added": 1652882016,
      "added_iso": "2022-05-18T13:53:36+00:00"
    }
  ]
}
FieldMeaning
total_foundTotal matches in the index. Only the first 1000 are reachable through paging.
infohashBitTorrent v1 info-hash (40-char hex, lowercase).
magnetReady-to-use magnet link. Add your own &tr= trackers if you want faster peer discovery.
torrent_fileDirect .torrent file download.
urlThe torrent's detail page on YourBittorrent.
size_bytes / sizeSize as raw bytes and as a human-readable string.
added / added_isoWhen it was indexed: unix timestamp and ISO-8601 (UTC).

Categories

IDNameIDName
1Movies6Anime
2Music7Adult
3Television8eBooks
4Games9Pictures
5Software10Other
12Audiobooks

Errors

Errors come back as JSON with a matching HTTP status code:

{ "status": "error", "error": "limit must be 1-100" }
StatusWhen
400Missing or invalid parameter — the error field says which.
404Unknown endpoint.
503Search backend briefly unavailable (happens for a moment every few hours) — retry after a minute.

Examples

JavaScript (browser or Node):

const res = await fetch("https://yourbittorrent.com/api/search.json?q=debian&limit=5");
const data = await res.json();
for (const t of data.results) {
    console.log(t.name, t.size, t.magnet);
}

PHP:

$data = json_decode(file_get_contents(
    "https://yourbittorrent.com/api/latest.json?category=television&limit=10"
), true);
foreach ($data["results"] as $t) {
    echo $t["name"] . " - " . $t["seeds"] . " seeds\n";
}

Python:

import requests
data = requests.get("https://yourbittorrent.com/api/search.json",
                    params={"q": "ubuntu", "verified": 1}).json()
for t in data["results"]:
    print(t["name"], t["magnet"])

Fair use & caching

Responses are cached on our CDN — latest for 5 minutes, search for 15 minutes — so identical requests are cheap. Please cache on your side too and keep it reasonable: this API is free for any site or app, but abusive scraping (thousands of uncached requests per minute) may get blocked. Questions or need more? Contact us.