Docs / API reference
History, many cards
Sold history for many cards in one request.
Request
POST
https://tcgpriceapi.com/v1/history/lookup| Name | Type | Description |
|---|---|---|
card_idsrequired | array of strings | The cards to look up, up to your plan's history cards per request (see Rate limits). The example asks for one card, so it works on every plan. |
timeframe | string | 7d or 30d (one row per day), 3m (3 days per row), 6m or 1y (one week per row). Defaults to 30d. Free includes 7d, Starter up to 30d, and Pro and up every time frame. |
printing | string | Only this printing, such as Holofoil. |
condition | string | Only this condition, such as Near Mint. |
language | string | Only this language, such as English. |
Up to your plan's history cards in one request. For 7d or 30d the whole request counts as one request. For 3m, 6m or 1y, each card counts as one request, so 20 cards count as 20.
curl -X POST "https://tcgpriceapi.com/v1/history/lookup" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"card_ids": ["card_1c3aaea45434413c"], "timeframe": "30d", "condition": "Near Mint"}'import requests
response = requests.post(
"https://tcgpriceapi.com/v1/history/lookup",
headers={"X-API-Key": "YOUR_API_KEY"},
json={
"card_ids": [
"card_1c3aaea45434413c"
],
"timeframe": "30d",
"condition": "Near Mint"
},
timeout=30,
)
response.raise_for_status()
print(response.json())const response = await fetch("https://tcgpriceapi.com/v1/history/lookup", {
method: "POST",
headers: {
"X-API-Key": process.env.TCGPRICEAPI_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({"card_ids": ["card_1c3aaea45434413c"], "timeframe": "30d", "condition": "Near Mint"}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());Response
The same shape as Price history, with one entry per card.
| Field | Type | Description |
|---|---|---|
timeframe | string | The time frame you asked for: "7d", "30d", "3m", "6m" or "1y". |
cards | array of history card objects | The cards found, in the order you asked for them. |
not_found | array of string | The card_ids you asked for that don't exist. |