Backend API for card deck building and trading app - Complete API Reference
Authorization header as Bearer <token>. See Authentication Guide for details.
GET /categories?page=1&limit=20
{
"data": [Category],
"page": int,
"limit": int,
"total": int | null,
"has_more": bool
}
{
"data": [
{
"category_id": 1,
"name": "Pokemon",
"display_name": "PokΓ©mon",
"seo_category_name": "pokemon",
"sealed_label": "Sealed",
"non_sealed_label": "Unsealed",
"condition_guide_url": "https://example.com/condition-guide",
"is_scannable": true,
"popularity": 100,
"modified_on": "2024-01-15T10:30:00Z",
"fetched_at": "2024-01-20T08:00:00Z",
"raw": {},
"fixed_amount": null
},
{
"category_id": 2,
"name": "Magic: The Gathering",
"display_name": "Magic: The Gathering",
"seo_category_name": "magic-the-gathering",
"sealed_label": "Sealed",
"non_sealed_label": "Unsealed",
"condition_guide_url": null,
"is_scannable": true,
"popularity": 95,
"modified_on": "2024-01-15T10:30:00Z",
"fetched_at": "2024-01-20T08:00:00Z",
"raw": {},
"fixed_amount": null
}
],
"page": 1,
"limit": 20,
"total": 50,
"has_more": true
}
GET /categories/1
{
"category_id": 1,
"name": "Pokemon",
"display_name": "PokΓ©mon",
"seo_category_name": "pokemon",
"sealed_label": "Sealed",
"non_sealed_label": "Unsealed",
"condition_guide_url": "https://example.com/condition-guide",
"is_scannable": true,
"popularity": 100,
"modified_on": "2024-01-15T10:30:00Z",
"fetched_at": "2024-01-20T08:00:00Z",
"raw": {},
"fixed_amount": null
}
GET /categories/product-counts
{
"category_id": int // Dictionary mapping category_id to product count
}
{
"1": 150,
"2": 200,
"3": 75
}
GET /categories/rules
GET /categories/rules?category_id=1
CategoryGameRules
{
"category_id": 1,
"deck_size": 60,
"max_duplicates": 4,
"extended_rules": {
"energy_types": ["Fire", "Water", "Grass"],
"special_rules": []
},
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
[
{
"category_id": 1,
"deck_size": 60,
"max_duplicates": 4,
...
},
{
"category_id": 2,
"deck_size": 60,
"max_duplicates": 4,
...
}
]
PaginatedResponse<Group>
{
"data": [
{
"group_id": 1,
"category_id": 1,
"name": "Base Set",
"abbreviation": "BS",
"is_supplemental": false,
"published_on": "1999-01-09T00:00:00Z",
"modified_on": "2024-01-15T10:30:00Z",
"fetched_at": "2024-01-20T08:00:00Z",
"raw": {}
}
],
"page": 1,
"limit": 100,
"total": 50,
"has_more": false
}
Group
{
"group_id": 1,
"category_id": 1,
"name": "Base Set",
"abbreviation": "BS",
"is_supplemental": false,
"published_on": "1999-01-09T00:00:00Z",
"modified_on": "2024-01-15T10:30:00Z",
"fetched_at": "2024-01-20T08:00:00Z",
"raw": {}
}
PaginatedResponse<Group>
{
"data": [
{
"group_id": 1,
"category_id": 1,
"name": "Base Set",
"abbreviation": "BS",
"is_supplemental": false,
"published_on": "1999-01-09T00:00:00Z",
"modified_on": "2024-01-15T10:30:00Z",
"fetched_at": "2024-01-20T08:00:00Z",
"raw": {}
}
],
"page": 1,
"limit": 100,
"total": 10,
"has_more": false
}
color, type, level, cost, atk, hp, rarity) and a number field from extended data.
PaginatedResponse<Product>
{
"data": [
{
"product_id": 12345,
"category_id": 1,
"group_id": 1,
"name": "Pikachu",
"clean_name": "pikachu",
"image_url": "https://example.com/pikachu.jpg",
"url": "https://tcgplayer.com/product/12345",
"modified_on": "2024-01-15T10:30:00Z",
"fetched_at": "2024-01-20T08:00:00Z",
"raw": {},
"fixed_amount": null,
"number": "025",
"rarity": "Common",
"color": "Yellow",
"type": "Electric",
"level": null,
"cost": 1,
"atk": 20,
"hp": 60,
"extended_data_raw": "{\"Rarity\": \"Common\", \"Number\": \"025\", \"Type\": \"Electric\"}"
}
],
"page": 1,
"limit": 100,
"total": 1000,
"has_more": true
}
GET /products/search?q=pika&page=1&limit=20
PaginatedResponse<Product>
{
"data": [
{
"product_id": 12345,
"category_id": 1,
"group_id": 1,
"name": "Pikachu",
"clean_name": "pikachu",
"image_url": "https://example.com/pikachu.jpg",
"url": "https://tcgplayer.com/product/12345",
"modified_on": "2024-01-15T10:30:00Z",
"fetched_at": "2024-01-20T08:00:00Z",
"fixed_amount": null,
"number": "025",
"rarity": "Common",
"color": "Yellow",
"type": "Electric",
"level": null,
"cost": 1,
"atk": 20,
"hp": 60,
"extended_data_raw": "{\"Rarity\": \"Common\", \"Number\": \"025\", \"Type\": \"Electric\"}"
},
{
"product_id": 12346,
"category_id": 1,
"group_id": 1,
"name": "Pikachu VMAX",
"clean_name": "pikachu vmax",
"image_url": "https://example.com/pikachu-vmax.jpg",
"url": "https://tcgplayer.com/product/12346",
"modified_on": "2024-01-15T10:30:00Z",
"fetched_at": "2024-01-20T08:00:00Z",
"fixed_amount": null,
"number": "188",
"rarity": "Rare",
"color": "Yellow",
"type": "Electric",
"level": null,
"cost": 3,
"atk": 200,
"hp": 300,
"extended_data_raw": "{\"Rarity\": \"Ultra Rare\", \"Number\": \"188\", \"Type\": \"Electric\"}"
}
],
"page": 1,
"limit": 20,
"total": 15,
"has_more": false
}
number field from extended data.
Product
{
"product_id": 12345,
"category_id": 1,
"group_id": 1,
"name": "Pikachu",
"clean_name": "pikachu",
"image_url": "https://example.com/pikachu.jpg",
"url": "https://tcgplayer.com/product/12345",
"modified_on": "2024-01-15T10:30:00Z",
"fetched_at": "2024-01-20T08:00:00Z",
"raw": {},
"fixed_amount": null,
"number": "025",
"extended_data_raw": "{\"Rarity\": \"Common\", \"Number\": \"025\", \"Type\": \"Electric\"}"
}
PaginatedResponse<Product>
{
"data": [
{
"product_id": 12345,
"category_id": 1,
"group_id": 1,
"name": "Pikachu",
"clean_name": "pikachu",
"image_url": "https://example.com/pikachu.jpg",
"url": "https://tcgplayer.com/product/12345",
"modified_on": "2024-01-15T10:30:00Z",
"fetched_at": "2024-01-20T08:00:00Z",
"raw": {},
"fixed_amount": null,
"number": "025",
"extended_data_raw": "{\"Rarity\": \"Common\", \"Number\": \"001\"}"
}
],
"page": 1,
"limit": 100,
"total": 500,
"has_more": true
}
PaginatedResponse<Product>
{
"data": [
{
"product_id": 12345,
"category_id": 1,
"group_id": 1,
"name": "Pikachu",
"clean_name": "pikachu",
"image_url": "https://example.com/pikachu.jpg",
"url": "https://tcgplayer.com/product/12345",
"modified_on": "2024-01-15T10:30:00Z",
"fetched_at": "2024-01-20T08:00:00Z",
"raw": {},
"fixed_amount": null,
"number": "025",
"extended_data_raw": "{\"Rarity\": \"Common\", \"Number\": \"001\"}"
}
],
"page": 1,
"limit": 100,
"total": 102,
"has_more": true
}
POST /products/filter?page=1&limit=20
{
"category_id": 1,
"filters": {
"Rarity": ["Common", "Rare"],
"Number": "001"
},
"sort_columns": ["color", "type", "rarity", "level", "cost"],
"sort_direction": "asc"
}
POST /products/filter?page=1&limit=20
{
"category_id": 1,
"filters": {
"Rarity": ["Common", "Rare"]
},
"sort_columns": ["color", "type", "rarity"],
"sort_direction": ["asc", "desc", "asc"]
}
PaginatedResponse<Product>
{
"data": [
{
"product_id": 12345,
"category_id": 1,
"group_id": 1,
"name": "Bulbasaur",
"clean_name": "bulbasaur",
"image_url": "https://example.com/bulbasaur.jpg",
"url": "https://tcgplayer.com/product/12345",
"modified_on": "2024-01-15T10:30:00Z",
"fetched_at": "2024-01-20T08:00:00Z",
"raw": {},
"fixed_amount": null,
"number": "001",
"rarity": "Common",
"color": "Green",
"type": "Grass",
"level": null,
"cost": 1,
"atk": 10,
"hp": 50,
"extended_data_raw": "{\"Rarity\": \"Common\", \"Number\": \"001\", \"Type\": \"Grass\"}"
}
],
"page": 1,
"limit": 20,
"total": 50,
"has_more": true
}
Array<PriceCurrent>
[
{
"product_id": 12345,
"low_price": 0.50,
"mid_price": 1.25,
"high_price": 2.00,
"market_price": 1.15,
"direct_low_price": 0.45,
"sub_type_name": "Normal",
"fetched_at": "2024-01-20T08:00:00Z",
"raw": {}
},
{
"product_id": 67890,
"low_price": 5.00,
"mid_price": 7.50,
"high_price": 10.00,
"market_price": 7.25,
"direct_low_price": 4.75,
"sub_type_name": "Holo",
"fetched_at": "2024-01-20T08:00:00Z",
"raw": {}
}
]
PriceCurrent
{
"product_id": 12345,
"low_price": 0.50,
"mid_price": 1.25,
"high_price": 2.00,
"market_price": 1.15,
"direct_low_price": 0.45,
"sub_type_name": "Normal",
"fetched_at": "2024-01-20T08:00:00Z",
"raw": {}
}
POST /prices-current/bulk
{
"product_ids": [12345, 67890, 11111]
}
{
"prices": [PriceCurrent],
"requested_count": int,
"found_count": int,
"missing_count": int
}
{
"prices": [
{
"product_id": 12345,
"low_price": 0.50,
"mid_price": 1.25,
"high_price": 2.00,
"market_price": 1.15,
"direct_low_price": 0.45,
"sub_type_name": "Normal",
"fetched_at": "2024-01-20T08:00:00Z",
"raw": {}
},
{
"product_id": 67890,
"low_price": 5.00,
"mid_price": 7.50,
"high_price": 10.00,
"market_price": 7.25,
"direct_low_price": 4.75,
"sub_type_name": "Holo",
"fetched_at": "2024-01-20T08:00:00Z",
"raw": {}
}
],
"requested_count": 3,
"found_count": 2,
"missing_count": 1
}
GET /prices-history?start_date=2024-01-01&end_date=2024-12-31&product_id=12345
PaginatedResponse<PriceHistory>
{
"data": [
{
"product_id": 12345,
"fetched_at": "2024-01-20T08:00:00Z",
"low_price": 0.50,
"mid_price": 1.25,
"high_price": 2.00,
"market_price": 1.15,
"direct_low_price": 0.45,
"sub_type_name": "Normal",
"raw": {}
}
],
"page": 1,
"limit": 100,
"total": 500,
"has_more": true
}
PaginatedResponse<PriceHistory>
{
"data": [
{
"product_id": 12345,
"fetched_at": "2024-01-20T08:00:00Z",
"low_price": 0.50,
"mid_price": 1.25,
"high_price": 2.00,
"market_price": 1.15,
"direct_low_price": 0.45,
"sub_type_name": "Normal",
"raw": {}
}
],
"page": 1,
"limit": 100,
"total": 30,
"has_more": false
}
PriceHistory
{
"product_id": 12345,
"fetched_at": "2024-01-20T08:00:00Z",
"low_price": 0.50,
"mid_price": 1.25,
"high_price": 2.00,
"market_price": 1.15,
"direct_low_price": 0.45,
"sub_type_name": "Normal",
"raw": {}
}
PaginatedResponse<ProductExtendedData>
{
"data": [
{
"product_id": 12345,
"key": "Rarity",
"value": "Common"
},
{
"product_id": 12345,
"key": "Number",
"value": "025"
}
],
"page": 1,
"limit": 100,
"total": 5000,
"has_more": true
}
PaginatedResponse<ProductExtendedData>
{
"data": [...],
"page": 1,
"limit": 100,
"total": 2000,
"has_more": true
}
["Rarity", "Number", "Type", "HP", "Attack"]
{
"Rarity": ["Common", "Uncommon", "Rare", "Ultra Rare"],
"Number": ["001", "002", "003", ...],
"Type": ["Fire", "Water", "Grass", "Electric"]
}
PaginatedResponse<ProductExtendedData>
{
"data": [
{
"product_id": 12345,
"key": "Rarity",
"value": "Common"
},
{
"product_id": 12345,
"key": "Number",
"value": "025"
}
],
"page": 1,
"limit": 100,
"total": 5,
"has_more": false
}
{
"product_id": 12345,
"key": "Rarity",
"value": "Common"
}
PaginatedResponse<CategoryExtendedDataKey>
{
"data": [
{
"category_id": 1,
"key": "Rarity",
"first_seen": "2024-01-01T00:00:00Z",
"last_seen": "2024-01-20T08:00:00Z"
},
{
"category_id": 1,
"key": "Number",
"first_seen": "2024-01-01T00:00:00Z",
"last_seen": "2024-01-20T08:00:00Z"
}
],
"page": 1,
"limit": 100,
"total": 50,
"has_more": false
}
PaginatedResponse<CategoryExtendedDataKey>
{
"data": [
{
"category_id": 1,
"key": "Rarity",
"first_seen": "2024-01-01T00:00:00Z",
"last_seen": "2024-01-20T08:00:00Z"
}
],
"page": 1,
"limit": 100,
"total": 10,
"has_more": false
}
{
"category_id": 1,
"key": "Rarity",
"first_seen": "2024-01-01T00:00:00Z",
"last_seen": "2024-01-20T08:00:00Z"
}
GET /favorites?user_id=f4f079f2-2d7f-411b-b309-67dc9f019f57
Favorites
{
"user_id": "f4f079f2-2d7f-411b-b309-67dc9f019f57",
"favorites": {
"12345": 1,
"67890": 1,
"11111": 1
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T08:00:00Z"
}
POST /favorites
Headers: Authorization: Bearer <token>
{
"favorites": {
"12345": 1,
"67890": 1
}
}
{
"user_id": "f4f079f2-2d7f-411b-b309-67dc9f019f57",
"favorites": {
"12345": 1,
"67890": 1,
"11111": 1
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T08:00:00Z"
}
DELETE /favorites
Headers: Authorization: Bearer <token>
{
"product_ids": [12345, 67890]
}
GET /user-inventory?user_id=f4f079f2-2d7f-411b-b309-67dc9f019f57
UserInventory
{
"user_id": "f4f079f2-2d7f-411b-b309-67dc9f019f57",
"items": {
"12345": 5,
"67890": 2,
"11111": 10
},
"total_count": 17,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T08:00:00Z"
}
POST /user-inventory/items
Headers: Authorization: Bearer <token>
{
"items": {
"12345": 5,
"67890": 2,
"11111": 10
}
}
UserInventory
{
"user_id": "f4f079f2-2d7f-411b-b309-67dc9f019f57",
"items": {
"12345": 5,
"67890": 2,
"11111": 10
},
"total_count": 17,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T08:00:00Z"
}
DELETE /user-inventory/items
Headers: Authorization: Bearer <token>
{
"product_ids": [12345, 67890]
}
UserInventory
{
"user_id": "f4f079f2-2d7f-411b-b309-67dc9f019f57",
"items": {
"11111": 10
},
"total_count": 10,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T08:00:00Z"
}
Array<CategoryStats>
[
{
"category_id": 1,
"total_quantity": 150,
"unique_products": 25
},
{
"category_id": 2,
"total_quantity": 200,
"unique_products": 30
}
]
GET /profiles?user_id=f4f079f2-2d7f-411b-b309-67dc9f019f57
Profile
{
"id": "f4f079f2-2d7f-411b-b309-67dc9f019f57",
"username": "cardcollector",
"avatar_url": "https://example.com/avatar.jpg",
"currency": "USD",
"items": {
"12345": 5,
"67890": 2,
"11111": 10
},
"favorites": {
"12345": 1,
"67890": 1
},
"total_count": 17,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T08:00:00Z"
}
POST /profiles
Headers: Authorization: Bearer <token>
{
"username": "cardcollector",
"full_name": "John Doe",
"avatar_url": "https://example.com/avatar.jpg",
"currency": "EUR",
"items": {
"12345": 5,
"67890": 2
},
"favorites": {
"12345": 1
}
}
{
"id": "f4f079f2-2d7f-411b-b309-67dc9f019f57",
"username": "cardcollector",
"full_name": "John Doe",
"avatar_url": "https://example.com/avatar.jpg",
"currency": "EUR",
"items": {
"12345": 5,
"67890": 2
},
"favorites": {
"12345": 1
},
"total_count": 7,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T08:00:00Z"
}
PaginatedResponse<DeckList>
{
"data": [
{
"deck_list_id": 1,
"user_id": "f4f079f2-2d7f-411b-b309-67dc9f019f57",
"category_id": 1,
"name": "My Deck",
"items": {
"12345": 4,
"67890": 2
},
"card_count": 6,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T08:00:00Z"
}
],
"page": 1,
"limit": 100,
"total": 10,
"has_more": false
}
DeckList
{
"deck_list_id": 1,
"user_id": "f4f079f2-2d7f-411b-b309-67dc9f019f57",
"category_id": 1,
"name": "My Deck",
"items": {
"12345": 4,
"67890": 2
},
"card_count": 6,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T08:00:00Z"
}
POST /deck-lists
{
"category_id": 1,
"name": "My Deck",
"items": {
"12345": 4,
"67890": 2
}
}
POST /deck-lists/{deck_list_id}/items endpoint instead.
PATCH /deck-lists/5
Headers: Authorization: Bearer <token>
{
"name": "Updated Deck Name"
}
POST /deck-lists/5/items
Headers: Authorization: Bearer <token>
{
"items": {
"12345": 4,
"67890": 2,
"11111": 1
}
}
DeckList
{
"deck_list_id": 5,
"user_id": "f4f079f2-2d7f-411b-b309-67dc9f019f57",
"category_id": 1,
"name": "My Deck",
"items": {
"12345": 4,
"67890": 2,
"11111": 1
},
"card_count": 7,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T08:00:00Z"
}
DELETE /deck-lists/5/items
Headers: Authorization: Bearer <token>
{
"product_ids": [12345, 67890]
}
DeckList
{
"deck_list_id": 5,
"user_id": "f4f079f2-2d7f-411b-b309-67dc9f019f57",
"category_id": 1,
"name": "My Deck",
"items": {
"11111": 1
},
"card_count": 1,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T08:00:00Z"
}
TCGHermit API v1.0.0
For interactive API exploration, visit Swagger UI