This is version 6 of the API. Please see here for the latest version.
This is currently the latest API version (v6).
NOTE ON IMAGES: Do not download images directly from this site. Doing so will result in an IP blacklist. Please read this guide on where to download images.
Upgrade Note: Please read through the documentation before upgrading to v6. The back-end has been completely overhauled and optimized. In theory, your code should continute to work by simply upgrading to v6 but I encourage running tests first.
Older Versions
API Changelog v6.0.1 (last update 16th February 2020):
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.
The Card Information endpoint is available at https://db.ygoprodeck.com/api/v6/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:
&fname=Magician
to search by all cards with "Magician" in the name.You can also use the following equation symbols for atk, def and level:
"lt" (less than), "lte" (less than equals to), "gt" (greater than), "gte" (greater than equals to).
Examples: atk=lt2500 (atk is less than 2500), def=gte2000 (def is greater than or equal to 2000) and level=lte8 (level is less than or equal to 8).
The specific results from this endpoint are cached for 2 days (172800 seconds) but will be manually cleared upon new card entry.
Response Information:
Monster Cards
Spell/Trap Cards
Card Archetype
Additional Response for Pendulum Monsters
Additional Response for Link Monsters
Card Sets
Card Images
https://db.ygoprodeck.com/api/v6/cardinfo.php?name=Decode%20Talker
Card Prices
Banlist Info
Misc Information Returned:
If a piece of response info is empty or null then it will NOT show up. For example, Link Monsters have no DEF, Level or Scale value so those values will not be returned.
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/v6/cardinfo.php
Get "Dark Magician" card information
https://db.ygoprodeck.com/api/v6/cardinfo.php?name=Dark Magician
Get all cards belonging to "Blue-Eyes" archetype
https://db.ygoprodeck.com/api/v6/cardinfo.php?archetype=Blue-Eyes
Get all Level 4/RANK 4 Water cards and order by atk
https://db.ygoprodeck.com/api/v6/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/v6/cardinfo.php?banlist=tcg&level=4&sort=name
Get all Dark attribute monsters from the Metal Raiders set
https://db.ygoprodeck.com/api/v6/cardinfo.php?set=metal%20raiders&attribute=dark
Get all cards with "Wizard" in their name who are LIGHT attribute monsters with a race of Spellcaster
https://db.ygoprodeck.com/api/v6/cardinfo.php?fname=Wizard&attribute=light&race=spellcaster
Get all Spell Cards that are Equip Spell Cards
https://db.ygoprodeck.com/api/v6/cardinfo.php?type=spell%20card&race=equip
Get all Speed Duel Format Cards
https://db.ygoprodeck.com/api/v6/cardinfo.php?format=Speed Duel
Get all Water Link Monsters who have Link Markers of "Top" and "Right"
https://db.ygoprodeck.com/api/v6/cardinfo.php?attribute=water&type=Link%20Monster&linkmarker=top,bottom
Get Card Information while also using the misc parameter
https://db.ygoprodeck.com/api/v6/cardinfo.php?name=Tornado%20Dragon&misc=yes
https://db.ygoprodeck.com/api/v6/cardinfo.php?staple=yes
Parameter "Race" values:
Monster Cards
Spell Cards
Trap Cards
Parameter "Type" values:
Main Deck Types
Extra Deck Types
Users who pull our card images directly from our server instead of our google cloud repository will be immediately blacklisted.
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
and are within the card_images
array.
Alternative artwork (if available) will also be listed within the card_images
array.
Since v3: Card images are now properly returned without slashes being incorrectly escaped as it was with v2.
The Random Card endpoint can be found at https://db.ygoprodeck.com/api/v6/randomcard.php
.
This follows the same rate limiting procedures as the card lookup endpoint.
Cache Control is disabled for this endpoint so it should always provide a fresh card.
If any GET parameters are found in the call, then it will return an error.
The Card Sets endpoint can be found at https://db.ygoprodeck.com/api/v6/cardsets.php
.
This follows the same rate limiting procedures as the card lookup endpoint.
This simply returns all of the current Yu-Gi-Oh! Card Set Names we have stored in the database.
This contains the following response info: Set Name, Set Code, Number of Cards and TCG Date (Release Date).
Use this to get a quick snapshot of all the Yu-Gi-Oh! Card Sets sorted by A-Z.
If any GET parameters are found in the call, then it will return an error.
The Card Sets Information endpoint can be found at https://db.ygoprodeck.com/api/v6/cardsetsinfo.php
.
This requires a parameter of "setcode".
Example usage: https://db.ygoprodeck.com/api/v6/cardsetsinfo.php?setcode=SDY-046
This follows the same rate limiting procedures as the card lookup endpoint.
This returns the following information: id, name, set_name, set_code, set_rarity and set_price (in $).
If no (or invalid) GET parameters are found in the call, then it will return an error.
The Card Archetypes endpoint can be found at https://db.ygoprodeck.com/api/v6/archetypes.php
.
This follows the same rate limiting procedures as the card lookup endpoint.
This simply returns all of the current Yu-Gi-Oh! Card Archetype Names we have stored in the database.
Use this to get a quick snapshot of all the Yu-Gi-Oh! Card Archtypes sorted by A-Z.
If any GET parameters are found in the call, then it will return an error.
The main features of v3 is more thorough error checking.
All error codes now return a correct 400 response header.
Almost every parameter will now return an error code if an invalid value is passed to it (as opposed to ignoring it and returning all cards like in previous versions). The user will also be prompted on all the correct possible values to pass so they aren't left guessing.
Here is an example of an invalid value sent through the attribute parameter: https://db.ygoprodeck.com/api/v6/cardinfo.php?type=Effect%20Monster&attribute=wood&num=2
The response returned: {"error":"Attribute value of wood is invalid. Please use a correct attribute value. Attribute accepts 'dark', 'earth', 'fire', 'light', 'water', 'wind' or 'divine' and is not case sensitive."}
The only way to return all cards now is by having 0 parameters in the request: https://db.ygoprodeck.com/api/v6/cardinfo.php
. If invalid parameters are sent, an error will also be returned.
This should save users bandwidth on receiving large requests when requesting malformed urls.
The following is a list of sites/services that make use of our API and have allowed us to showcase them. Check them out!