Obtenir une carte spécifique
Requête
$card = $tcgdex->fetchCard('swsh3-136');
const card = await tcgdex.fetch('cards', 'swsh3-136');
const card = await tcgdex.fetch('cards', 'swsh3-136');
Card card = tcgdex.fetchCard("swsh3-136");
val card = tcgdex.fetchCard("swsh3-136")
https://api.tcgdex.net/v2/fr/cards/swsh3-136
Réponse
Réponse 200
La requête retourne un objet de carte
{ "category": "Pokémon", "id": "swsh3-136", "illustrator": "tetsuya koizumi", "image": "https://assets.tcgdex.net/fr/swsh/swsh3/136", "localId": "136", "name": "Fouinar", "rarity": "Peu Commune", "set": { "cardCount": { "official": 189, "total": 201 }, "id": "swsh3", "logo": "https://assets.tcgdex.net/fr/swsh/swsh3/logo", "name": "Ténèbres Embrasées", "symbol": "https://assets.tcgdex.net/univ/swsh/swsh3/symbol" }, "variants": { "firstEdition": false, "holo": false, "normal": true, "reverse": true, "wPromo": false }, "hp": 110, "types": [ "Incolore" ], "evolveFrom": "Fouinette", "stage": "Niveau 1", "attacks": [ { "cost": [ "Incolore" ], "name": "Mode Cool", "effect": "Piochez 3 cartes." }, { "cost": [ "Incolore" ], "name": "Éclate-Queue", "effect": "Lancez une pièce. Si c'est pile, cette attaque ne fait rien.", "damage": 90 } ], "weaknesses": [ { "type": "Combat", "value": "×2" } ], "retreat": 1, "regulationMark": "D", "legal": { "standard": false, "expanded": true }, "updated": "2021-10-26T10:40:03+02:00"}
Réponse 404
La carte n’a pas été trouvée :( elle renverra un message d’erreur global (non traduit)
{ "error": "Endpoint or id not found"}