What is TCGAPIs?
New to TCG APIs? Read our TCGPlayer API alternatives guide to understand why developers choose TCGAPIs.
TCGAPIs provides RESTful APIs for accessing trading card game market data. Whether you're building a price tracker, an inventory management tool, or a market analytics dashboard, our API gives you the data you need.
With TCGAPIs you get access to:
- Real-time pricing for cards across 80+ TCGs
- Live marketplace listings with current seller data
- Historical sales data for trend analysis
- SKU-level pricing broken down by card condition
- Expansion and card catalog data for all supported games
Let's get you set up.
Step 1: Create Your Account
Head to tcgapis.com/signup and create your account. You'll need:
- A valid email address
- A password (8+ characters)
After signing up, check your email for a verification link. Click it to activate your account.
Step 2: Get Your API Key
Once your email is verified:
- Log in to your dashboard
- Your API key will be displayed in the dashboard
- Copy it — you'll need it for all API requests
Your API key is a UUID that looks like this: a1b2c3d4-e5f6-7890-abcd-ef1234567890
Important: Keep your API key secret. Don't commit it to public repositories or share it in client-side code.
Step 3: Make Your First Request
Let's fetch the list of supported games. This is the simplest endpoint and doesn't require any parameters:
curl -X GET "https://api.tcgapis.com/api/v1/games" \
-H "Authorization: Bearer YOUR_API_KEY"You should get a response listing all 80+ supported trading card games with their category IDs.
JavaScript Example
const API_KEY = process.env.TCGAPIS_KEY;
const BASE_URL = 'https://api.tcgapis.com/api/v1';
async function getGames() {
const response = await fetch(`${BASE_URL}/games`, {
headers: {
'Authorization': `Bearer ${API_KEY}`
}
});
if (!response.ok) {
throw new Error(`API error: ${response.status}`);
}
return response.json();
}
const games = await getGames();
console.log(`Found ${games.length} supported games`);Python Example
import os
import requests
API_KEY = os.environ["TCGAPIS_KEY"]
BASE_URL = "https://api.tcgapis.com/api/v1"
def get_games():
response = requests.get(
f"{BASE_URL}/games",
headers={"Authorization": f"Bearer {API_KEY}"}
)
response.raise_for_status()
return response.json()
games = get_games()
print(f"Found {len(games)} supported games")Step 4: Explore the Data Hierarchy
TCGAPIs organizes data in a logical hierarchy:
Games → Expansions → Cards → Prices/Listings
Get Expansions for a Game
Once you have a game's category ID, fetch its expansions:
// Get all Pokemon expansions
const expansions = await fetch(`${BASE_URL}/expansions/3`, {
headers: { 'Authorization': `Bearer ${API_KEY}` }
}).then(r => r.json());
console.log(`Pokemon has ${expansions.length} expansions`);Get Cards in an Expansion
With a group ID from the expansions response, fetch the cards:
// Get cards from a specific expansion
const cards = await fetch(`${BASE_URL}/cards/12345`, {
headers: { 'Authorization': `Bearer ${API_KEY}` }
}).then(r => r.json());
cards.forEach(card => {
console.log(`${card.name} - Product ID: ${card.productId}`);
});Get Prices for a Card
Finally, get current pricing data:
// Get price data for a specific card
const prices = await fetch(`${BASE_URL}/prices/67890`, {
headers: { 'Authorization': `Bearer ${API_KEY}` }
}).then(r => r.json());
console.log(`Market Price: $${prices.marketPrice}`);
console.log(`Low Price: $${prices.lowPrice}`);Available Endpoints
Here's a complete overview of the API endpoints:
| Endpoint | Description | Use Case |
|---|---|---|
GET /games | List all supported games | Game selection UI |
GET /expansions/:categoryId | Expansions for a game | Set browsers, filters |
GET /cards/:groupId | Cards in an expansion | Card listings, search |
GET /prices/:productId | Current price data | Price displays |
GET /skuprices/:skuId | Condition-level pricing for one SKU | Detailed pricing tables |
GET /skuprices/product/:productId | Every SKU's pricing for a card in one call | Bulk condition pricing |
GET /livelistings/:productId | Active marketplace listings | Listing comparisons |
GET /sales-history | Historical sales data | Charts, trend analysis |
Rate Limits
Your rate limit depends on your plan:
- Hobby (£99/mo): 10,000 requests per month
- Business (£199/mo): 50,000 requests per month
- Unlimited (£499/mo): Unlimited requests
Rate limit headers are included in every response:
X-RateLimit-Limit: 10000
X-RateLimit-Remaining: 9987
X-RateLimit-Reset: 2025-02-01T00:00:00Z
Best Practices
Cache Responses
Price data doesn't change every second. Cache responses for at least 5-15 minutes to reduce API calls:
const cache = new Map();
const CACHE_TTL = 10 * 60 * 1000; // 10 minutes
async function getCachedPrices(productId) {
const key = `prices:${productId}`;
const cached = cache.get(key);
if (cached && Date.now() - cached.time < CACHE_TTL) {
return cached.data;
}
const data = await fetch(`${BASE_URL}/prices/${productId}`, {
headers: { 'Authorization': `Bearer ${API_KEY}` }
}).then(r => r.json());
cache.set(key, { data, time: Date.now() });
return data;
}Handle Errors Gracefully
Always check response status codes:
async function safeApiCall(endpoint) {
const response = await fetch(`${BASE_URL}${endpoint}`, {
headers: { 'Authorization': `Bearer ${API_KEY}` }
});
if (response.status === 429) {
console.log('Rate limited. Try again later.');
return null;
}
if (!response.ok) {
throw new Error(`API error: ${response.status}`);
}
return response.json();
}Use Environment Variables
Never hardcode your API key:
# .env
TCGAPIS_KEY=your-api-key-here// Load from environment
const API_KEY = process.env.TCGAPIS_KEY;What's Next?
Now that you're set up, here are some ideas for what to build:
- Price tracker — Monitor specific cards and get alerts on price changes
- Collection manager — Track your card collection's total value
- Market dashboard — Visualize price trends across different TCGs
- Inventory tool — Help your card shop manage pricing and stock
Build a Pokemon card price tracker, analyze MTG market trends, or automate your card shop inventory.