Skip to content

Tracker Scraper

Tracker Scraper is a small, dependency-light Python package that asks a BitTorrent tracker how many seeds, peers, and completed downloads a torrent has — given the tracker’s announce URL and one or more torrent info_hash values.

It speaks both tracker scrape protocols:

You give it a tracker and a list of hashes; it gives you back a plain dictionary of stats. That’s the whole library.

  • One function, one callscrape(tracker, hashes) returns a dict of per-hash stats. Nothing to instantiate, no session to manage.
  • UDP and HTTP/HTTPS — the announce-URL scheme is detected automatically and routed to the right protocol.
  • Batch scraping — query many torrents in a single request (up to 74 per UDP request, a protocol limit).
  • Command-line interface — scrape straight from your shell and get JSON on stdout, no script required.
  • Tiny footprint — only requests and bencode.py as runtime dependencies.

Install it:

Terminal window
pip install tracker-scraper

Scrape a UDP tracker from Python:

from tracker_scraper import scrape
results = scrape(
tracker="udp://exodus.desync.com:6969",
hashes=[
"2d88e693eda7edf3c1fd0c48e8b99b8fd5a820b2",
"8929b29b83736ae650ee8152789559355275bd5c",
],
)
print(results)

Or from the command line:

Terminal window
tracker-scraper udp://exodus.desync.com:6969 2d88e693eda7edf3c1fd0c48e8b99b8fd5a820b2

Either way you get a dictionary keyed by info_hash, each value holding seeds, peers, and complete:

{
"2d88e693eda7edf3c1fd0c48e8b99b8fd5a820b2": {
"seeds": 34,
"peers": 189,
"complete": 10
}
}
Supported
Tracker Scraper1.x
Python3.9 – 3.14
Tracker protocolsUDP, HTTP, HTTPS
  • Installation — install from PyPI and confirm it works.
  • Usage — the scrape() API and the tracker-scraper CLI in detail.
  • Configuration — arguments, return shape, timeouts, and logging.
  • Examples — copy-pasteable recipes for UDP, HTTP, and the CLI.