Wizards of the Coast · since 1993
Magic: The Gathering API
Oracle text, mana costs, colour identity, every frame variant and all twenty-plus format legalities.
- 32,460
- Cards
- 108,500
- Printings
- 812
- Sets
- 11
- Languages
Overview
What the Magic dataset covers
Magic: The Gathering invented the trading card game and still leads the market by total dollar value. TCGGraph exposes canonical Oracle text, mana value, colour identity, type lines, keyword abilities and legality across Standard, Pioneer, Modern, Legacy, Vintage, Commander and Pauper — plus every finish, frame effect and promo treatment as an addressable printing with its own price series.
Sourced from Scryfall bulk data, Gatherer Oracle updates and TCGplayer.
Formats
- Standard
- Pioneer
- Modern
- Legacy
- Vintage
- Commander
- Pauper
- Brawl
- Alchemy
- Historic
Price sources
- TCGplayer
- Cardmarket
- Card Kingdom
- eBay sold
curl -G "https://api.tcggraph.com/v1/cards" \
-d game=magic-the-gathering \
-d limit=5 \
-H "Authorization: Bearer $TCGGRAPH_KEY"{
cards(
game: MAGIC
filter: {
colorIdentity: ["U", "R"]
manaValue: { lte: 3 }
format: COMMANDER
}
first: 10
) {
nodes {
name
magic { manaCost typeLine oracleText }
}
}
}Schema
Magic-specific fields
Every card carries the shared core fields. These live under gameData in REST, and under the typed magic field in GraphQL.
| Field | Type | Description |
|---|---|---|
| manaCost | String | Mana cost in symbol notation, e.g. {2}{U}{U}. |
| manaValue | Float | Converted mana cost. |
| colors | [String] | Colours in the mana cost. |
| colorIdentity | [String] | Commander-legal colour identity. |
| typeLine | String | Full type line including supertypes and subtypes. |
| oracleText | String | Current Oracle rules text. |
| power | String | Creature power. May be a character such as *. |
| toughness | String | Creature toughness. May be a character such as *. |
| loyalty | String | Starting loyalty for planeswalkers. |
| keywords | [String] | Parsed keyword abilities. |
| layout | Enum | normal, transform, modal_dfc, split, adventure, saga… |
| finishes | [String] | nonfoil, foil, etched or glossy. |
| legalities | Object | Per-format legal, not_legal, restricted or banned. |
Plus 21 core fields shared by every game — see the full reference.
Live data
Magic cards in the public dataset
Real records returned by the API right now, sorted by market value, with both the American and the European quote.
| Card | Set | Number | Rarity | TCGplayer | Cardmarket |
|---|---|---|---|---|---|
| Gaea's Cradle | Urza's Saga | 321 | Rare | $1,637 | €1,220 |
| Sheoldred, the Apocalypse | Dominaria United | 107 | Mythic | $98.04 | €79.81 |
| Force of Will | Dominaria Remastered | 50 | Mythic | $60.39 | €52.11 |
| Ragavan, Nimble Pilferer | Modern Horizons 2 | 138 | Mythic | $42.97 | €31.76 |
| Snapcaster Mage | Innistrad Remastered | 478 | Mythic | $16.90 | €14.68 |
| Tarmogoyf | Time Spiral Remastered | 235 | Mythic | $5.26 | €4.26 |
| Sol Ring | Marvel Super Heroes Commander | 211 | Uncommon | $1.56 | €1.38 |
| Lightning Bolt | Marvel Super Heroes Commander | 806 | Uncommon | $0.71 | €0.66 |
The European market for Magic
Cardmarket is the largest Magic singles market outside the United States, and for European-language cards it is effectively the only liquid one. Italian Legends and German Revised have their own collector base and their own price curve; converting a TCGplayer number will not get you close.
Traded on Cardmarket in German, French, Italian, Spanish, Portuguese, Russian beyond English. How European pricing works.
Sets
Notable Magic sets
LEA
Limited Edition Alpha
295 cards · 1993-08-05
USG
Urza's Saga
350 cards · 1998-10-12
MH3
Modern Horizons 3
303 cards · 2024-06-14
FIN
Final Fantasy
309 cards · 2025-06-13
SPM
Marvel's Spider-Man
286 cards · 2025-09-26
Modelling
Working with Magic data
The decisions that catch people out when they first integrate Magic. Each of these is a bug we have watched somebody ship.
Oracle text, not printed text
The words on the cardboard go stale — templating changes, keywords get renamed, and errata land without a reprint. Oracle text is the current authoritative wording and is what judges play by. We return oracle text by default and keep the printed text alongside it for anyone rendering a faithful card image.
Colour identity is not colour
A card's colours come from its mana cost. Its colour identity also includes mana symbols in the rules text, which is what Commander deckbuilding actually uses. A card with no coloured mana in its cost can still be off-limits in a mono-white deck. Filter on colorIdentity for Commander and colors for everything else.
One name, two objects
Lightning Bolt has been printed dozens of times. The oracle id identifies the card as a rules object; the printing id identifies one physical version with its own art, set, collector number and price. Deck lists key on oracle id, collection trackers and price tools key on printing id.
Multi-faced cards nest their data
Transforming, split, adventure, modal double-faced and flip cards carry their real content in faces[]. Top-level manaCost, power and toughness may be null on those cards. Always read through faces when they are present rather than assuming the flat shape.
Recipes
Common Magic queries
Three requests that cover most of what applications in this game actually ask for.
Commander staples under three mana
Deck builders combine colour identity, mana value and format legality in a single filter.
colorIdentity is a subset match, so this returns mono-blue and mono-red cards too.
GET /v1/cards
?game=magic-the-gathering
&colorIdentity=U,R
&maxManaValue=3
&format=commander
&sort=edhrecRank:ascThe cheapest printing of a card
Price tools want the least expensive legal copy across every set it has appeared in.
Querying by oracleId returns every printing; sorting by market price gives you the floor.
GET /v1/cards
?game=magic-the-gathering
&oracleId=4457ed35-7c10-48c8-9776-456485fdf070
&include=prices
&sort=prices.market:asc
&limit=1Watch for bans and unbans
Legality changes on announcement day, not on set release. Subscribe instead of polling.
One signed request per change, rather than re-reading the whole catalogue every night.
POST /v1/webhooks
{
"url": "https://yourapp.com/hooks/tcggraph",
"events": ["card.legality.changed"],
"filter": { "game": "magic-the-gathering" }
}Glossary
Magic terms, and the fields that hold them
What players call a thing on the left, what you query on the right.
| Term | Field | Notes |
|---|---|---|
| Mana value | magic.manaValue | Formerly converted mana cost. X counts as zero on the stack and in the API. |
| Colour identity | magic.colorIdentity[] | Colours in cost and rules text. What Commander legality is checked against. |
| Type line | magic.typeLine | Full printed line, em dash included. Parsed forms are in types and subtypes. |
| Oracle id | magic.oracleId | Stable across every printing. The right key for a deck list. |
| Faces | magic.faces[] | Present on double-faced, split, adventure and flip cards. |
| Power / Toughness | magic.power | String, not integer — it can be *, 1+*, or an em dash on non-creatures. |
| Finish | finish | nonfoil, foil or etched. Each finish is priced separately. |
FAQ
Magic API questions
Anything not covered here, email hello@tcggraph.com and a human who knows Magic answers.
Also available
Add another game without another integration
Your Magic key already works for every other game in the catalog. Change the MAGIC_THE_GATHERING enum and the rest of your code stays as it is.