Home Advanced Syntax Random YGOPRODeck

Yu-Gi-Oh! API Guide - YGOPRODECK

Yu-Gi-Oh! API by YGOPRODeck

This is currently the latest API version (v2). For v1 information please see here.

Our Yu-Gi-Oh! API is now available for public consumption. Below are the details on how to use the API and what kind of response is to be expected from the API.

Please download and store all data pulled from this API locally to keep the amount of API calls used to a minimum. Failure to do so may result in either your IP address being blacklisted or the API being rolled back.

Rate Limiting on the API is enabled. The rate limit is 20 requests per 1 second. If you exceed this, you are blocked from accessing the API for 1 hour. We will monitor this rate limit for now and adjust accordingly.

Our API responses are cached on our side. The cache timings will be given below. These are subject to change.


While our API is and always will be completely free to use, please consider white-listing YGOPRODeck.com on your adblocker.

Get Card Information

The Card Information endpoint is available at https://db.ygoprodeck.com/api/v2/cardinfo.php

This is the only endpoint that is now needed. You can pass multiple paramters to this endpoint to filter the information retrieved.

The following endpoint parameters can be passed:

  • name - The exact name of the card. You can also pass a card ID to this.
  • fname - A fuzzy search using a string. For example &fname=Magician to search by all cards with "Magician" in the name.
  • type - The type of card you want to filter by. See below "Card Types Returned" to see all available types.
  • atk - Filter by atk value.
  • def - Filter by def value.
  • level - Filter by card level/RANK.
  • race - Filter by the card race which is officially called type (Spellcaster, Warrior, Insect, etc). This is also used for Spell/Trap cards (see below).
  • attribute - Filter by the card attribute.
  • link - Filter the cards by Link value.
  • linkmarker - Filter the cards by Link Marker value (Top, Bottom, Left, Right, Bottom-Left, Bottom-Right, Top-Left, Top-Right).
  • scale - Filter the cards by Pendulum Scale value.
  • set - Filter the cards by card set (Metal Raiders, Soul Fusion, etc).
  • archetype - Filter the cards by archetype (Dark Magician, Prank-Kids, Blue-Eyes, etc).
  • banlist - Filter the cards by banlist (TCG, OCG, Goat).
  • sort - Sort the order of the cards (atk, def, name, type, level, id, new).
  • la - Filter the cards by Language (See Languages below).

The specific results from this endpoint are cached for 2 days (172800 seconds) but will be manually cleared upon new card entry.

Response Information:

  • id - ID or Passocde of the card.
  • name - Name of the card.
  • desc - Card description/effect.
  • atk - The ATK value of the card.
  • def - The DEF value of the card.
  • type* - The type of card you are viewing (Normal Monster, Spell Card, Trap Card, etc)
  • level - The Level/RANK of the card.
  • race - The card race which is officially called type (Spellcaster, Warrior, Insect, etc)
  • attribute - The attribute of the card.
  • scale - The Pendulum Scale Value (only Pendulum monsters will have a scale value, otherwise NULL).
  • linkval - The Link Value of the card if it's of type "Link Monster".
  • linkmarkers - The Link Markers of the card if it's of type "Link Monster".
  • archetype - The Archetype that the card belongs to. We take feedback on Archetypes here.
  • set_tag - Every Card Set code number this card belongs to.
  • setcode - Every Card Set this card belongs to.
  • ban_tcg - The status of the card on the TCG Ban List.
  • ban_ocg - The status of the card on the OCG Ban List.
  • ban_goat - The status of the card on the GOAT Format Ban List.
  • image_url - The URL for the image.
  • image_url_small - The URL for a smaller sized version of the image.

We are working on to soon include price data as part of the response information.


Decode Talker API Response


Example Usage

The following is a list of examples you can do using the possible endpoint parameters shown above.

    Get all cards

  • https://db.ygoprodeck.com/api/v2/cardinfo.php
  • Get "Dark Magician" card information

  • https://db.ygoprodeck.com/api/v2/cardinfo.php?name=Dark Magician
  • Get all cards belonging to "Blue-Eyes" archetype

  • https://db.ygoprodeck.com/api/v2/cardinfo.php?archetype=Blue-Eyes
  • Get all Level 4/RANK 4 Water cards and order by atk

  • https://db.ygoprodeck.com/api/v2/cardinfo.php?level=4&attribute=water&sort=atk
  • Get all cards on the TCG Banlist who are level 4 and order them by name (A-Z)

  • https://db.ygoprodeck.com/api/v2/cardinfo.php?banlist=tcg&level=4&sort=name
  • Get all Dark attribute monsters from the Metal Raiders set

  • https://db.ygoprodeck.com/api/v2/cardinfo.php?set=metal%20raiders&attribute=dark
  • Get all cards with "Wizard" in their name who have are LIGHT attribute monsters with a race of Spellcaster

  • https://db.ygoprodeck.com/api/v2/cardinfo.php?fname=Wizard&attribute=light&race=spellcaster
  • Get all Spell Cards that are Equip Spell Cards

  • https://db.ygoprodeck.com/api/v2/cardinfo.php?type=spell%20card&race=equip
  • Get "Dark Magician" card information using his ID in the French language

  • https://db.ygoprodeck.com/api/v2/cardinfo.php?name=46986414&la=french

TCG Ban List Response


Endpoint Information + Languages

Parameter "Race" values:

    Monster Cards

  • Aqua
  • Beast
  • Beast-Warrior
  • Creator-God
  • Cyberse
  • Dinosaur
  • Divine-Beast
  • Dragon
  • Fairy
  • Fiend
  • Fish
  • Insect
  • Machine
  • Plant
  • Psychic
  • Pyro
  • Reptile
  • Rock
  • Sea Serpent
  • Spellcaster
  • Thunder
  • Warrior
  • Winged Beast
  • Spell Cards

  • Normal
  • Field
  • Equip
  • Continuous
  • Quick-Play
  • Ritual
  • Trap Cards

  • Normal
  • Continuous
  • Counter

Parameter "Type" values:

    Main Deck Types

  • "Effect Monster"
  • "Flip Effect Monster"
  • "Flip Tuner Effect Monster"
  • "Gemini Monster"
  • "Normal Monster"
  • "Normal Tuner Monster"
  • "Pendulum Effect Fusion Monster"
  • "Pendulum Effect Monster"
  • "Pendulum Flip Effect Monster"
  • "Pendulum Normal Monster"
  • "Pendulum Tuner Effect Monster"
  • "Ritual Effect Monster"
  • "Ritual Monster"
  • "Skill Card"
  • "Spell Card"
  • "Spirit Monster"
  • "Toon Monster"
  • "Trap Card"
  • "Tuner Monster"
  • "Union Effect Monster"
  • "Union Tuner Effect Monster"
  • Extra Deck Types

  • "Fusion Monster"
  • "Link Monster"
  • "Synchro Monster"
  • "Synchro Pendulum Effect Monster"
  • "Synchro Tuner Monster"
  • "XYZ Monster"
  • "XYZ Pendulum Effect Monster"

Languages:

Our API only officially supports English as a response language but we are adding unofficial languages bit by bit. What do we mean by unofficial? Translations may not be accurate and card information may be out of date.

The other language APIs are essentially used to have a foundation of what you want to build. Please do not email or contact us about adding languages or to continually update other language information.

Currently Supported Languages:

  • English (Official)
  • French

Metal Raiders Set Response


Card Images

Card images can be pulled from our Google Cloud server but please only pull an image once and then store it locally. If we find you are pulling a very high volume of images per second then your IP will be blacklisted and blocked.

Our card images are in .jpg format and are web optimized.

All of our cloud URLs will either be https://storage.googleapis.com/ygoprodeck.com/pics/ or https://storage.googleapis.com/ygoprodeck.com/pics_small/. You pass the ID of the card to retrieve the image.

Example Limit Reverse Card Image: https://storage.googleapis.com/ygoprodeck.com/pics/27551.jpg

The image URLs are found within the JSON response as both image_url and image_url_small.


Card Images