Torrentgalaxy Api -
import requests
params = "q":"ubuntu", "page":1, "limit":10
r = requests.get("https://torrentgalaxy.to/api/search", params=params, timeout=10)
data = r.json()
for t in data:
print(t["name"], t.get("seeders"), t.get("magnet"))
| Feature | Available? | Notes |
|---------|------------|-------|
| Search by query | ✅ Via RSS (limited) or scraping | RSS supports basic search, but not filters like category, size, seeds |
| Get torrent details | ✅ Scraping only | Title, size, files, magnet, uploader, comments |
| Categories (Movies, Games, etc.) | ✅ Via RSS category IDs | |
| Sort by seeds/date/size | ❌ Not in RSS, requires scraping | |
| Pagination | ✅ RSS has pagination via &page= | |
| Trending/recent torrents | ✅ RSS for latest uploads | |
| User uploads | ❌ No direct endpoint | |
| Login/upload via API | ❌ Not possible | |
Real example (RSS search):
https://torrentgalaxy.to/rss?search=avatar&category=1
Returns XML with title, link, size, seeds, category.
Send more than 10 requests per minute from a single IP, and you will be temporarily blacklisted.
url = "https://torrentgalaxy.to/torrents-api.php" Torrentgalaxy Api -
params = "search": "The Last of Us 1080p", # Your query "category": "1", # 1 = Movies "limit": "5"
headers = "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
try: response = requests.get(url, params=params, headers=headers, timeout=10) data = response.json() | Feature | Available
# Check the structure (it usually returns a 'data' array)
if data and "data" in data:
for torrent in data["data"]:
print(f"Name: torrent['name']")
print(f"Seeders: torrent['seeders'] | Leechers: torrent['leechers']")
print(f"Magnet: torrent['magnet']\n")
else:
print("No results or API changed structure.")
except Exception as e: print(f"Error: e") print("The API may be offline or the endpoint has moved.")
After digging through the network logs and community posts, here is what the API actually supports:
TorrentGalaxy (TGx) is a public torrent indexer (similar to RARBG, 1337x, The Pirate Bay).
The TorrentGalaxy API is not an official, documented REST API like you’d find with legit services. Instead, it refers to: Send more than 10 requests per minute from
No official API key, rate limits, or Swagger docs exist.
Unlike some other public trackers, TorrentGalaxy doesn't have a massive "REST API" marketing page. Instead, it utilizes a Torrent Control Protocol (TCP) interface and a limited, but functional, JSON API mainly used for its internal search engine and RSS feed generation.
If you know where to look (typically https://torrentgalaxy.to/torrents-api.php or via their /rss endpoint), you can query the database without rendering the heavy HTML interface.