How to hit the Magic: The Gathering API

magicthegathering.io at https://api.magicthegathering.io/v1 lists Magic cards and sets, filterable by name, color, type, and more.

Authentication

None — no key, no signup. Every example runs as-is.

Full reference: https://docs.magicthegathering.io/

Search cards

curl "https://api.magicthegathering.io/v1/cards?name=black%20lotus&pageSize=1"
Run in PostTaco
Example response (trimmed)
{
  "cards": [
    {
      "name": "Black Lotus",
      "manaCost": "{0}",
      "cmc": 0,
      "type": "Artifact",
      "types": [
        "Artifact"
      ],
      "rarity": "Rare",
      "set": "2ED",
      "setName": "Unlimited Edition",
      "text": "{T}, Sacrifice Black Lotus: Add three mana of any one color.",
      "artist": "Christopher Rush",
      "number": "233",
      "layout": "normal",
      "multiverseid": "600",
      "imageUrl": "http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=600&type=card",
      "printings": [
        "2ED",
        "30A"
      ]
    }
  ]
}

List sets

curl "https://api.magicthegathering.io/v1/sets?pageSize=2"
Run in PostTaco
Example response (trimmed)
{
  "sets": [
    {
      "code": "10E",
      "name": "Tenth Edition",
      "type": "core",
      "releaseDate": "2007-07-13",
      "block": "Core Set",
      "onlineOnly": false
    },
    {
      "code": "2ED",
      "name": "Unlimited Edition",
      "type": "core",
      "booster": [
        "rare",
        "uncommon"
      ],
      "releaseDate": "1993-12-01",
      "block": "Core Set",
      "onlineOnly": false
    }
  ]
}