List Sets

Get a list of all sets in the catalog. Use this to discover set IDs for listing products from a specific set.

Available Games

Use these slugs when filtering by game:

GET/sets
List Sets

Retrieve sets from the catalog. With gameSlug filter: returns all sets by default. Without gameSlug: paginated results.

On larger screens, use the API Playground panel on the right to try this endpoint.
NameTypeRequiredDescription
gameSlugstringOptionalFilter by game slug (e.g., "magic-the-gathering"). When provided, returns all sets for that game by default.
pagenumberOptionalPage number (required when no gameSlug filter)Default: 1
limitnumberOptionalItems per page, max 100 (required when no gameSlug filter)Default: 50
bash
curl "https://api.ctcgx.com/api/v1/sets" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

Returns sets with their IDs, names, and product counts. Pagination info included when paginated.

json
{
  "sets": [
    {
      "id": "clxxx...",
      "name": "Foundations",
      "slug": "foundations",
      "releaseDate": "2024-11-15",
      "productCount": 302,
      "game": {
        "slug": "magic-the-gathering",
        "name": "Magic: The Gathering"
      }
    },
    {
      "id": "clyyy...",
      "name": "Duskmourn: House of Horror",
      "slug": "duskmourn-house-of-horror",
      "releaseDate": "2024-09-27",
      "productCount": 415,
      "game": {
        "slug": "magic-the-gathering",
        "name": "Magic: The Gathering"
      }
    }
  ],
  "total": 847
}

Common Use Cases

# Get all sets for a specific game (no pagination needed)
GET /sets?gameSlug=magic-the-gathering

# Get sets for a game with pagination (for large catalogs)
GET /sets?gameSlug=magic-the-gathering&page=1&limit=50

# Get all sets across all games (paginated)
GET /sets?page=1&limit=100

Adding Inventory for a New Set

When a new set releases, follow these steps to add inventory:

  1. List sets to find the new set's ID or slug
  2. List products for that set to get all product IDs
  3. Sync inventory using the product IDs with your quantities and prices
# Step 1: Find the set
GET /sets?gameSlug=magic-the-gathering

# Step 2: Get products in the set
GET /products?setSlug=foundations&limit=1000

# Step 3: Sync your inventory
POST /inventory/sync
{
  "mode": "add",
  "items": [
    { "ctcgxProductId": "clxxx...", "quantity": 4, "price": 199 },
    { "ctcgxProductId": "clyyy...", "quantity": 2, "price": 599 }
  ]
}

API Playground

Select an endpoint from the documentation to try it out here.