DBDelve
Dive deep into your data. A fast, native, multi-engine database client written in Rust. Free and open source, no telemetry.
翻訳待ち
No updates detected yet. GitHub releases will appear here.
Official JavaScript/TypeScript SDK for tcgapi.dev — pricing for Pokemon, Magic, Yu-Gi-Oh!, Lorcana, One Piece, and 50+ more trading card games.
翻訳待ち
Loading the full README.
Read the full README ↗Official JavaScript / TypeScript SDK for tcgapi.dev — a unified pricing API for 50+ trading card games, including:
Real-time market prices, full price history, fuzzy search, bulk lookups, and exports — all from one HTTP API.
npm install tcgapi
Requires Node 18+ (or any runtime with global fetch — Bun, Deno, Cloudflare Workers, modern browsers).
Get a free API key at tcgapi.dev/dashboard (100 requests/day, no credit card).
import { TCGApi } from 'tcgapi';
const tcg = new TCGApi({ apiKey: process.env.TCGAPI_KEY });
// Look up a single card
const card = await tcg.cards.get(123456);
console.log(card.data.name);
// Get every printing's current price
const prices = await tcg.cards.prices(123456);
for (const p of prices.data) {
console.log(`${p.printing}: $${p.market_price}`);
}
If you don't pass apiKey, the client reads from the TCGAPI_KEY environment variable.
const results = await tcg.search.cards({
q: 'charizard',
game: 'pokemon',
sort: 'price_desc',
per_page: 20,
});
for (const card of results.data) {
console.log(card.name, card.set_name, card.market_price);
}
for await (const card of tcg.search.iterate({ q: 'lightning', game: 'magic' })) {
// walks `meta.has_more` automatically — caps at the API's 200/page max
}
const games = await tcg.games.list();
const pokemonSets = await tcg.games.sets('pokemon');
const surgingSparks = pokemonSets.data.find(s => s.name.includes('Surging Sparks'));
if (surgingSparks) {
const cards = await tcg.sets.cards(surgingSparks.id, { sort: 'price_desc' });
console.log(`${surgingSparks.name}: ${cards.meta?.total} cards`);
}
// Auto-chunks if you pass more than 500 IDs.
const bulk = await tcg.bulk.prices([1, 2, 3, /* ... up to thousands */]);
console.log(`Got prices for ${bulk.data.length} card-printings`);
// include: 'ebay' adds each row's eBay summary (1 credit + 1 per card with eBay data)
const withEbay = await tcg.bulk.prices([1, 2, 3], { include: 'ebay' });
// Price floors per (printing, condition) — Near Mint, Lightly Played, etc.
const conditions = await tcg.cards.conditions(13217, { printing: 'Holofoil' });
for (const row of conditions.data) {
// median_with_shipping is robust to $0.01 junk listings — prefer it when pricing inventory
console.log(`${row.printing} / ${row.condition}: $${row.median_with_shipping}`);
}
console.log(conditions.meta?.cached, conditions.meta?.condition_counts);
// Bulk variant — up to 500 cards per call, served from the nightly cache.
// Cards without condition data yet are absent; fetch them once via
// tcg.cards.conditions() to warm them.
const bulkConditions = await tcg.bulk.conditions([13217, 13218, 13219]);
// How much is for sale, from how many sellers, and how much sits near the market price.
const supply = await tcg.cards.supply(13118);
const s = supply.data;
console.log(`${s.units} copies from ${s.sellers} sellers; largest listing holds ${s.largest_listing?.share}`);
console.log(`${s.near_market?.units} copies within 10% of market: ${s.near_market_days_of_supply} days of sales`);
// One point per read (about every 3 days), oldest first. History starts 2026-10-27.
const supplyHistory = await tcg.cards.supplyHistory(13118, { days: 90 });
// Bulk variant — up to 500 products per call, auto-chunks above that.
// Products with no supply recorded yet are absent.
const bulkSupply = await tcg.bulk.supply([13118, 13217, 13218]);
const movers = await tcg.prices.topMovers({
game: 'pokemon',
direction: 'up',
period: '7d',
limit: 10,
});
for (const m of movers.data) {
console.log(`${m.name} (${m.set_name}): +${m.price_change}% — $${m.market_price}`);
}
Every price row carries market_price_as_of: the UTC date TCGPlayer last reported
that printing's market price. It is older than last_updated_at when a printing
has stopped selling — the last price is kept and dated rather than dropped.
const prices = await tcg.cards.prices(123456);
for (const p of prices.data) {
console.log(p.printing, p.market_price, 'as of', p.market_price_as_of);
}
When TCGPlayer stops reporting any price for a product (typically out of print with
no listings), its rows keep the last prices reported and are no longer refreshed
daily. no_market_price_since says since when; it is null while the printing is
priced.
const prices = await tcg.cards.prices(123456);
for (const p of prices.data) {
if (p.no_market_price_since) console.log(p.printing, 'unpriced on TCGPlayer since', p.no_market_price_since);
}
This is the beginning of the README. Read the rest at the original. Read the full README ↗