Skip to content
TTCGAPIs
guides3 min read

Analyze MTG Price History with API Data

Read printing-specific MTG price history and distinguish market snapshots, recent sales and stored sales buckets.

T

TCGAPIs Team

Updated

Know which series you are analysing

TCGAPIs exposes several distinct data surfaces for Magic: The Gathering. Product prices and daily historic prices are market snapshots. Recent sales are reported transactions. The stored sales archive uses buckets by SKU attributes. These are not interchangeable measures.

Prices and history cost 2 credits per request; on a monthly plan they take 1 call. SKU prices and listing snapshots cost 5 credits per request; on a monthly plan they take 1 call on Unlimited and 5 on Hobby and Business. See the MTG API and documentation for field definitions.

Verify the product and printing

Search with game category 1, inspect the returned candidates, and record the product ID for the exact set and printing you want. Do not combine reprints just because their names match. Keep USD product prices separate from other currencies.

Read daily price snapshots

/api/v2/historic-prices/{productId} returns an object under data; its prices map is keyed by date and then printing. This example uses a verified ID from your environment and leaves missing observations out of the calculation.

const headers = { 'x-api-key': process.env.TCGAPIS_KEY };
async function get(path) {
  const response = await fetch('https://api.tcgapis.com/api/v2' + path, { headers });
  const body = await response.json();
  if (!response.ok || !body.success) throw new Error(body.error || 'API request failed');
  return body;
}
 
const productId = Number(process.env.TCGAPIS_PRODUCT_ID);
if (!Number.isSafeInteger(productId) || productId <= 0) throw new Error('Set a verified MTG product ID');
const history = await get('/historic-prices/' + productId);
const printing = 'Normal'; // Match the inspected printing
const series = Object.entries(history.data.prices || {})
  .map(([date, printings]) => ({ date, price: printings?.[printing]?.marketPrice }))
  .filter(point => typeof point.price === 'number' && Number.isFinite(point.price))
  .sort((a, b) => a.date.localeCompare(b.date));
 
if (series.length < 2 || series[0].price <= 0) {
  console.log('Insufficient comparable history');
} else {
  const first = series[0];
  const last = series[series.length - 1];
  console.log({ from: first.date, to: last.date,
    changePercent: (last.price / first.price - 1) * 100 });
}

That percentage describes only the available observations for one printing. It does not imply a continuous series, a realised return, transaction volume or a prediction. Show gaps and dates in the chart.

Distinguish recent transactions from stored history

Use /api/v2/sales-history/{productId} for the recent source feed. Read its transaction array from data.sales; it is not a bare array and the product ID belongs in the path, not ?productId=.

const recent = await get('/sales-history/' + productId + '?limit=25&offset=0');
for (const sale of recent.data.sales) {
  console.log(sale.date, sale.price, sale.condition);
}

Use the pagination metadata rather than assuming this is every trade. Temporary source failures differ from a successful response containing no sales.

For the stored archive, /api/v2/sales-history/{productId}/full returns paginated rows combining a SKU and a three-day bucket. Its date is bucketStartDate. A bucket summary is not an individual transaction; do not count one bucket as one sale.

Compare providers within their scope

The trend-prices layer is Magic-only. Read the currency, finish, provider, retail/buylist type and date of each row before comparing values. Accepted provider filters do not prove that data exists for a chosen product or source.

Avoid over-interpreting small samples

A price change can reflect sparse supply, a different printing or an outdated observation. Inspect the source record and available sales before drawing conclusions. This tutorial supplies an analysis method, not a claim of predictive accuracy or investment returns.

Get Your API Key

Explore catalog records across 60+ trading card games, with price, listing and sales-history data where available.

Start Building
MTGmarket analysissales historyMagic The GatheringMTG price API