A minimal Python 3.9+ example using the official tcglookup package to search trading card prices, fetch a single card, and inspect rate-limit headers.
pip install -r requirements.txt
TCGLOOKUP_API_KEY=tlk_live_... python search.pyGet a free API key at tcgpricelookup.com/tcg-api.
client.cards.search(q=..., game=..., limit=...)— search across every supported TCGclient.cards.get(id)— fetch the full price block for a single card- Typed exception handling for
PlanAccessErrorandRateLimitError - Reading
client.rate_limitafter every call - Using the client as a context manager (auto-closes the HTTP pool)
Found 557 matches. Showing first 5:
Charizard Base Set $488.20
Charizard XY - Evolutions $71.56
Charizard ex Obsidian Flames $48.97
...
Full price block for the top hit:
near_mint $488.20
lightly_played $390.56
moderately_played $293.92
...
Rate limit: 9999/10000
- See the full SDK at github.com/TCG-Price-Lookup/tcglookup-py
- Browse other languages in tcg-api-examples