Guides
TypeScript / JavaScript
npm install flipziNode.js 18 or newer, or any runtime with a global fetch (Deno, Bun, browsers). No runtime dependencies. ESM and
CommonJS builds, types included.
import { Flipzi, Marketplace, Condition, grade } from 'flipzi';
const flipzi = new Flipzi({ apiKey: process.env.FLIPZI_API_KEY });
const { data } = await flipzi.search({ q: 'charizard ex', game: 'pokemon' });
const id = data![0]!.id!;
await flipzi.price(id, { grade: grade('PSA', 10), currency: 'usd' }); // grade 'PSA_10'
await flipzi.sold(id, { condition: Condition.NEAR_MINT });
await flipzi.marketplaces(id, { marketplace: Marketplace.EBAY_DE });Methods
| Method | Endpoint |
|---|---|
health(), usage() | /v1/meta/health, /v1/meta/usage |
games(), sets({ game }), setCards(setId), setAnalytics(setId, { game }) | catalogue |
search(params), card(id), lookup(pokemontcgId) | finding cards |
price(id), history(id), printings(id), analytics(id) | prices |
sold(id), marketplaces(id), sales(id) | eBay sold data |
cardmarket(id), cardmarketHistory(id) | Cardmarket offers by condition |
population(id) | PSA population |
updates({ since }), movers({ game }) | changes and movers |
searchSealed(params), iterSealed(params), sealedProduct(id) | sealed products: 7,600+ boxes, ETBs, tins and more, with prices (0.5.0) |
sealedCardmarket(id), sealedComparisons(), sealedComparison(slug) | sealed Cardmarket offers and box value |
bulkPrices(ids), bulkAnalytics(ids), bulkCardmarket(ids) | many cards at once |
request(method, path, query, body) | any other route |
Iterators
for await (const set of flipzi.iterSets({ game: 'pokemon' })) console.log(set.set_id, set.name);
const since = new Date(Date.now() - 3600e3).toISOString();
for await (const change of flipzi.iterUpdates({ since })) console.log(change.card_id, change.price_cents);iterSets, iterSetCards, iterSearch, iterSales and iterUpdates fetch page after page; each page is one
billed request. Pass { maxItems: 100 } to stop early.
Bulk
const res = await flipzi.bulkPrices(ids, { grade: 'RAW' }); // any number of ids
res.data; // one row per card found
res.not_found; // ids with no cardIds are de-duplicated and sent in chunks of your plan's bulk cap, then merged into one response.
Options
| Option | Default | |
|---|---|---|
apiKey | process.env.FLIPZI_API_KEY | Sent as X-API-Key. |
baseUrl | https://data.flipzi.io | |
maxRetries | 2 | Retries after a 429, a 5xx or a network error. |
maxRetryAfter | 60 | Longest Retry-After, in seconds, the client waits through. |
timeoutMs | 30000 | Per attempt. |
onResponse | Called with the parsed headers of every response. | |
fetch | global fetch | Any compatible implementation. |
tagClient | true | Sends X-Flipzi-Client: sdk-js/<version>. |
Every method also takes per-call options as its last argument: { signal, timeoutMs, maxRetries }.