Winter Gifts. A gift box is waiting in every Data API account until 31 December. Open your gift

Official Flipzi API SDKs for TypeScript and Python

npm install flipzi or pip install flipzi: typed clients for every Data API endpoint, with retries, pagination and bulk splitting built in.

Install

Both packages are called flipzi: npm for TypeScript and JavaScript, PyPI for Python.

npm install flipzi
pip install flipzi

You need a Data API key. Create a free account, verify your email and create a key on the keys page. It starts with fz_live_ and needs no card. Both clients read it from the FLIPZI_API_KEY environment variable if you don't pass it.

A first price in three lines

TypeScript / JavaScript

import { Flipzi } from 'flipzi';
const flipzi = new Flipzi({ apiKey: 'fz_live_...' });
console.log((await flipzi.price('0908653a-ce24-4d7e-811e-78c2935bd822')).data.prices[0].price_formatted);

Python

from flipzi import Flipzi
flipzi = Flipzi(api_key="fz_live_...")
print(flipzi.price("0908653a-ce24-4d7e-811e-78c2935bd822")["data"]["prices"][0]["price_formatted"])

Python also has AsyncFlipzi, with the same methods for asyncio code.

Finding a card id

Prices are looked up by Flipzi card id. Search for it by name, or by set code and collector number:

const { data } = await flipzi.search({ q: 'charizard ex', game: 'pokemon' });
const card = data[0];            // card.id, card.name, card.set.name, card.number
card = flipzi.search("charizard ex", game="pokemon")["data"][0]

More on matching cards, including set codes and other catalogue ids: Finding a card.

One method per endpoint

Every Data API endpoint has a method, and parameters keep the API's own names, so the API reference applies word for word. Responses are the API's JSON, typed: the types are generated from the published OpenAPI spec (TypeScript types, Python TypedDicts).

What you wantTypeScriptPython
Current price per gradeprice(id)price(id)
eBay sold prices, summarysold(id)sold(id)
eBay sold prices per domestic sitemarketplaces(id)marketplaces(id)
Individual salessales(id), iterSales(id)sales(id), iter_sales(id)
Cardmarket offers by conditioncardmarket(id)cardmarket(id)
Price historyhistory(id)history(id)
Many cards at oncebulkPrices(ids)bulk_prices(ids)
Everything that changed since a timeiterUpdates({ since })iter_updates(since)

The full list (catalogue, printings, analytics, PSA population, movers, sealed-box comparisons, usage) is in each package's README on npm and PyPI. Which plan each endpoint needs is on the pricing page.

What the clients handle for you

  • Retries. A 429 or 5xx is retried with backoff, waiting Retry-After when the API sends one. A spent monthly quota is never retried. Refused requests are not billed.
  • Pagination. iterSets, iterSearch, iterSales and iterUpdates (Python: iter_*) walk every page for you.
  • Bulk. Pass any number of ids. The client splits them to your plan's bulk cap and merges the answers into one response.
  • Quota. Units and requests left come from the response headers: flipzi.lastResponse.quotaRemaining (Python: flipzi.last_response.quota_remaining). usage() gives the same figures at no cost.
  • Enums. Marketplace, condition, currency, game, finish and period values are provided as constants, so Marketplace.EBAY_DE autocompletes.

Errors

Every failure raises one error type, FlipziError, built from the API's error body. It has the HTTP status, a machine-readable code such as PLAN_FEATURE_LOCKED, the details (including the upgrade path when a plan doesn't include an endpoint) and the requestId / request_id to quote to support.

from flipzi import FlipziError

try:
    flipzi.sold(card_id)
except FlipziError as e:
    print(e.status, e.code, e.message, e.request_id)

Examples

Each package ships two runnable examples:

  • Price my collection. Values a list of cards with quantities and grades in one bulk request per grade, and falls back to one call per card on the free plan.
  • eBay DE vs UK. German and UK sold prices for one card, side by side, per grade and language, from a single marketplaces call. See country-specific eBay sold prices for what the numbers mean.

Try it before you decide

Want to see the data first? The playground runs real queries against production, no key needed.

Open the playground Compare all 13 APIs Switching? Migration guides

Straight answers

Are the SDKs free?
Yes. Both are MIT licensed. Calls through them are ordinary Data API calls: the same plans, units and limits, including the free plan with no card (500 units a month at 5 requests a minute).
Which runtimes are supported?
The TypeScript/JavaScript package needs Node.js 18 or newer, or any runtime with a global fetch (browsers, Deno, Bun), and has no runtime dependencies. The Python package needs Python 3.9 or newer and depends only on httpx.
Do I have to upgrade the SDK when the API changes?
No. New response fields pass straight through, game and grade arguments accept any value, and a generic request method reaches any endpoint. A new SDK version adds typed methods for new endpoints and parameters; older versions keep working.
Do the SDKs send anything besides my requests?
No. Each request carries an X-Flipzi-Client header with the SDK name and version (sdk-js/0.1.0, for example), which lets Flipzi count SDK usage. Turn it off with tagClient: false (TypeScript) or tag_client=False (Python).
Can I use the SDK in a browser?
The TypeScript package works anywhere fetch does, and the API allows cross-origin requests. Your API key would be visible to anyone using the page, though, so call the API from your server.