FlipziDocs
Guides

TypeScript / JavaScript

npm install flipzi

Node.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

MethodEndpoint
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 card

Ids are de-duplicated and sent in chunks of your plan's bulk cap, then merged into one response.

Options

OptionDefault
apiKeyprocess.env.FLIPZI_API_KEYSent as X-API-Key.
baseUrlhttps://data.flipzi.io
maxRetries2Retries after a 429, a 5xx or a network error.
maxRetryAfter60Longest Retry-After, in seconds, the client waits through.
timeoutMs30000Per attempt.
onResponseCalled with the parsed headers of every response.
fetchglobal fetchAny compatible implementation.
tagClienttrueSends X-Flipzi-Client: sdk-js/<version>.

Every method also takes per-call options as its last argument: { signal, timeoutMs, maxRetries }.

README and changelog on npm.

On this page