API for developers
Sets, cards and prices as JSON
Everything the catalogue shows, and your own collection and wishlist to read and change. Every request needs your token.
curl "https://api.tcgnexus.net/v1/cards?search=furret&per_page=5" \
-H "Authorization: Bearer YOUR_TOKEN"
Before you start
- Address
- Every address on this page starts with
https://api.tcgnexus.net/v1 - Games
- The API covers Pokémon (pokemon). Filter the lists by one with ?game= and its slug.
- Tokens
-
Every request needs one, sent as the header
Authorization: Bearer …, except signing in, which is how an app gets one. Without it the answer is 401. Sign in to make a token - Limits
- 1,000 requests a day, or what your plan allows: all your tokens together, counted again from midnight (UTC). Every answer says how many are left today (X-RateLimit-Remaining). Past the limit the answer is 429, and the Retry-After header says how many seconds until the count starts again. See the plans
- Lists
- A list comes one page at a time: the entries under "data", the other pages under "links", the counts under "meta". Ask for a page with "page" and set its size with "per_page" (up to 100).
- Errors
- Every error is JSON with a "message" for people and a "code" for programs. When what you sent is not valid (422), "errors" lists what is wrong per field.
- Language
- Names come in the language you ask for with "lang" or the Accept-Language header, where the site has it.
Getting started
Four steps every program that uses the API takes, in the language you choose. Every example on this page then shows that language.
-
1. Get a token. Every request needs one. For a program of your own, make it under Account > API on the website. An app that members sign in to asks for one with their e-mail address and password, the one request that needs no token:
curl -X POST "https://api.tcgnexus.net/v1/auth/token" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{"email":"you@example.com","password":"your-password","device_name":"My card app"}'const response = await fetch("https://api.tcgnexus.net/v1/auth/token", { method: "POST", headers: { "Accept": "application/json", "Content-Type": "application/json", }, body: JSON.stringify({ "email": "you@example.com", "password": "your-password", "device_name": "My card app" }), }); if (!response.ok) { throw new Error(`The API answered ${response.status}`); } const { data } = await response.json();using System.Net.Http.Headers; using System.Net.Http.Json; using var client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); using var response = await client.PostAsJsonAsync("https://api.tcgnexus.net/v1/auth/token", new { email = "you@example.com", password = "your-password", device_name = "My card app", }); response.EnsureSuccessStatusCode(); var json = await response.Content.ReadAsStringAsync();import requests response = requests.post( "https://api.tcgnexus.net/v1/auth/token", headers={"Accept": "application/json"}, json={ "email": "you@example.com", "password": "your-password", "device_name": "My card app", }, ) response.raise_for_status() data = response.json()["data"]// composer require guzzlehttp/guzzle $client = new GuzzleHttp\Client(); $response = $client->request('POST', 'https://api.tcgnexus.net/v1/auth/token', [ 'headers' => ['Accept' => 'application/json'], 'json' => [ 'email' => 'you@example.com', 'password' => 'your-password', 'device_name' => 'My card app', ], ]); $data = json_decode($response->getBody(), true)['data']; -
2. Find cards. Send the token as "Authorization: Bearer" with every request. Put yours in place of YOUR_TOKEN.
curl "https://api.tcgnexus.net/v1/cards?search=Butterfree" \ -H "Accept: application/json" \ -H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://api.tcgnexus.net/v1/cards?search=Butterfree", { headers: { "Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN", }, }); if (!response.ok) { throw new Error(`The API answered ${response.status}`); } const { data } = await response.json();using System.Net.Http.Headers; using var client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN"); using var response = await client.GetAsync("https://api.tcgnexus.net/v1/cards?search=Butterfree"); response.EnsureSuccessStatusCode(); var json = await response.Content.ReadAsStringAsync();import requests response = requests.get( "https://api.tcgnexus.net/v1/cards", params={ "search": "Butterfree", }, headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"}, ) response.raise_for_status() data = response.json()["data"]// composer require guzzlehttp/guzzle $client = new GuzzleHttp\Client(); $response = $client->request('GET', 'https://api.tcgnexus.net/v1/cards', [ 'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'], 'query' => [ 'search' => 'Butterfree', ], ]); $data = json_decode($response->getBody(), true)['data']; -
3. Change your collection. The same way: here, adding a card to it.
curl -X POST "https://api.tcgnexus.net/v1/collection/items" \ -H "Accept: application/json" \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{"card":"butterfree-v-1-swsh3","variant":"normal","condition":"near-mint","language":"en","quantity":2,"folder_id":null,"purchase_price":4.5,"purchase_currency":"EUR","notes":"From a booster at the local shop"}'const response = await fetch("https://api.tcgnexus.net/v1/collection/items", { method: "POST", headers: { "Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN", "Content-Type": "application/json", }, body: JSON.stringify({ "card": "butterfree-v-1-swsh3", "variant": "normal", "condition": "near-mint", "language": "en", "quantity": 2, "folder_id": null, "purchase_price": 4.5, "purchase_currency": "EUR", "notes": "From a booster at the local shop" }), }); if (!response.ok) { throw new Error(`The API answered ${response.status}`); } const { data } = await response.json();using System.Net.Http.Headers; using System.Net.Http.Json; using var client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN"); using var response = await client.PostAsJsonAsync("https://api.tcgnexus.net/v1/collection/items", new { card = "butterfree-v-1-swsh3", variant = "normal", condition = "near-mint", language = "en", quantity = 2, purchase_price = 4.5, purchase_currency = "EUR", notes = "From a booster at the local shop", }); response.EnsureSuccessStatusCode(); var json = await response.Content.ReadAsStringAsync();import requests response = requests.post( "https://api.tcgnexus.net/v1/collection/items", headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"}, json={ "card": "butterfree-v-1-swsh3", "variant": "normal", "condition": "near-mint", "language": "en", "quantity": 2, "folder_id": None, "purchase_price": 4.5, "purchase_currency": "EUR", "notes": "From a booster at the local shop", }, ) response.raise_for_status() data = response.json()["data"]// composer require guzzlehttp/guzzle $client = new GuzzleHttp\Client(); $response = $client->request('POST', 'https://api.tcgnexus.net/v1/collection/items', [ 'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'], 'json' => [ 'card' => 'butterfree-v-1-swsh3', 'variant' => 'normal', 'condition' => 'near-mint', 'language' => 'en', 'quantity' => 2, 'folder_id' => null, 'purchase_price' => 4.5, 'purchase_currency' => 'EUR', 'notes' => 'From a booster at the local shop', ], ]); $data = json_decode($response->getBody(), true)['data']; -
4. Read every page, and wait when asked to. A list comes a page at a time; "links.next" is the address of the next page. Past the limit the answer is 429, and the Retry-After header says how many seconds to wait.
# One page at a time: "links.next" in each answer is the address of the next page (null after the last). curl "https://api.tcgnexus.net/v1/cards?set=swsh3-darkness-ablaze&per_page=100" -H "Accept: application/json" -H "Authorization: Bearer YOUR_TOKEN" # With jq, only that address: curl -s "https://api.tcgnexus.net/v1/cards?set=swsh3-darkness-ablaze&per_page=100" -H "Accept: application/json" -H "Authorization: Bearer YOUR_TOKEN" | jq -r '.links.next'let url = "https://api.tcgnexus.net/v1/cards?set=swsh3-darkness-ablaze&per_page=100"; const cards = []; while (url) { const response = await fetch(url, { headers: { Accept: "application/json", Authorization: "Bearer YOUR_TOKEN" }, }); if (response.status === 429) { // The limit was reached: wait as long as the API says, then ask again. await new Promise((resolve) => setTimeout(resolve, Number(response.headers.get("Retry-After") ?? 60) * 1000)); continue; } const page = await response.json(); cards.push(...page.data); url = page.links.next; }using System.Net; using System.Net.Http.Headers; using System.Text.Json; using var client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN"); var cards = new List<JsonElement>(); string? url = "https://api.tcgnexus.net/v1/cards?set=swsh3-darkness-ablaze&per_page=100"; while (url is not null) { using var response = await client.GetAsync(url); if (response.StatusCode == HttpStatusCode.TooManyRequests) { // The limit was reached: wait as long as the API says, then ask again. await Task.Delay(response.Headers.RetryAfter?.Delta ?? TimeSpan.FromSeconds(60)); continue; } response.EnsureSuccessStatusCode(); using var page = JsonDocument.Parse(await response.Content.ReadAsStringAsync()); cards.AddRange(page.RootElement.GetProperty("data").EnumerateArray().Select(card => card.Clone())); url = page.RootElement.GetProperty("links").GetProperty("next").GetString(); }import time import requests url = "https://api.tcgnexus.net/v1/cards?set=swsh3-darkness-ablaze&per_page=100" cards = [] while url: response = requests.get(url, headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"}) if response.status_code == 429: # The limit was reached: wait as long as the API says, then ask again. time.sleep(int(response.headers.get("Retry-After", 60))) continue response.raise_for_status() page = response.json() cards += page["data"] url = page["links"]["next"]// composer require guzzlehttp/guzzle $client = new GuzzleHttp\Client(['http_errors' => false]); $url = 'https://api.tcgnexus.net/v1/cards?set=swsh3-darkness-ablaze&per_page=100'; $cards = []; while ($url !== null) { $response = $client->get($url, ['headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN']]); if ($response->getStatusCode() === 429) { // The limit was reached: wait as long as the API says, then ask again. sleep((int) ($response->getHeaderLine('Retry-After') ?: 60)); continue; } $page = json_decode($response->getBody(), true); $cards = [...$cards, ...$page['data']]; $url = $page['links']['next']; }
Catalogue
Games, series, sets and cards.
List the series. The series the website shows.
Example
curl "https://api.tcgnexus.net/v1/series" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/series", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/series");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/series",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/series', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
$data = json_decode($response->getBody(), true)['data'];
What it takes
-
gamestring - Only the series of this game, by its slug.
-
sortone of: released-desc, released-asc - The order of the list. Usually released-desc.
-
pageinteger - Which page of the list. Usually 1.
-
per_pageinteger - How many entries a page holds. Usually 25.
What it answers with (a page of these under "data")
-
slug - string
-
name - string
-
game - string
-
released_on - string or null
-
is_coming_soon - boolean
-
sets_count - integer
-
logo - string or null
Get a series. One series, by its slug.
Example
curl "https://api.tcgnexus.net/v1/series/swsh" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/series/swsh", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/series/swsh");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/series/swsh",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/series/swsh', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
$data = json_decode($response->getBody(), true)['data'];
What it takes
-
seriesin the address - The slug of the series.
What it answers with (under "data")
-
slug - string
-
name - string
-
game - string
-
released_on - string or null
-
is_coming_soon - boolean
-
sets_count - integer
-
logo - string or null
List the sets. The sets the website shows.
Example
curl "https://api.tcgnexus.net/v1/sets?game=pokemon" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/sets?game=pokemon", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/sets?game=pokemon");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/sets",
params={
"game": "pokemon",
},
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/sets', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
'query' => [
'game' => 'pokemon',
],
]);
$data = json_decode($response->getBody(), true)['data'];
What it takes
-
seriesstring - Only the sets of this series, by its slug.
-
gamestring - Only the sets of this game, by its slug.
-
searchstring - Part of the name of the set, or the start of its code.
-
sortone of: released-desc, released-asc - The order of the list. Usually released-desc.
-
pageinteger - Which page of the list. Usually 1.
-
per_pageinteger - How many entries a page holds. Usually 25.
What it answers with (a page of these under "data")
-
slug - string
-
code - string or null
-
name - string
-
game - string. The slug of its game, which decides the fields that follow these.
-
series - Named
-
released_on - string or null
-
is_coming_soon - boolean
-
card_count - object
-
logo - string or null
-
symbol - string or null
-
url - string. The page of the set on the website.
-
legal - object. Whether it may be played in the Standard and Expanded formats.
Get a set. One set, by its slug. A slug the set had before answers with a redirect to the one it has now.
Example
curl "https://api.tcgnexus.net/v1/sets/swsh3-darkness-ablaze" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/sets/swsh3-darkness-ablaze", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/sets/swsh3-darkness-ablaze");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/sets/swsh3-darkness-ablaze",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/sets/swsh3-darkness-ablaze', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
$data = json_decode($response->getBody(), true)['data'];
What it takes
-
setin the address - The slug of the set.
What it answers with (under "data")
-
slug - string
-
code - string or null
-
name - string
-
game - string. The slug of its game, which decides the fields that follow these.
-
series - Named
-
released_on - string or null
-
is_coming_soon - boolean
-
card_count - object
-
logo - string or null
-
symbol - string or null
-
url - string. The page of the set on the website.
-
legal - object. Whether it may be played in the Standard and Expanded formats.
List the cards. The cards, with the search, filters and orders of the card listing on the website.
Example
curl "https://api.tcgnexus.net/v1/cards?search=Butterfree" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/cards?search=Butterfree", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/cards?search=Butterfree");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/cards",
params={
"search": "Butterfree",
},
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/cards', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
'query' => [
'search' => 'Butterfree',
],
]);
$data = json_decode($response->getBody(), true)['data'];
What it takes
-
searchstring - What to look for: part of a name, a number ("147"), a number in a set ("147/189" or "swsh3-147"), a set, an illustrator or a rarity. Every word has to match.
-
gamestring - Only cards of this game, by its slug.
-
setstring - Only cards of this set, by its slug.
-
seriesstring - Only cards of this series, by its slug.
-
raritystring - Only cards of this rarity, by its slug.
-
typestring - Only cards of this energy type, by its slug.
-
categorystring - Only cards of this category, by its slug.
-
stagestring - Only cards of this stage, by its slug.
-
illustratorstring - Only cards by this illustrator, by their slug.
-
hp_mininteger - Pokémon: only cards with at least this much HP.
-
hp_maxinteger - Pokémon: only cards with at most this much HP.
-
mana_minnumber - Magic: only cards with at least this mana value.
-
mana_maxnumber - Magic: only cards with at most this mana value.
-
price_minnumber - Only cards priced at least this much. Prices are compared in the currency of the member the token belongs to, else in the currency of the site.
-
price_maxnumber - Only cards priced at most this much.
-
legalstring - Only cards legal in this format: for Pokémon standard or expanded; with game=magic, one of Magic's formats as cards name them under "legalities" (standard, modern, commander...).
-
variantone of: normal, holo, reverse, first_edition, promo, stamped_promo, foil, etched - Only this printing.
-
ownedone of: yes, no - With a token: only the cards the member owns ("yes"), or only the ones they do not ("no").
-
sortone of: released-desc, released-asc, number-asc, number-desc, name-asc, name-desc, rarity-asc, rarity-desc, price-desc, price-asc - The order of the list. Usually released-desc.
-
pageinteger - Which page of the list. Usually 1.
-
per_pageinteger - How many entries a page holds. Usually 25.
What it answers with (a page of these under "data")
-
slug - string
-
name - string
-
number - string
-
game - string. The slug of its game, which decides the fields that follow these.
-
set - object
-
category - Named or null. For Magic, the card type.
-
rarity - Named or null
-
types - list of Named. For Pokémon the energy types; for Magic the colours.
-
illustrator - Named or null
-
variants - list of one of: normal, holo, reverse, first_edition, promo, stamped_promo, foil, etched
-
prices - object. What lists show as the price of the card, per currency.
-
images - object
-
url - string. The page of the card on the website.
-
stage - Named or null
-
trainer_type - Named or null
-
hp - integer or null
-
legal - object. Whether it may be played in the Standard and Expanded formats.
Get a card. One card with its texts and everything its game has: a Pokémon's attacks, abilities, weaknesses and resistances; a Magic card's faces, related cards, rulings and print details. "game" says which. A slug the card had before answers with a redirect to the one it has now.
Example
curl "https://api.tcgnexus.net/v1/cards/butterfree-v-1-swsh3" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/cards/butterfree-v-1-swsh3", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/cards/butterfree-v-1-swsh3");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/cards/butterfree-v-1-swsh3",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/cards/butterfree-v-1-swsh3', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
$data = json_decode($response->getBody(), true)['data'];
What it takes
-
cardin the address - The slug of the card.
What it answers with (under "data")
-
slug - string
-
name - string
-
number - string
-
game - string. The slug of its game, which decides the fields that follow these.
-
set - object
-
category - Named or null. For Magic, the card type.
-
rarity - Named or null
-
types - list of Named. For Pokémon the energy types; for Magic the colours.
-
illustrator - Named or null
-
variants - list of one of: normal, holo, reverse, first_edition, promo, stamped_promo, foil, etched
-
prices - object. What lists show as the price of the card, per currency.
-
images - object
-
url - string. The page of the card on the website.
-
series - Named or null
-
description - string or null. For Pokémon the Pokédex entry; for Magic the flavour text.
-
effect - string or null. The rules text of the card.
-
stage - Named or null
-
trainer_type - Named or null
-
hp - integer or null
-
legal - object. Whether it may be played in the Standard and Expanded formats.
-
suffix - Named or null
-
energy_card_kind - Named or null
-
evolves_from - string or null
-
regulation_mark - string or null
-
dex_ids - list of integer. The National Pokédex numbers of the Pokémon on the card.
-
retreat_cost - integer or null
-
attacks - list of object
-
abilities - list of object
-
weaknesses - list of object
-
resistances - list of object
Prices
What a card costs on each marketplace, now and day by day.
Get the prices of a card. What the card costs right now on each marketplace, per printing, condition and card language.
Example
curl "https://api.tcgnexus.net/v1/cards/butterfree-v-1-swsh3/prices?currency=EUR" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/cards/butterfree-v-1-swsh3/prices?currency=EUR", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/cards/butterfree-v-1-swsh3/prices?currency=EUR");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/cards/butterfree-v-1-swsh3/prices",
params={
"currency": "EUR",
},
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/cards/butterfree-v-1-swsh3/prices', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
'query' => [
'currency' => 'EUR',
],
]);
$data = json_decode($response->getBody(), true)['data'];
What it takes
-
cardin the address - The slug of the card.
-
currencyone of: EUR, USD - Only prices in this currency.
-
marketplacestring - Only this marketplace, by its slug.
-
variantone of: normal, holo, reverse, first_edition, promo, stamped_promo, foil, etched - Only this printing.
What it answers with (a list of these under "data")
-
marketplace - Named
-
variant - string or null
-
condition - string or null
-
language - string or null
-
currency - one of: EUR, USD
-
low - number or null
-
average - number or null
-
trend - number or null
-
high - number or null
-
priced_at - string or null
Get the price history of a card. What the card cost day by day. How far back it goes is up to the plan of the member asking; "meta.reach" says how many days that is (null: all the way).
Example
curl "https://api.tcgnexus.net/v1/cards/butterfree-v-1-swsh3/prices/history?days=30¤cy=EUR" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/cards/butterfree-v-1-swsh3/prices/history?days=30¤cy=EUR", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/cards/butterfree-v-1-swsh3/prices/history?days=30¤cy=EUR");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/cards/butterfree-v-1-swsh3/prices/history",
params={
"days": 30,
"currency": "EUR",
},
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/cards/butterfree-v-1-swsh3/prices/history', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
'query' => [
'days' => 30,
'currency' => 'EUR',
],
]);
$data = json_decode($response->getBody(), true)['data'];
What it takes
-
cardin the address - The slug of the card.
-
daysinteger - How many days back. Usually 90.
-
currencyone of: EUR, USD - Only prices in this currency.
-
marketplacestring - Only this marketplace, by its slug.
-
variantone of: normal, holo, reverse, first_edition, promo, stamped_promo, foil, etched - Only this printing.
What it answers with (a list of these under "data")
-
date - string
-
marketplace - string
-
variant - string or null
-
condition - string or null
-
language - string or null
-
currency - one of: EUR, USD
-
price - number
Lists
The short lists the catalogue is described with.
Where to start. The name and version of the API and where it is described.
Example
curl "https://api.tcgnexus.net/v1/" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
$data = json_decode($response->getBody(), true)['data'];
Answers with a JSON object.
This description. The description of the API in the OpenAPI format.
Example
curl "https://api.tcgnexus.net/v1/openapi.json" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/openapi.json", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/openapi.json");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/openapi.json",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/openapi.json', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
$data = json_decode($response->getBody(), true)['data'];
Answers with a JSON object.
List the games. The games that are switched on.
Example
curl "https://api.tcgnexus.net/v1/games" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/games", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/games");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/games",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/games', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
$data = json_decode($response->getBody(), true)['data'];
What it takes
-
pageinteger - Which page of the list. Usually 1.
-
per_pageinteger - How many entries a page holds. Usually 25.
What it answers with (a page of these under "data")
-
slug - string
-
name - string
-
icon - string or null
List the rarities. In order, the most common first.
Example
curl "https://api.tcgnexus.net/v1/rarities" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/rarities", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/rarities");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/rarities",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/rarities', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
$data = json_decode($response->getBody(), true)['data'];
What it takes
-
gamestring - Only the rarities of this game, by its slug.
-
pageinteger - Which page of the list. Usually 1.
-
per_pageinteger - How many entries a page holds. Usually 25.
What it answers with (a page of these under "data")
-
slug - string
-
name - string
-
icon - string or null
List the energy types. The types a card can have.
Example
curl "https://api.tcgnexus.net/v1/types" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/types", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/types");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/types",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/types', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
$data = json_decode($response->getBody(), true)['data'];
What it takes
-
gamestring - Only the types of this game, by its slug.
-
pageinteger - Which page of the list. Usually 1.
-
per_pageinteger - How many entries a page holds. Usually 25.
What it answers with (a page of these under "data")
-
slug - string
-
name - string
-
icon - string or null
List the printings. The ways a card can be printed. A card names the ones it comes in under "variants".
Example
curl "https://api.tcgnexus.net/v1/variants" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/variants", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/variants");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/variants",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/variants', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
$data = json_decode($response->getBody(), true)['data'];
What it answers with (a list of these under "data")
-
slug - string
-
name - string
-
icon - string or null
List the conditions. The conditions a copy can be in, the best first.
Example
curl "https://api.tcgnexus.net/v1/conditions" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/conditions", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/conditions");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/conditions",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/conditions', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
$data = json_decode($response->getBody(), true)['data'];
What it takes
-
pageinteger - Which page of the list. Usually 1.
-
per_pageinteger - How many entries a page holds. Usually 25.
What it answers with (a page of these under "data")
-
slug - string
-
name - string
-
icon - string or null
List the card languages. The languages a copy in a collection can be marked with.
Example
curl "https://api.tcgnexus.net/v1/languages" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/languages", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/languages");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/languages",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/languages', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
$data = json_decode($response->getBody(), true)['data'];
What it answers with (a list of these under "data")
-
code - string
-
name - string
List the symbols of Magic. The symbols Magic's mana costs and rules texts are written with ({W}, {2/U}, {T}), with their pictures. Empty while the API does not serve Magic.
Example
curl "https://api.tcgnexus.net/v1/symbols" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/symbols", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/symbols");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/symbols",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/symbols', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
$data = json_decode($response->getBody(), true)['data'];
What it answers with (a list of these under "data")
-
symbol - string. As card texts write it: {W}, {2/U}, {T}.
-
english - string or null
-
svg - string or null
-
represents_mana - boolean
-
appears_in_mana_costs - boolean
-
mana_value - number or null
-
colors - list of string
-
hybrid - boolean
-
phyrexian - boolean
-
funny - boolean. Only on joke (Un-) cards.
Sign-in
Exchanging a member's sign-in for a token, from an app.
Sign in. Exchange a member's e-mail address and password for a token. A member with two-step verification also sends "code" (from their authenticator app) or "recovery_code". Needs no token: it is how an app gets one.
Example
curl -X POST "https://api.tcgnexus.net/v1/auth/token" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"email":"you@example.com","password":"your-password","device_name":"My card app"}'
const response = await fetch("https://api.tcgnexus.net/v1/auth/token", {
method: "POST",
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
"email": "you@example.com",
"password": "your-password",
"device_name": "My card app"
}),
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using System.Net.Http.Json;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
using var response = await client.PostAsJsonAsync("https://api.tcgnexus.net/v1/auth/token", new
{
email = "you@example.com",
password = "your-password",
device_name = "My card app",
});
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.post(
"https://api.tcgnexus.net/v1/auth/token",
headers={"Accept": "application/json"},
json={
"email": "you@example.com",
"password": "your-password",
"device_name": "My card app",
},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.tcgnexus.net/v1/auth/token', [
'headers' => ['Accept' => 'application/json'],
'json' => [
'email' => 'you@example.com',
'password' => 'your-password',
'device_name' => 'My card app',
],
]);
$data = json_decode($response->getBody(), true)['data'];
What you send, as JSON
-
emailrequired - string
-
passwordrequired - string
-
device_namerequired - string. What the token is called in the account settings of the member.
-
code - string
-
recovery_code - string
What it answers with (under "data")
-
token - string
-
token_type - one of: Bearer
-
user - Profile
Sign out. The token the request was made with stops working.
Example
curl -X DELETE "https://api.tcgnexus.net/v1/auth/token" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/auth/token", {
method: "DELETE",
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.DeleteAsync("https://api.tcgnexus.net/v1/auth/token");
response.EnsureSuccessStatusCode();
import requests
response = requests.delete(
"https://api.tcgnexus.net/v1/auth/token",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('DELETE', 'https://api.tcgnexus.net/v1/auth/token', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
Answers 204 with nothing in it when it worked.
Sign in with Google. Exchange a Google ID token for a token. The ID token has to be issued for the Google client of this site ("serverClientId" in the Google sign-in of the app). A member with two-step verification also sends "code" (from their authenticator app) or "recovery_code". Needs no token: it is how an app gets one.
Example
curl -X POST "https://api.tcgnexus.net/v1/auth/google" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"id_token":"eyJhbGciOiJSUzI1NiIs...","device_name":"My card app"}'
const response = await fetch("https://api.tcgnexus.net/v1/auth/google", {
method: "POST",
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
"id_token": "eyJhbGciOiJSUzI1NiIs...",
"device_name": "My card app"
}),
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using System.Net.Http.Json;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
using var response = await client.PostAsJsonAsync("https://api.tcgnexus.net/v1/auth/google", new
{
id_token = "eyJhbGciOiJSUzI1NiIs...",
device_name = "My card app",
});
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.post(
"https://api.tcgnexus.net/v1/auth/google",
headers={"Accept": "application/json"},
json={
"id_token": "eyJhbGciOiJSUzI1NiIs...",
"device_name": "My card app",
},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.tcgnexus.net/v1/auth/google', [
'headers' => ['Accept' => 'application/json'],
'json' => [
'id_token' => 'eyJhbGciOiJSUzI1NiIs...',
'device_name' => 'My card app',
],
]);
$data = json_decode($response->getBody(), true)['data'];
What you send, as JSON
-
id_tokenrequired - string
-
device_namerequired - string
-
code - string
-
recovery_code - string
What it answers with (under "data")
-
token - string
-
token_type - one of: Bearer
-
user - Profile
Profile
The member a token belongs to.
Get the profile. The member the token belongs to, their plan and what it allows.
Example
curl "https://api.tcgnexus.net/v1/me" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/me", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/me");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/me",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/me', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
$data = json_decode($response->getBody(), true)['data'];
What it answers with (under "data")
-
username - string
-
name - string
-
email - string
-
email_verified - boolean
-
bio - string or null
-
avatar - string or null
-
plan - Named or null
-
limits - object. What the plan allows; null means no limit. "api_requests_per_day" counts all the member's tokens together, from midnight UTC.
-
joined_at - string or null
Change the profile. Replace the name, username and bio.
Example
curl -X PUT "https://api.tcgnexus.net/v1/me" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Ash Ketchum","username":"ash","bio":"Collecting since Base Set."}'
const response = await fetch("https://api.tcgnexus.net/v1/me", {
method: "PUT",
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Ash Ketchum",
"username": "ash",
"bio": "Collecting since Base Set."
}),
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using System.Net.Http.Json;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.PutAsJsonAsync("https://api.tcgnexus.net/v1/me", new
{
name = "Ash Ketchum",
username = "ash",
bio = "Collecting since Base Set.",
});
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.put(
"https://api.tcgnexus.net/v1/me",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
json={
"name": "Ash Ketchum",
"username": "ash",
"bio": "Collecting since Base Set.",
},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('PUT', 'https://api.tcgnexus.net/v1/me', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
'json' => [
'name' => 'Ash Ketchum',
'username' => 'ash',
'bio' => 'Collecting since Base Set.',
],
]);
$data = json_decode($response->getBody(), true)['data'];
What you send, as JSON
-
namerequired - string
-
usernamerequired - string
-
bio - string or null
What it answers with (under "data")
-
username - string
-
name - string
-
email - string
-
email_verified - boolean
-
bio - string or null
-
avatar - string or null
-
plan - Named or null
-
limits - object. What the plan allows; null means no limit. "api_requests_per_day" counts all the member's tokens together, from midnight UTC.
-
joined_at - string or null
Collection
The member's folders and the cards they own.
List the folders. Every folder, in tree order: a folder is followed by the folders inside it.
Example
curl "https://api.tcgnexus.net/v1/collection/folders" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/collection/folders", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/collection/folders");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/collection/folders",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/collection/folders', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
$data = json_decode($response->getBody(), true)['data'];
What it answers with (a list of these under "data")
-
id - integer
-
name - string
-
parent_id - integer or null
-
depth - integer
-
path - string
Make a folder. Folders nest three levels deep at most. How many there can be is up to the plan.
Example
curl -X POST "https://api.tcgnexus.net/v1/collection/folders" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Binder 1","parent_id":null}'
const response = await fetch("https://api.tcgnexus.net/v1/collection/folders", {
method: "POST",
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Binder 1",
"parent_id": null
}),
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using System.Net.Http.Json;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.PostAsJsonAsync("https://api.tcgnexus.net/v1/collection/folders", new
{
name = "Binder 1",
});
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.post(
"https://api.tcgnexus.net/v1/collection/folders",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
json={
"name": "Binder 1",
"parent_id": None,
},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.tcgnexus.net/v1/collection/folders', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
'json' => [
'name' => 'Binder 1',
'parent_id' => null,
],
]);
$data = json_decode($response->getBody(), true)['data'];
What you send, as JSON
-
namerequired - string
-
parent_id - integer or null. The folder it goes inside; null for the top.
What it answers with (under "data")
-
id - integer
-
name - string
-
parent_id - integer or null
-
depth - integer
-
path - string
Change a folder. Rename it, or put it inside another folder.
Example
curl -X PUT "https://api.tcgnexus.net/v1/collection/folders/12" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Binder 1","parent_id":null}'
const response = await fetch("https://api.tcgnexus.net/v1/collection/folders/12", {
method: "PUT",
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Binder 1",
"parent_id": null
}),
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using System.Net.Http.Json;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.PutAsJsonAsync("https://api.tcgnexus.net/v1/collection/folders/12", new
{
name = "Binder 1",
});
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.put(
"https://api.tcgnexus.net/v1/collection/folders/12",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
json={
"name": "Binder 1",
"parent_id": None,
},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('PUT', 'https://api.tcgnexus.net/v1/collection/folders/12', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
'json' => [
'name' => 'Binder 1',
'parent_id' => null,
],
]);
$data = json_decode($response->getBody(), true)['data'];
What it takes
-
folderin the address - The id of the folder.
What you send, as JSON
-
namerequired - string
-
parent_id - integer or null. The folder it goes inside; null for the top.
What it answers with (under "data")
-
id - integer
-
name - string
-
parent_id - integer or null
-
depth - integer
-
path - string
Remove a folder. Removes the folder and the folders inside it. Their cards stay in the collection, outside any folder.
Example
curl -X DELETE "https://api.tcgnexus.net/v1/collection/folders/12" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/collection/folders/12", {
method: "DELETE",
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.DeleteAsync("https://api.tcgnexus.net/v1/collection/folders/12");
response.EnsureSuccessStatusCode();
import requests
response = requests.delete(
"https://api.tcgnexus.net/v1/collection/folders/12",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('DELETE', 'https://api.tcgnexus.net/v1/collection/folders/12', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
What it takes
-
folderin the address - The id of the folder.
Answers 204 with nothing in it when it worked.
List the collection. What the member owns. One entry is the copies of a card that are alike: the same printing, condition and language, in the same folder.
Example
curl "https://api.tcgnexus.net/v1/collection/items" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/collection/items", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/collection/items");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/collection/items",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/collection/items', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
$data = json_decode($response->getBody(), true)['data'];
What it takes
-
folderstring - Only what is in this folder (by its id) and in the folders inside it, or "none" for what is in no folder.
-
searchstring - What to look for, as for the cards.
-
setstring - Only cards of this set, by its slug.
-
variantone of: normal, holo, reverse, first_edition, promo, stamped_promo, foil, etched - Only this printing.
-
conditionstring - Only copies in this condition, by its slug.
-
sortone of: added-desc, added-asc, name-asc, name-desc, quantity-desc, quantity-asc - The order of the list. Usually added-desc.
-
pageinteger - Which page of the list. Usually 1.
-
per_pageinteger - How many entries a page holds. Usually 25.
What it answers with (a page of these under "data")
-
id - integer
-
card - Card
-
variant - one of: normal, holo, reverse, first_edition, promo, stamped_promo, foil, etched
-
condition - string or null. The slug of a condition.
-
language - string or null. The code of a card language.
-
quantity - integer
-
folder_id - integer or null
-
purchase_price - number or null
-
purchase_currency - string or null
-
notes - string or null
-
added_at - string or null
Add a card. Add copies of a card to the collection.
Example
curl -X POST "https://api.tcgnexus.net/v1/collection/items" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"card":"butterfree-v-1-swsh3","variant":"normal","condition":"near-mint","language":"en","quantity":2,"folder_id":null,"purchase_price":4.5,"purchase_currency":"EUR","notes":"From a booster at the local shop"}'
const response = await fetch("https://api.tcgnexus.net/v1/collection/items", {
method: "POST",
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"card": "butterfree-v-1-swsh3",
"variant": "normal",
"condition": "near-mint",
"language": "en",
"quantity": 2,
"folder_id": null,
"purchase_price": 4.5,
"purchase_currency": "EUR",
"notes": "From a booster at the local shop"
}),
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using System.Net.Http.Json;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.PostAsJsonAsync("https://api.tcgnexus.net/v1/collection/items", new
{
card = "butterfree-v-1-swsh3",
variant = "normal",
condition = "near-mint",
language = "en",
quantity = 2,
purchase_price = 4.5,
purchase_currency = "EUR",
notes = "From a booster at the local shop",
});
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.post(
"https://api.tcgnexus.net/v1/collection/items",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
json={
"card": "butterfree-v-1-swsh3",
"variant": "normal",
"condition": "near-mint",
"language": "en",
"quantity": 2,
"folder_id": None,
"purchase_price": 4.5,
"purchase_currency": "EUR",
"notes": "From a booster at the local shop",
},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.tcgnexus.net/v1/collection/items', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
'json' => [
'card' => 'butterfree-v-1-swsh3',
'variant' => 'normal',
'condition' => 'near-mint',
'language' => 'en',
'quantity' => 2,
'folder_id' => null,
'purchase_price' => 4.5,
'purchase_currency' => 'EUR',
'notes' => 'From a booster at the local shop',
],
]);
$data = json_decode($response->getBody(), true)['data'];
What you send, as JSON
-
cardrequired - string. The slug of the card.
-
variantrequired - one of: normal, holo, reverse, first_edition, promo, stamped_promo, foil, etched
-
condition - string or null. The slug of a condition.
-
language - string or null. The code of a card language.
-
quantityrequired - integer
-
folder_id - integer or null
-
purchase_price - number or null
-
purchase_currency - string or null
-
notes - string or null
What it answers with (under "data")
-
id - integer
-
card - Card
-
variant - one of: normal, holo, reverse, first_edition, promo, stamped_promo, foil, etched
-
condition - string or null. The slug of a condition.
-
language - string or null. The code of a card language.
-
quantity - integer
-
folder_id - integer or null
-
purchase_price - number or null
-
purchase_currency - string or null
-
notes - string or null
-
added_at - string or null
Get an entry. One entry of the collection.
Example
curl "https://api.tcgnexus.net/v1/collection/items/345" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/collection/items/345", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/collection/items/345");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/collection/items/345",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/collection/items/345', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
$data = json_decode($response->getBody(), true)['data'];
What it takes
-
itemin the address - The id of the entry.
What it answers with (under "data")
-
id - integer
-
card - Card
-
variant - one of: normal, holo, reverse, first_edition, promo, stamped_promo, foil, etched
-
condition - string or null. The slug of a condition.
-
language - string or null. The code of a card language.
-
quantity - integer
-
folder_id - integer or null
-
purchase_price - number or null
-
purchase_currency - string or null
-
notes - string or null
-
added_at - string or null
Change an entry. Replace what is known about the copies. A field left out is emptied.
Example
curl -X PUT "https://api.tcgnexus.net/v1/collection/items/345" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"variant":"normal","condition":"near-mint","language":"en","quantity":2,"folder_id":null,"purchase_price":4.5,"purchase_currency":"EUR","notes":"From a booster at the local shop"}'
const response = await fetch("https://api.tcgnexus.net/v1/collection/items/345", {
method: "PUT",
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"variant": "normal",
"condition": "near-mint",
"language": "en",
"quantity": 2,
"folder_id": null,
"purchase_price": 4.5,
"purchase_currency": "EUR",
"notes": "From a booster at the local shop"
}),
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using System.Net.Http.Json;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.PutAsJsonAsync("https://api.tcgnexus.net/v1/collection/items/345", new
{
variant = "normal",
condition = "near-mint",
language = "en",
quantity = 2,
purchase_price = 4.5,
purchase_currency = "EUR",
notes = "From a booster at the local shop",
});
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.put(
"https://api.tcgnexus.net/v1/collection/items/345",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
json={
"variant": "normal",
"condition": "near-mint",
"language": "en",
"quantity": 2,
"folder_id": None,
"purchase_price": 4.5,
"purchase_currency": "EUR",
"notes": "From a booster at the local shop",
},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('PUT', 'https://api.tcgnexus.net/v1/collection/items/345', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
'json' => [
'variant' => 'normal',
'condition' => 'near-mint',
'language' => 'en',
'quantity' => 2,
'folder_id' => null,
'purchase_price' => 4.5,
'purchase_currency' => 'EUR',
'notes' => 'From a booster at the local shop',
],
]);
$data = json_decode($response->getBody(), true)['data'];
What it takes
-
itemin the address - The id of the entry.
What you send, as JSON
-
variantrequired - one of: normal, holo, reverse, first_edition, promo, stamped_promo, foil, etched
-
condition - string or null. The slug of a condition.
-
language - string or null. The code of a card language.
-
quantityrequired - integer
-
folder_id - integer or null
-
purchase_price - number or null
-
purchase_currency - string or null
-
notes - string or null
What it answers with (under "data")
-
id - integer
-
card - Card
-
variant - one of: normal, holo, reverse, first_edition, promo, stamped_promo, foil, etched
-
condition - string or null. The slug of a condition.
-
language - string or null. The code of a card language.
-
quantity - integer
-
folder_id - integer or null
-
purchase_price - number or null
-
purchase_currency - string or null
-
notes - string or null
-
added_at - string or null
Remove an entry. Take the copies out of the collection.
Example
curl -X DELETE "https://api.tcgnexus.net/v1/collection/items/345" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/collection/items/345", {
method: "DELETE",
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.DeleteAsync("https://api.tcgnexus.net/v1/collection/items/345");
response.EnsureSuccessStatusCode();
import requests
response = requests.delete(
"https://api.tcgnexus.net/v1/collection/items/345",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('DELETE', 'https://api.tcgnexus.net/v1/collection/items/345', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
What it takes
-
itemin the address - The id of the entry.
Answers 204 with nothing in it when it worked.
Wishlist
The cards the member would like to have.
List the wishlist. The cards on the list, the one added last first.
Example
curl "https://api.tcgnexus.net/v1/wishlist" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/wishlist", {
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
const { data } = await response.json();
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.GetAsync("https://api.tcgnexus.net/v1/wishlist");
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
import requests
response = requests.get(
"https://api.tcgnexus.net/v1/wishlist",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
data = response.json()["data"]
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.tcgnexus.net/v1/wishlist', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
$data = json_decode($response->getBody(), true)['data'];
What it takes
-
pageinteger - Which page of the list. Usually 1.
-
per_pageinteger - How many entries a page holds. Usually 25.
What it answers with (a page of these under "data")
-
slug - string
-
name - string
-
number - string
-
game - string. The slug of its game, which decides the fields that follow these.
-
set - object
-
category - Named or null. For Magic, the card type.
-
rarity - Named or null
-
types - list of Named. For Pokémon the energy types; for Magic the colours.
-
illustrator - Named or null
-
variants - list of one of: normal, holo, reverse, first_edition, promo, stamped_promo, foil, etched
-
prices - object. What lists show as the price of the card, per currency.
-
images - object
-
url - string. The page of the card on the website.
-
stage - Named or null
-
trainer_type - Named or null
-
hp - integer or null
-
legal - object. Whether it may be played in the Standard and Expanded formats.
Add a card. Put a card on the list. Doing it again changes nothing.
Example
curl -X PUT "https://api.tcgnexus.net/v1/wishlist/butterfree-v-1-swsh3" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/wishlist/butterfree-v-1-swsh3", {
method: "PUT",
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.PutAsync("https://api.tcgnexus.net/v1/wishlist/butterfree-v-1-swsh3", null);
response.EnsureSuccessStatusCode();
import requests
response = requests.put(
"https://api.tcgnexus.net/v1/wishlist/butterfree-v-1-swsh3",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('PUT', 'https://api.tcgnexus.net/v1/wishlist/butterfree-v-1-swsh3', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
What it takes
-
cardin the address - The slug of the card.
Answers 204 with nothing in it when it worked.
Remove a card. Take a card off the list.
Example
curl -X DELETE "https://api.tcgnexus.net/v1/wishlist/butterfree-v-1-swsh3" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.tcgnexus.net/v1/wishlist/butterfree-v-1-swsh3", {
method: "DELETE",
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
if (!response.ok) {
throw new Error(`The API answered ${response.status}`);
}
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_TOKEN");
using var response = await client.DeleteAsync("https://api.tcgnexus.net/v1/wishlist/butterfree-v-1-swsh3");
response.EnsureSuccessStatusCode();
import requests
response = requests.delete(
"https://api.tcgnexus.net/v1/wishlist/butterfree-v-1-swsh3",
headers={"Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN"},
)
response.raise_for_status()
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$response = $client->request('DELETE', 'https://api.tcgnexus.net/v1/wishlist/butterfree-v-1-swsh3', [
'headers' => ['Accept' => 'application/json', 'Authorization' => 'Bearer YOUR_TOKEN'],
]);
What it takes
-
cardin the address - The slug of the card.
Answers 204 with nothing in it when it worked.