Want to see it in action? Here is a basic scraper for the current active API structure:
import requests
import json
import requests
from bs4 import BeautifulSoup
def search_tgx(query):
url = f"https://torrentgalaxy.to/torrents.php?search=query"
soup = BeautifulSoup(requests.get(url).text, "html.parser")
results = []
for row in soup.select("div.tgxtablerow"):
title = row.select_one("a.tgxtablecell")
magnet = row.select_one("a[href^='magnet:']")
if title and magnet:
results.append(
"title": title.text.strip(),
"magnet": magnet["href"]
)
return results
print(search_tgx("ubuntu")) # works until TGX changes HTML
Torrentgalaxy Api -
Problem: If TGx changes CSS classes (tgxtablerow → tgx-row), code breaks. Want to see it in action
Send more than 10 requests per minute from a single IP, and you will be temporarily blacklisted.
Prowlarr is the newer, more modern alternative (developed by the Servarr team). It acts similarly to Jackett but natively syncs with Sonarr/Radarr. Problem: If TGx changes CSS classes ( tgxtablerow
Recommendation: For 99% of users searching for "Torrentgalaxy API," the correct answer is "Install Jackett or Prowlarr."