What this tracker reads
A price tracker should identify the exact product and printing, fetch the appropriate record, and show when the value was updated. This tutorial uses TCGPlayer product prices in USD, which cost 2 credits per request; on a monthly plan they take 1 call. It does not promise that a price exists for every card or that a retrieved value represents a completed sale.
Start with the Pokemon API page and the endpoint reference. Search and catalog data are separate from prices.
Find and verify the product ID
From your server, request /api/v2/search?q=Charizard&game=3&limit=10 with an x-api-key header. Read candidates from the response's data array. Inspect the card, expansion, number and printing rather than automatically treating the first candidate as the desired card.
For Japanese cards use the separate Pokemon Japan category, 85. Once you have verified the identity, save its product ID in your application's own mapping.
Keep the key server-side
In your Next.js application's server environment set TCGAPIS_KEY. Do not prefix it with NEXT_PUBLIC_, place it in client JavaScript, or commit it to source control. Protect your application route with your own authentication and rate limits so it does not become an unrestricted public proxy for your key.
A server route can preserve the upstream response envelope:
import { NextResponse } from 'next/server';
export async function GET(request: Request) {
const id = new URL(request.url).searchParams.get('productId');
if (!id || !/^\d+$/.test(id)) {
return NextResponse.json({ error: 'A verified productId is required' }, { status: 400 });
}
const response = await fetch('https://api.tcgapis.com/api/v2/prices/' + id, {
headers: { 'x-api-key': process.env.TCGAPIS_KEY! },
cache: 'no-store',
});
const body = await response.json();
return NextResponse.json(body, { status: response.status });
}This is example code for your application, not an additional TCGAPIs endpoint. Add your authorization, caching and error reporting before publishing it.
Read the selected printing
The v2 price envelope is data.prices, keyed by printing. A UI can read a selected printing without treating missing values as free cards:
const response = await fetch('/api/card-price?productId=' + selectedProductId);
const body = await response.json();
if (!response.ok || !body.success) throw new Error(body.error || 'Price unavailable');
const printing = 'Normal'; // Use the printing selected and verified by your user
const record = body.data?.prices?.[printing];
const marketPrice = record?.marketPrice;
const displayPrice = typeof marketPrice === 'number' && Number.isFinite(marketPrice)
? new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(marketPrice)
: 'Price unavailable';
console.log(displayPrice, body.data?.last_updated ?? 'Source update time unavailable');Your route path should match the route you created. Selecting a different finish can change the record and its availability.
Build a history view carefully
For source history use /api/v2/historic-prices/{productId}; a request takes 1 call. Its data.prices is keyed first by date and then by printing. Keep gaps in the series visible; do not fill absent prices with zero.
If you also save your own observations, store retrieval time and source update time separately. Multiple polls of one unchanged upstream record are not multiple independent market observations.
Extend the workflow
SKU-level condition prices and current listing snapshots cost 5 credits per request; on a monthly plan they take 1 call on Unlimited and 5 on Hobby and Business. Card recognition can supply candidate product IDs from photographs, but a ranked candidate must still be checked for the right card and printing. The recognition guide explains scores and limitations.
Get Your API Key
Explore catalog records across 60+ trading card games, with price, listing and sales-history data where available.
Start Building