Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Python example — TCG Price Lookup API

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.

Run

pip install -r requirements.txt
TCGLOOKUP_API_KEY=tlk_live_... python search.py

Get a free API key at tcgpricelookup.com/tcg-api.

What it shows

  • client.cards.search(q=..., game=..., limit=...) — search across every supported TCG
  • client.cards.get(id) — fetch the full price block for a single card
  • Typed exception handling for PlanAccessError and RateLimitError
  • Reading client.rate_limit after every call
  • Using the client as a context manager (auto-closes the HTTP pool)

Expected output

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

Build something bigger