Magic The Gathering API
Overview
The Magic: The Gathering API provides detailed data on every MTG card ever printed, including set information, card text, mana costs, and legality in different formats. It requires no API key and returns JSON data about cards, sets, and game mechanics. This is a go-to resource for developers building deck builders, collection trackers, or card search tools.
Beginner Tip
Fetch a single card by name using the ?name= query parameter to explore the response structure before building complex queries. The API paginates results, so look for the Link header in the response to navigate through pages.
Available Data
Example Response
{
"id": 1,
"name": "Magic The Gathering",
"data": "Magic The Gathering Game Information",
"source": "Magic The Gathering"
} Field Reference
name The English card name as printed on the physical card manaCost Mana cost string using symbols like {W},{U},{B},{R},{G},{X} for colors and generic mana cmc Converted mana cost — the total mana value used for deck-building and format legality checks type Full type line including supertype, type, and subtype (e.g. Legendary Creature — Dragon) text The oracle text of the card describing its abilities and rules legalities List of objects indicating which game formats the card is Legal, Banned, or Restricted in Implementation Example
const url = "http://magicthegathering.io/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
Common Errors & Troubleshooting
Matrix Score Breakdown
Fully tested on Apr 5, 2026
Technical Specifications
Related Tags
Similar APIs
View All →Age of Empires II
Age of Empires II provides programmatic access to get information about age of empires ii resources via REST API.
AmiiboAPI
AmiiboAPI provides programmatic access to nintendo amiibo information via REST API.
Animal Crossing: New Horizons
⭐ Beginner's PickThe Animal Crossing: New Horizons API gives you free access to in-game data including villagers, critters, fossils, art, music, and furniture.
Autochess VNG
The Autochess VNG API provides game data for the Autochess VNG mobile game including heroes, items, and races.
Barter.VG
Barter.VG aggregates data about PC games, DLC, bundles, giveaways, and trading from Steam and other platforms.