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

Card price alerts and deal finders: three patterns on a TCG price API

Watchlist alerts from the change feed, a weekly movers post, and a check that tells you whether a listing is below what the card sells for. With code and the limits of each.

Three ways to build alerts on a price API

Alert and deal tools come in three shapes, and each maps to different endpoints of the Flipzi Data API:

ToolQuestion it answersEndpointPlan
Watchlist alertDid a card I follow cross my price?GET /v1/cards/updatesPro+
Movers postWhat rose or fell most this week?GET /v1/market/moversUltra+
Deal checkIs this listing below what the card sells for?/sold and /cardmarketPro+ and Ultra+

1. Watchlist alerts from the change feed

GET /v1/cards/updates returns the cards whose price changed since a timestamp in the last 7 days. With include=previous each row also carries the previous price and the change in percent, which is what an alert needs. This Python generator pages through one poll:

import os
import requests

API = "https://data.flipzi.io"
HEADERS = {"X-API-Key": os.environ["FLIPZI_KEY"]}

def price_changes(since, game="pokemon"):
    """Yield every changed card since an ISO-8601 time within the last 7 days."""
    params = {"since": since, "game": game, "limit": 500, "include": "previous"}
    while True:
        res = requests.get(f"{API}/v1/cards/updates", params=params, headers=HEADERS, timeout=30)
        res.raise_for_status()
        page = res.json()
        yield from page["data"]
        if not page["has_more"]:
            return
        params = {"cursor": page["next_cursor"], "limit": 500, "include": "previous"}

def alerts(watchlist, since):
    """watchlist: {card_id: {"below": cents or None, "above": cents or None}}"""
    for row in price_changes(since):
        rule = watchlist.get(row["card_id"])
        if rule is None or row["grade"] != "RAW":
            continue
        price, before = row["price_cents"], row.get("previous_price_cents")
        if rule.get("below") and price <= rule["below"] and (before is None or before > rule["below"]):
            yield row["card_id"], "dropped to", price
        if rule.get("above") and price >= rule["above"] and (before is None or before < rule["above"]):
            yield row["card_id"], "rose to", price

Three rules keep the poller correct:

  • The cursor is opaque. Pass next_cursor back as it came; do not build one.
  • Delivery is at least once. A row can appear twice across pages, so remember which alerts you sent and do not send them again.
  • Store the time of your last poll and pass it as since next time. When nothing changed the answer is empty and carries an ETag; send it as If-None-Match to get 304.

The feed costs one unit per 25 rows, doubled with include=previous. It covers every changed card in the game, not only your watchlist, so filter by set_id when your users follow one set. A small watchlist on Basic can instead reprice its own ids with POST /v1/cards/bulk on a timer and compare with the last value you stored.

2. A weekly movers post

GET /v1/market/movers returns the biggest gainers and losers for a game over 24 hours, 7 days or 30 days. It costs 5 units a call and needs Ultra or above.

curl --fail-with-body --get 'https://data.flipzi.io/v1/market/movers' \
  --data-urlencode 'game=onepiece' \
  --data-urlencode 'window=7d' \
  --data-urlencode 'direction=both' \
  --data-urlencode 'limit=10' \
  --data-urlencode 'min_price_cents=1000' \
  -H "X-API-Key: $FLIPZI_KEY"

Each row has the card, its price, previous_price_cents and change_percent. Set min_price_cents: without a floor the top of a percentage list is cheap cards moving by cents. Before you publish, drop rows whose previous price was a few cents; a jump from almost nothing is usually a first real observation, not a market move.

3. Is this listing a deal?

You have a listing: a card, a condition and an asking price. Two figures tell you where it stands:

  • What copies sold for: GET /v1/cards/{card_id}/sold gives a value from completed eBay sales per grade, with sample_size, comps_30d and a 30-day range. Add condition=nm|lp|mp|hp|dmg for ungraded copies in a stated condition. Pro and above.
  • What sellers ask now: GET /v1/cards/{card_id}/cardmarket gives the cheapest and median Cardmarket offer per grade and language. Ultra and above.
def deal_check(card_id, asking_cents, min_sales=5, discount=0.15):
    """True when the ask is at least `discount` below what ungraded copies sold for."""
    res = requests.get(f"{API}/v1/cards/{card_id}/sold",
                       params={"grade": "RAW", "currency": "eur"}, headers=HEADERS, timeout=30)
    res.raise_for_status()
    sold = next((s for s in res.json()["data"]["sold"] if s["grade"] == "RAW"), None)
    if sold is None or sold["sample_size"] < min_sales or not sold["confidence"]["is_reliable"]:
        return None                      # not enough sales to judge
    return asking_cents <= sold["price_cents"] * (1 - discount)

Returning None when the evidence is thin matters as much as the comparison. A card with two sales in a month has no market price to be below. The two sources also measure different things: a Cardmarket figure is an asking price, an eBay figure is a completed sale, and the condition scales differ. Cardmarket and eBay prices in an app explains how to show them side by side without mixing them.

Avoid false alerts

  • Read confidence. Alert only on rows marked reliable; a low score means few observations.
  • Require a real move. A threshold in percent and in cents filters out rounding and currency drift.
  • Keep printings apart. An alternate art and its base card are different ids with different prices. Alert on the id the user followed.
  • Say when. Put updated_at in the message. An alert about a price observed yesterday should say so.
  • Missing is not zero. A card that loses its price has an empty list, not a 100% drop.

What Flipzi does not do

  • No push or webhook delivery: your job polls and sends the notification.
  • No feed of live marketplace listings to scan for bargains; you bring the listing.
  • No retail stock or restock data.
  • The API does not buy, bid or list. It is read-only.

Plans and units

  • Free: 500 units a month at 5 requests a minute, for building and testing.
  • Basic: bulk repricing of a watchlist on a timer.
  • Pro (100,000 units a month): the change feed, sold prices and graded prices.
  • Ultra (500,000 units a month): market movers and Cardmarket prices by condition.

Errors are never billed, and GET /v1/meta/usage reports the remaining allowance at no cost. See API pricing and unit costs per endpoint.

Start with the change feed

The free plan reaches the change feed and sold prices within its allowance, so you can build and test the poller before choosing a plan.

Get a free API key Try it in the playground Compare API plans

Straight answers

Is there an API for trading card price alerts?
Flipzi has no hosted alert service for API customers; it gives you the data to build one. GET /v1/cards/updates (Pro and above) lists every card whose price changed since a time you pass, optionally with the previous price and the percentage change, so your code decides who to notify.
How quickly does a price change appear?
Prices are refreshed on a schedule that differs by source, not streamed. Every row carries updated_at, so an alert can say when the price was observed. Poll the change feed every few minutes at most; an empty answer with an ETag costs little to repeat.
Can I find underpriced listings with the API?
You can judge a listing you already have. Compare its asking price with the value from completed eBay sales (GET /v1/cards/{card_id}/sold) and with the cheapest Cardmarket offer in the same condition (GET /v1/cards/{card_id}/cardmarket). Flipzi does not provide a feed of live listings to scan.
Does the API report restocks or retail stock?
No. Flipzi covers secondary-market prices: quotes, completed sales and Cardmarket asking prices. Retailer stock and restock times are not in the API.
Which plan do alerts need?
A small watchlist can poll POST /v1/cards/bulk on Basic. The change feed, sold prices and graded prices start on Pro. Market movers and Cardmarket prices by condition start on Ultra.