YGOPRODeck Yu-Gi-Oh! API
db.ygoprodeck.com · Media
Complete Yu-Gi-Oh! card database — 14,000+ cards with stats, types, archetypes, sets, prices, and artwork. Free, no API key required.
Authentication
No authentication requiredFree to use with no key needed.
Sample Requests
GET
Search cards
Search for Dark Magician cards.
https://db.ygoprodeck.com/api/v7/cardinfo.php?num=3&fname=Dark Magician&offset=0
Hover any highlighted part to learn what it does
curl -X GET "https://db.ygoprodeck.com/api/v7/cardinfo.php?num=3&fname=Dark%20Magician&offset=0"
import requests
params = {
"num": "3",
"fname": "Dark Magician",
"offset": "0"
}
response = requests.get(
"https://db.ygoprodeck.com/api/v7/cardinfo.php",
params=params,
)
print(response.json())const url = new URL('https://db.ygoprodeck.com/api/v7/cardinfo.php');
url.searchParams.set('num', '3');
url.searchParams.set('fname', 'Dark Magician');
url.searchParams.set('offset', '0');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://db.ygoprodeck.com/api/v7/cardinfo.php")
q := baseURL.Query()
q.Set("num", "3")
q.Set("fname", "Dark Magician")
q.Set("offset", "0")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://db.ygoprodeck.com/api/v7/cardinfo.php")
uri.query = URI.encode_www_form({
"num" => "3",
"fname" => "Dark Magician",
"offset" => "0"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://db.ygoprodeck.com/api/v7/cardinfo.php?" . http_build_query([
"num" => "3",
"fname" => "Dark Magician",
"offset" => "0"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
GET
Get random card
Get a random Yu-Gi-Oh! card.
https://db.ygoprodeck.com/api/v7/randomcard.php
Hover any highlighted part to learn what it does
curl -X GET "https://db.ygoprodeck.com/api/v7/randomcard.php"
import requests
response = requests.get(
"https://db.ygoprodeck.com/api/v7/randomcard.php",
)
print(response.json())const url = 'https://db.ygoprodeck.com/api/v7/randomcard.php'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://db.ygoprodeck.com/api/v7/randomcard.php"
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://db.ygoprodeck.com/api/v7/randomcard.php")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://db.ygoprodeck.com/api/v7/randomcard.php";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- No API key needed
- Search: GET /cardinfo.php?fname=Blue-Eyes&num=5
- By type: GET /cardinfo.php?type=Spell+Card&num=5
- Random: GET /randomcard.php
- Get all cards (large!): GET /cardinfo.php