API

    Mock Server

    Use this URL to access a mockup of the API server. Your traffic will be recorded and compared to the documentation. You'll find your traffic analysis in the inspector or directly here in the documentation, right next to each resource.

MTG API

MTG API is a database of Magic The Gathering TCG

Card Collection

List all Cards

GET

/cards.json

Response

200 (OK)
Content-Type: application/json
{
    "meta" : {},
    "objects" : [{

        "card_ID": 378490,
        "card_converted_cost": 1,
        "card_flavor_text": "If the hierarchies of nature were determined by ferocity alone, the badger would be lord of the beasts. --Anthousa of Setessa",
        "card_loyalty": null,
        "card_mana_cost": "{G}",
        "card_name": "Charging Badger",
        "card_power": 1.0,
        "card_price": 0.14,
        "card_rarity": "C",
        "card_setID": "BNG",
        "card_setID_id": 97,
        "card_subtype": "Badger",
        "card_subtype_id": 3176,
        "card_text": "Trample",
        "card_toughness": 1.0,
        "card_type": "Creature",
        "card_type_id": 181

    },{

        "card_ID": 373500,
        "card_converted_cost": 3,
        "card_flavor_text": "",
        "card_loyalty": 3,
        "card_mana_cost": "{1}{U}{B}",
        "card_name": "Ashiok, Nightmare Weaver",
        "card_power": 0.0,
        "card_price": 8.14,
        "card_rarity": "M",
        "card_setID": "THS",
        "card_setID_id": 106,
        "card_subtype": "Ashiok",
        "card_subtype_id": 3160,
        "card_text": "+2: Exile the top three cards of target opponents library. -X: Put a creature card with converted mana cost X exiled with Ashiok, Nightmare Weaver onto the battlefield under your control. That creature is a Nightmare in addition to its other types. -10: Exile all cards from all opponents hands and graveyards.",
        "card_toughness": 0.0,
        "card_type": "Planeswalker",
        "card_type_id": 183

    },{

        "card_ID": 136142,
        "card_converted_cost": 2,
        "card_flavor_text": "",
        "card_loyalty": null,
        "card_mana_cost": "{1}{G}",
        "card_name": "Tarmogoyf",
        "card_power": -1.0,
        "card_price": 190.38,
        "card_rarity": "R",
        "card_setID": "FUT",
        "card_setID_id": 99,
        "card_subtype": "Lhurgoyf",
        "card_subtype_id": 3073,
        "card_text": "Tarmogoyfs power is equal to the number of card types among cards in all graveyards and its toughness is equal to that number plus 1.",
        "card_toughness": -2.0,
        "card_type": "Creature",
        "card_type_id": 181
    }]
}

Card

A single Card object with all its details

Retrieve a Card

GET

/cards/{id}.json

Response

200 (OK)
Content-Type: application/json
{
    "card_ID": 378373,
    "card_converted_cost": 2,
    "card_flavor_text": "",
    "card_loyalty": null,
    "card_mana_cost": "{1}{W}",
    "card_name": "Acolytes Reward",
    "card_power": 0.0,
    "card_price": 0.21,
    "card_rarity": "U",
    "card_setID": "BNG",
    "card_setID_id": 97,
    "card_subtype": null,
    "card_subtype_id": null,
    "card_text": "Prevent the next X damage that would be dealt to target creature this turn, where X is your devotion to white. If damage is prevented this way, Acolytes Reward deals that much damage to target creature or player. (Each {W} in the mana costs of permanents you control counts toward your devotion to white.)",
    "card_toughness": 0.0,
    "card_type": "Instant",
    "card_type_id": 174
}

Set Collection

List all Sets

GET

/sets.json

Response

200 (OK)
Content-Type: application/json
{
    "meta": {},
    "objects": [
        {
            "set_ID": "BNG",
            "set_name": "Born of the Gods",
            "set_num_cards": 165,
            "set_release_date": "2014-02-07"
        },
        {
            "set_ID": "DGM",
            "set_name": "Dragon''s Maze",
            "set_num_cards": 142,
            "set_release_date": "2013-05-03"
        },
        {
            "set_ID": "FUT",
            "set_name": "Future Sight",
            "set_num_cards": 180,
            "set_release_date": "2007-05-04"
        }
    ]
}

Set

A single Set object with all its details and cards in it

Retrieve a Set

GET

/sets/{id}.json

Response

200 (OK)
Content-Type: application/json
{
    "set_ID" : "BNG",
    "set_name" : "Born of the Gods",
    "set_release_date" :"02/2014",
    "set_num_cards" : 165,
    "set_cards" : [378373, 378402, 378459, 378374, 378375, 378403, 378460, 378376, 378488, 378430, 378404, 378431, 378489, 378432, 378529, 378433, 378434, 378461, 378377, 378435, 378490, 378405, 378516, 378436, 378491, 378406, 378492, 378462, 378378, 378407, 378408, 378437, 378438, 378379, 378380, 378517, 378518, 378381, 378463, 378409, 378410, 378464, 378382, 378439, 378465, 378519, 378440, 378466, 378411, 378493, 378383, 378441, 378467, 378442, 378468, 378469, 378412, 378413, 378470, 378443, 378444, 378384, 378445, 378385, 378386, 378530, 378494, 378387, 378388, 378446, 378447, 378389, 378495, 378531, 378390, 378496, 378471, 378520, 378497, 378521, 378522, 378472, 378414, 378473, 378391, 378448, 378415, 378416, 378498, 378523, 378392, 378499, 378449, 378500, 378501, 378502, 378417, 378450, 378474, 378393, 378418, 378503, 378451, 378475, 378419, 378394, 378395, 378452, 378504, 378420, 378476, 378524, 378505, 378506, 378532, 378477, 378396, 378525, 378507, 378526, 378478, 378421, 378397, 378479, 378453, 378480, 378481, 378508, 378509, 378482, 378483, 378454, 378510, 378511, 378455, 378398, 378422, 378527, 378533, 378512, 378513, 378423, 378399, 378456, 378534, 378484, 378424, 378425, 378400, 378514, 378535, 378536, 378537, 378426, 378485, 378486, 378427, 378515, 378401, 378428, 378457, 378458, 378429, 378487, 378528]
}

Type Collection

List all Types

GET

/types.json

Response

200 (OK)
Content-Type: application/json
{
    "meta" : {},
    "objects" : [{

        "type_name" : "Enchant Creature",
        "type_description" : "Enchantment creatures were introduced on a futureshifted card in Future Sight: Lucent Liminid. They later reappeared as a fullfledged mechanic in the Theros set, where they represent the gods themselves , and their emissaries (creatures with bestow). The enchantment creatures were highlighted in the following set, which was named after them: Born of the Gods. These had all global enchantment effects.",

    },{

        "type_name" : "Interrupts",
        "type_description" : "Interrupt is an obsolete card type. It has not been supported by the game since Sixth Edition. Under the original rules, an interrupt was a spell that would resolve before the rest of the Batch. Some examples of interrupts include Counterspell, Red Elemental Blast and Dark Ritual. All Interrupt cards have received errata to make them instants, and all references to Interrupts have been given errata to reference instants.",

    },{

        "type_name" : "Basic Land",
        "type_description" : "These lands are unlike nonbasic lands in that any number may be included in a deck. There are basic lands for each color — Plains, Island, Swamp, Mountain, and Forest for white, blue, black, red, and green, respectively. Each basic land has the basic land type of the same name; e.g., Plains have the Plains land type.
        Basic lands are thought of as the cornerstones of Magic design, and no lands should be printed if they are strictly better than basic lands, with the sole exception to this rule being the dual lands from Alpha/Beta/Unlimited/Revised. Consequently, other, nonbasic lands feature drawbacks, in addition to the fact that no more than four copies of nonbasic lands may be played in a deck.",

    }]
}

Type

A single Type object with all its details and subtypes

Retrieve a Type

GET

/types/{type_name}.json

Response

200 (OK)
Content-Type: application/json
{
    "type_name" : "Enchantment Creature",
    "type_description" : "Enchantment creatures were introduced on a futureshifted card in Future Sight: Lucent Liminid. They later reappeared as a fullfledged mechanic in the Theros set, where they represent the gods themselves , and their emissaries (creatures with bestow). The enchantment creatures were highlighted in the following set, which was named after them: Born of the Gods. These had all global enchantment effects.",
    "type_subtypes" : ["Wolf","Gorgon","Human Wizard","Human Cleric","Minotaur","Human Warrior","Sheep","Beast","Cat","Nymph Dryad","Lamia","Merfolk","Nymph","Giant","Siren","Zombie","Chimera","Archon","Elemental","Crab","Human Soldier","Unicorn","Hag","Manticore","Hound","Horror","Centaur","Demon","Spider","Snake","Ox","Spirit","Elk","Satyr","Insect","Cyclops","Boar","Nautilus"]
}

Subtype Collection

List all Subtypes

GET

/subtypes.json

Response

200 (OK)
Content-Type: application/json
{
    "meta": {},
    "objects": [
        {
            "subtype_name": "Beast Mutant"
        },
        {
            "subtype_name": "Goblins"
        },
        {
            "subtype_name": "Kithkin Rebel"
        },
        {
            "subtype_name": "Xenagos"
        },
        {
            "subtype_name": "Hydra"
        }
    ]
}

Subtype

A single Subtype object with all its details and supertypes

Retrieve a Subtype

GET

/subtypes/{subtype_name}.json

Response

200 (OK)
Content-Type: application/json
{
    "subtype_name" : "Beast",
    "subtype_supertypes" : ["Artifact Creature", "Creature", "Enchantment Creature", "Summon"]
}