South Star

Torrent Metainfo Parser Bencode Info Hash Magnet Batch API

Free tier included · Tools
Parse .torrent files with libtorrent: v1/v2/hybrid info hashes, magnet URIs, file lists, trackers, web seeds. Batch up to 100 torrents per call. Offline.

Torrent Metainfo Parser decodes BitTorrent .torrent metainfo using libtorrent 2.1, supporting BitTorrent v1, v2 (BEP 52) and hybrid torrents. It computes the real info hashes — SHA-1 (btih) for v1 and SHA-256 (btmh) for v2 — over the raw bencoded info-dict slice, not a re-encode. Responses include name, piece length/count, content size, file list (pad files excluded, paths sanitized), private flag, trackers by tier, web seeds (BEP-19), comment, creator, and creation date. The /magnet endpoint builds a complete magnet URI with btih and/or btmh, dn, tr, and ws parameters.

Three new endpoints make this API stand out: /parse/full returns the complete BEP-3 metadata set including creation date, comment, creator, web seeds, private flag, piece length, piece count, and both v1/v2 info hashes. /parse/batch parses up to 100 .torrent payloads in a single request, returning results in input order — ideal for bulk indexing. /torrent/{info_hash}/files lists files and sizes for a previously parsed torrent from the in-memory cache, returning 404 if not found.

It's offline and stateless: no DHT, no tracker, no peer communication, no external calls, no storage. Input "data" travels safely as a latin-1-safe JSON string or as an array of byte ints (0-255), avoiding charset corruption.

Honest limits: 10 MB max payload per torrent; 100 torrents per batch; /torrent/{info_hash}/files requires a prior /parse/full or /parse/batch call to populate the cache. Non-UTF-8 name/path bytes are decoded lossily. This is metadata only — no torrent downloading or seeding.

Endpoints

MethodPathWhat it does
GET/API metadata: name, version, and links to docs and health.
GET/healthLiveness probe; returns status "ok" while the service is up.
POST/parseParse a single .torrent metainfo payload. Body: {"data": "<latin-1 string>" | [byte ints]}. Returns name, info hashes, piece length/count, content size, file list, private flag, trackers, and web seeds.
POST/parse/fullParse a .torrent and return the full set of BEP-3 metadata fields. Same body as /parse. Returns everything /parse returns plus creation date, comment, creator, web seeds (BEP-19), HTTP seeds, private flag, piece length, piece count, and both v1/v2 info hashes.
POST/parse/batchParse up to 100 .torrent payloads in a single request. Body: {"items": [{"data": "<latin-1 string>" | [byte ints]}]}. Returns an array of results in the same order as input items. Each result is the same object as /parse/full.
POST/magnetBuild a magnet URI from .torrent metainfo. Same body as /parse. Returns a magnet URI with btih and/or btmh, dn, tr, and ws parameters.
GET/torrent/{info_hash}/filesList files and sizes for a torrent previously parsed via /parse/full or /parse/batch. Returns the file list, total size, name, and version. If the info hash is not in the cache, returns 404.

Quick start

curl -X POST "https://torrentmeta.p.rapidapi.com/parse" \
  -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
  -H "X-RapidAPI-Host: torrentmeta.p.rapidapi.com" \
  -H "Content-Type: application/json" \
  -d '{"data":"d8:announce31:http://tracker.example/announce4:infod6:lengthi1024e4:name12:testfile.txt12:piece lengthi32768e6:pieces20:012345678901234567897:privatei1eee"}'

FAQ

Does this API download or seed torrents?

No. It only parses .torrent metainfo — info hashes, file lists, trackers, magnet URIs. No DHT, no tracker communication, no peer connections.

How accurate are the info hashes?

They are computed by libtorrent over the raw bencoded info-dict slice, verified against known-answer vectors including WebTorrent's Big Buck Bunny (dd8255ecdc7ca55fb0bbf81323d87062db1f6d1c).

Can I parse multiple torrents at once?

Yes. POST /parse/batch accepts up to 100 .torrent payloads in a single request, returning results in input order. Each torrent is capped at 10 MB.

What does /torrent/{info_hash}/files return if the torrent wasn't parsed yet?

It returns 404. That endpoint reads from an in-memory cache populated only by /parse/full or /parse/batch calls.

Try Torrent Metainfo Parser Bencode Info Hash Magnet Batch free

Free tier on every plan. Get an API key and start calling in under a minute.

Open on RapidAPI

Related APIs