How do I get the Cardmarket price of a trading card from a photo?
Direct answer
Send the photo to a card recognition API that returns Cardmarket prices with the card. The NeoSatoshi Detection API answers one POST request with the card's name, set, number, Cardmarket product ID and its Cardmarket prices in EUR (trend, low, 7-day and 30-day average), updated daily, for Pokémon, One Piece, Disney Lorcana, Yu-Gi-Oh!, Magic and Star Wars: Unlimited. Where the photo cannot prove the printing, the price stays empty on purpose instead of guessing a cheaper one.
What the price block holds
prices.cardmarket:trend,low,avg7andavg30in EUR. A missing price isnull, never 0.prices.cardmarket_foilfor Lorcana, Magic and Star Wars: Unlimited, the foil price family with the same fields. The photo does not always tell foil from non-foil, so check the finish fields of your game in the documentation.prices.tcgplayerin USD where available.cardmarket_id: Cardmarket's product ID (idProduct) of exactly this printing. It is the stable key for Cardmarket imports and your own price lookups later.
From photo to a listing price in Python
This script reuses scan.py from the scanner app tutorial, which runs with the public demo key (10 detections per day, no signup). It takes the trend price, adds a markup and a minimum, and leaves cards without a sure printing to a person. Run python prices.py card.jpg, or python prices.py card.jpg magic.
Python: prices.py
import sys
from scan import detect # scan.py from the scanner app tutorial
MARKUP = 1.10 # 10 % above the Cardmarket trend
MINIMUM = 0.25 # never below this, in EUR
def open_printing(card):
"""The card is known but not which printing or rarity: ask, do not guess."""
return any(card.get(k) for k in ("print_unconfirmed", "rarity_unconfirmed", "version_unconfirmed"))
def listing_price(card):
if open_printing(card):
return None
cm = (card.get("prices") or {}).get("cardmarket") or {}
base = cm.get("trend") if cm.get("trend") is not None else cm.get("avg30")
if base is None:
return None # no price is null, never 0
return max(round(base * MARKUP, 2), MINIMUM)
tcg = sys.argv[2] if len(sys.argv) > 2 else "pokemon"
for card in detect(sys.argv[1], tcg)["cards"]:
price = listing_price(card)
print(
card.get("name"),
"| Cardmarket ID", card.get("cardmarket_id"),
"|", f"{price:.2f} EUR" if price is not None else "no price, ask the seller",
)When there is no price
print_unconfirmed(Yu-Gi-Oh!, Magic, Star Wars: Unlimited): the card is known, its printing is not. Prices of one card can differ by a factor of 100 between printings, so the API leaves the price empty and lists the printings with their own prices inalternatives.rarity_unconfirmedandversion_unconfirmed(Yu-Gi-Oh!): the price is the cheapest option, the others are listed. Let your user pick before you sell.version_unconfirmed(Star Wars: Unlimited): only the name was read, so even the version of the character may be wrong. Show the alternatives to a person.- A few cards have no Cardmarket product or no price yet. Then the fields are
null.
Which price to use
Trend is a good default for a listing. The 30-day average is calmer for cards that sell rarely, and low is the floor other sellers ask. The prices are for the card, not for its condition: the API does not judge condition, so lower the price yourself for played cards. For a graded slab they remain the price of the raw card.
Frequently asked questions
How fresh are the prices?
They are updated once a day from Cardmarket's price guide, so they move with the market but not within the day.
Can I get the price without a photo?
The Detection API always starts from a photo. If you already know the card, store its cardmarket_id from the first scan and use it as your key from then on.
What does it cost?
One card scan per detected card, the price comes with it. A photo without a card costs nothing. Plans: pricing.
Further reading
Get the docs and the demo key
Every price field per game, live examples and a test box for your own photo. 10 free detections per day, no signup.
No account required for the first 10 detections.