tcglookup-py
The official Python SDK for the TCG Price Lookup API — live trading card prices across Pokemon, Magic: The Gathering, Yu-Gi-Oh!, Disney Lorcana, One Piece TCG, Star Wars: Unlimited, and Flesh and Blood.
One API for every major trading card game. TCGPlayer market prices, eBay sold averages, and PSA / BGS / CGC graded comps — all in one place.
Install
pip install tcglookup
Quickstart
from tcglookup import TcgLookupClient
client = TcgLookupClient(api_key="tlk_live_...")
# Search for cards
results = client.cards.search(q="charizard", game="pokemon", limit=5)
for card in results["data"]:
print(card["name"], card["prices"]["raw"])
# Get a single card by ID
card = client.cards.get("a3f8c1e2-...")
print(card["name"], card["prices"])
# Daily price history (Trader plan and above)
history = client.cards.history("a3f8c1e2-...", period="30d")
for day in history["data"]:
print(day["date"], day["prices"])
# List all supported games
for game in client.games.list()["data"]:
print(game["slug"], game["name"], game["count"], "cards")
Get an API key
Sign up at tcgpricelookup.com/tcg-api. Free tier includes 10,000 requests per month with TCGPlayer market prices. Trader plan unlocks eBay sold averages, PSA / BGS / CGC graded prices, and full price history.
API surface
Cards
client.cards.search(
q="blue-eyes white dragon",
game="yugioh", # pokemon | mtg | yugioh | onepiece | lorcana | swu | fab
set="lob", # set slug
limit=20,
offset=0,
)
client.cards.get("<card-uuid>")
client.cards.history("<card-uuid>", period="30d") # 7d | 30d | 90d | 1y
Sets
client.sets.list(game="mtg", limit=50)
Games
client.games.list()
Batch lookups
Pass an iterable of IDs and the SDK auto-chunks into 20-ID batches:
results = client.cards.search(ids=["uuid1", "uuid2", ..., "uuid100"])
Error handling
from tcglookup import (
TcgLookupClient,
AuthenticationError,
PlanAccessError,
NotFoundError,
RateLimitError,
)
client = TcgLookupClient(api_key="tlk_live_...")
try:
history = client.cards.history("<uuid>", period="1y")
except AuthenticationError:
print("Bad API key")
except PlanAccessError:
print("History requires Trader plan — upgrade at tcgpricelookup.com/tcg-api")
except NotFoundError:
print("That card doesn't exist")
except RateLimitError:
print(f"Rate limited. Quota: {client.rate_limit.remaining}/{client.rate_limit.limit}")
Rate limits
After every successful request, the most recent rate-limit headers are available on the client:
client.cards.search(q="pikachu")
print(client.rate_limit.remaining, "/", client.rate_limit.limit)
Use as a context manager
with TcgLookupClient(api_key="tlk_live_...") as client:
cards = client.cards.search(q="black lotus", game="mtg")
# HTTP connection pool is closed automatically
Sister SDKs
- tcglookup-js — JavaScript / TypeScript
- tcglookup-go — Go
- tcglookup-rs — Rust
- tcglookup-php — PHP
- tcglookup CLI — terminal client
- tcg-api-examples — runnable code samples in 8 languages
- tcg-discord-bot — self-hosted Discord bot with slash commands
The full developer ecosystem index lives at awesome-tcg.
License
MIT — see LICENSE.
Built by TCG Price Lookup. Get a free API key at tcgpricelookup.com/tcg-api.
Metadata
Release files for tcglookup 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| tcglookup-0.1.0.tar.gz | 7.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tcglookup-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.5 kB
Release files / tcglookup-0.1.0.tar.gz
| Download URL | tcglookup-0.1.0.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ec5d367bc24ce16b222e127c79787757b039568cc9d66c3d4dc72ee1dfb58e45
|
|
BLAKE2b-256 checksum How to use checksums |
2ea49e6506c2192fa6f5f5a9db18c0a6e60ab23cdf3a3563525601cd4a200bde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / tcglookup-0.1.0-py3-none-any.whl
| Download URL | tcglookup-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47dd320e0e20c3e9f5e7c84c85b96617a433c44f79ef2894e1dc115b4675d93a
|
|
BLAKE2b-256 checksum How to use checksums |
814e6e4eefabaef75d3fa002c83f16622fd1ea60e8d1493bec4a73ed0413d98a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Security for tcglookup 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.