Chapter 05

/cards/:id [GET] API(v1)

nukokoi
nukokoi
2022.10.09に更新

/cards/:id

id または multiverseid で指定されたカードを返す。

サンプルコード

  • ruby
ruby
require 'mtg_sdk'

card = MTG::Card.find(386616)
  • python
python
from mtgsdk import Card

card = Card.find(386616)
  • javascript
javascript
const mtg = require('mtgsdk')

mtg.card.find(386616)
.then(result => {
    console.log(result.card.name)
})
  • bash
bash
curl "https://api.magicthegathering.io/v1/cards/386616"

レスポンス

レスポンス
{  
  "card":{  
    "name":"Narset, Enlightened Master",
    "manaCost":"{3}{U}{R}{W}",
    "cmc":6,
    "colors":[  
      "White",
      "Blue",
      "Red"
    ],
    "type":"Legendary Creature — Human Monk",
    ...
  }
}