Repository navigation
API Documentation
API keys and the gateway at https://api.mtgban.com/ are documented in the site guide's API tab, with an OpenAPI specification for each version. This page covers the same API on the game sites directly, with a sig signature.
This page documents version 2, under /api/v2/. Version 1, under /api/mtgban/, is still served; Porting from v1 to v2 maps every version 1 field and option to its version 2 equivalent.
Responses are JSON, compressed with GZIP. Every response has a meta section with the date of the request, the API version ("2") and the base_url of the store redirect. A request that fails carries an error string instead of prices.
Prices are keyed by card id, then by finish, then by store tag, and each store lists its prices one per condition, best condition first, so the first entry is the store's best price for that finish.
- The finish is the one the card is sold in:
nonfoil,foil,etched, a game's own such ascoldfoilorreverseholofoil, orsealedfor a sealed product. Thefinishesendpoint lists the ones a game uses. - Each entry has a
pricein FLOAT64: the store's best price in that condition, the lowest for retail and the highest offer for buylist. Prices are in USD. -
conditionisNM(Near Mint),SP(Slightly Played),MP(Moderately Played),HP(Heavily Played) orPO(Poor), and absent for an index price (such as TCGLow) and for sealed products. TCGplayer calls SP Lightly Played and PO Damaged; each store's own scale is read into these five. -
qty(INT) is the copies the store's own listings in that condition hold, or on a buylist the copies the store buys. -
available(INT) is every copy in that condition on sale at the store at any price, where it is counted. - A missing
qtyoravailablemeans the store does not say, never zero; a missingqtyon a buylist means no limit. - With an id that groups several printings, such as
tcgormkm, a condition holds the best price and the summed quantities of all of them.
A missing store, card or price is left out of the response rather than sent empty.
{
"meta": {
"date": "STRING",
"version": "2",
"base_url": "STRING"
},
"retail": {
"STRING": {
"nonfoil": {
"STRING": [
{ "condition": "NM", "price": 0.0, "qty": 0 },
{ "condition": "SP", "price": 0.0, "qty": 0 }
],
"STRING": [
{ "condition": "NM", "price": 0.0, "available": 0 }
],
"STRING": [
{ "price": 0.0 }
]
},
"foil": {
"STRING": [
{ "condition": "NM", "price": 0.0, "qty": 0 }
]
}
}
},
"buylist": {}
}Cards are keyed by their MTGBAN id unless the id query parameter asks for another one:
| id value | description |
|---|---|
ban |
MTGBAN ids (the default) |
tcg |
TCGplayer product ids |
scryfall |
Scryfall ids |
mtgjson |
MTGJSON UUIDs |
mkm |
Cardmarket ids |
ck |
Card Kingdom ids |
name |
Card names |
ban and ck give each finish its own id, so a card's foil prices sit under a second id (<id>_f for MTGBAN ids). tcg, mkm and name can cover several printings with one id; their prices are then the best of all of them, with the quantities summed. With mkm, a card is keyed by the product Cardmarket prices it under, and by our card database's Cardmarket id only where Cardmarket does not price it, so it covers every game Cardmarket sells. Any other id value is an error.
Set vendor to one store tag, or several separated by commas, to get only those stores' prices. Only stores your signature can read are returned.
Set finish to one finish key, such as foil, to get only that finish's prices. It does not apply to sealed products.
The examples use https://mtgban.com, the Magic site; every game site serves the same endpoints for its own game.
Prices for a single edition. Set codes follow Scryfall's, and the sets endpoint lists the ones a game supports. Request retail, buylist, or all for both.
- https://mtgban.com/api/v2/retail/ZEN.json
- https://mtgban.com/api/v2/buylist/10E.json
- https://mtgban.com/api/v2/all/AER.json
The same for sealed products, with retail and buylist prices in a single call.
Prices for one card, every finish included. The card can be named by its MTGBAN id, MTGJSON UUID, Scryfall id or TCGplayer product id.
- https://mtgban.com/api/v2/retail/7da23b15-dfb8-4267-9b33-d7a4c035c434.json
- https://mtgban.com/api/v2/buylist/5a59d111-6137-5f00-8448-81269da4900d.json
Prices for the cards a search finds, with the same query syntax as the site's search. URL-encode the query, / included.
Cards are keyed by Scryfall id, and sealed products by MTGJSON UUID, unless id asks for another. A store, condition or price filter in the query narrows the prices returned as well as the cards.
[
"10E",
"2ED",
"2X2"
]Every set code with prices, to use in an edition snapshot. filter=sealed or filter=singles keeps only the sets with sealed products or with singles.
{
"sellers": [
{ "shorthand": "CT", "name": "Card Trader", "country": "EU", "quantities": true, "updated": "STRING" },
{ "shorthand": "TCGLow", "name": "TCG Low", "index": true, "updated": "STRING" }
],
"vendors": [
{ "shorthand": "CK", "name": "Card Kingdom", "quantities": true, "credit_multiplier": 1.3, "updated": "STRING" }
]
}-
shorthandis the store's tag in price lists, andnameits display name. -
indexmarks a store whose prices index a market, which carry nocondition;quantitiesa store whose prices carryqty. -
credit_multiplieris what a vendor's store credit is worth against its cash price, 1.3 for 30% more;updatedis when the store's prices were collected. - Only the stores you can read are listed.
filter=sealedorfilter=singleskeeps only the stores with sealed or singles prices.
[
{ "value": "nonfoil", "label": "Non-foil", "count": 0 },
{ "value": "foil", "label": "Foil", "count": 0 },
{ "value": "sealed", "label": "Sealed", "count": 0 }
]The finish keys the game's prices use, commonest first. count is how many cards carry the finish, or products for sealed, and filter keeps singles or sealed.
Every price your signature can read, for retail, buylist, or all:
- https://mtgban.com/api/v2/retail.json
- https://mtgban.com/api/v2/buylist.json
- https://mtgban.com/api/v2/all.json
Full snapshots are large, need a signature and only come as JSON. This endpoint is deprecated and should not be used; request editions or cards instead.
MTGBAN offers a free redirect to any store's page for a card: concatenate the response's meta.base_url, the store tag and the card id, which can be an MTGBAN id, MTGJSON UUID, Scryfall id or TCGplayer product id.
https://mtgban.com/go/CK/7da23b15-dfb8-4267-9b33-d7a4c035c434
Replace .json with .csv to get a CSV instead, for every endpoint but all and the full snapshots. The price CSV is the same as version 1's, one row per card and finish, and takes tag=names to name stores in full. It is meant to be read by people rather than parsed, and leaves out what a table cannot show.
Requests carry the sig query parameter, which grants the stores and modes (retail, buylist, sealed) your access level includes. Without one, edition, sealed and single card requests answer with a few demo stores, a search answers with no prices, and full snapshots are refused.
| code | description | action |
|---|---|---|
| 200 | Success | JSON or CSV is returned |
| 301 | Moved permanently | Request was made over an insecure channel, use https |
| 429 | Too many requests | Perform fewer requests at the same time |
| 502 | Bad gateway | Server starting, try again later |
| 503 | Service unavailable | Server loading, try again later |
A 200 response can still carry an error field; check it before reading prices.
Each user is granted a maximum of 10 requests per second.
- Version 2 search under
/api/v2/search/
- Version 2 under
/api/v2/: prices by finish and by condition, withqtyandavailable - Version 2's
stores.jsondescribes each store, andfinishes.jsonlists the finishes prices are keyed by - Version 2 takes no
tag: prices are keyed by store tag
- Added option to retrieve store names
- Removed compatibility layer for store names, now tags are provided by default
- You can set store name display style with
tagquery parameter. - Sealed and Index scrapers do not initialize the condition field to a constant "NM"
- New endpoint to retrieve available store keys
- The
quantitiesdictionary is available - The generic
condfield is available - Per-condition pricing requirements are relaxed
- New endpoint to retrieve available set codes
- The API supports reporting sealed prices
- Quantity and conditions query parameters are decoupled and can be requested at the same time.
- The condition dictionary for buylist data returns a full map, containing the
- It is possible to export data as csv.
- You can obtain condition prices from single card requests too.
- You can request data from a single vendor. The output will include per condition prices as available
- You can use TCG IDs in singles input requests
- You can request quantities available by setting
qty=truequery parameter (only available for selected vendors) - You can go to the vendor retail page by concatenating the
Metadata.BaseURL, the vendor tag, and the id/hash of the card
- Initial public version