{
  "openapi": "3.0.1",
  "info": {
    "title": "TCGplayer Scraper - Card Prices & Price History",
    "description": "Get TCGplayer card prices by card name, set or product URL for Pokemon, Magic, Yu-Gi-Oh!, One Piece, Lorcana and more: market, lowest and median price, price by condition and printing, listings count, set, rarity, optional price history with sales. Compare with the last run. Pay per card.",
    "version": "0.1",
    "x-build-id": "WhQ3PNrhRSADVcfsu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapewise~tcgplayer-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapewise-tcgplayer-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/scrapewise~tcgplayer-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapewise-tcgplayer-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/scrapewise~tcgplayer-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapewise-tcgplayer-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "products",
              "priceHistory"
            ],
            "type": "string",
            "description": "search: one row per product found, with market price, lowest price and listings count. products: opens each link or ID in 'Product links or IDs' and adds median price, sellers count, Normal and Foil prices and price by condition. priceHistory: returns only the dated market price and sales series for each printing and condition of the products you search or paste. Empty means search, or products when you only paste links."
          },
          "searchQueries": {
            "title": "Search terms",
            "type": "array",
            "description": "Card or product names, one per line (charizard, black lotus, blue-eyes white dragon, booster box). Each term is searched separately and every row says which term found it ('searchQuery'). Leave empty and set 'Game' or 'Set' to browse a whole game or expansion. Also reads 'queries', 'searchQuery', 'query' or 'q' from other TCGplayer scrapers. A term with no match returns a free NO_RESULTS row.",
            "items": {
              "type": "string"
            }
          },
          "game": {
            "title": "Game (product line)",
            "type": "string",
            "description": "Limit the search to one product line, as the slug in TCGplayer links: pokemon, magic, yugioh, one-piece-card-game, lorcana-tcg, flesh-and-blood-tcg, digimon-card-game, star-wars-unlimited, pokemon-japan. Short names such as mtg, onepiece or lorcana work too. Empty searches every game. 'category' and 'productLine' also work. An unknown game returns a free INVALID_GAME row."
          },
          "setName": {
            "title": "Set / expansion (optional)",
            "type": "string",
            "description": "Only products from this set or expansion, by full name or part of it (Base Set, 151, Obsidian Flames, Revised Edition). Works with or without a search term; with a game and no term it lists the whole set. A name with no match returns a free SET_NOT_FOUND row. Empty by default."
          },
          "rarity": {
            "title": "Rarity (optional)",
            "type": "array",
            "description": "Only these rarities, one per line, as TCGplayer writes them (Special Illustration Rare, Mythic, Secret Rare, Holo Rare). Useful with a set to list its chase cards. Empty keeps all rarities. 'rarityFilter' also works.",
            "items": {
              "type": "string"
            }
          },
          "minPrice": {
            "title": "Minimum market price (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Only products whose TCGplayer market price is at or above this, in USD (for example 50). The filter is applied by TCGplayer's own search. Empty means no lower limit."
          },
          "maxPrice": {
            "title": "Maximum market price (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Only products whose TCGplayer market price is at or below this, in USD. Empty means no upper limit."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "bestMatch",
              "bestSelling",
              "priceHighLow",
              "priceLowHigh",
              "aToZ"
            ],
            "type": "string",
            "description": "Order of search results, as on TCGplayer: bestMatch (the site's default), bestSelling, priceHighLow, priceLowHigh or aToZ. With a limit, the order decides which products make the cut: priceHighLow returns the most expensive first. 'sortOption' values such as \"Best Selling\" or \"Price: High to Low\" also work."
          },
          "maxItems": {
            "title": "Maximum products",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum unique products in the run, across all search terms and links. Default 30, maximum 100,000. You pay per product delivered (US$ 3 per 1,000), so this caps the cost. Terms are filled in order; use 'Maximum products per search term' to share the limit. 'maxResults' and 'limit' also work.",
            "default": 30
          },
          "maxItemsPerQuery": {
            "title": "Maximum products per search term (optional)",
            "minimum": 1,
            "type": "integer",
            "description": "Optional cap for each search term, so the first term does not use the whole 'Maximum products'. For example 20 with five terms gives up to 20 products per term. Empty means no per term cap."
          },
          "includeDetails": {
            "title": "Include price by printing and condition",
            "type": "boolean",
            "description": "Off by default in search mode, always on in products mode. Opens each product and adds median price, sellers count, Normal and Foil market and listed median prices, buylist market price, nearMintMarketPrice and conditionPrices (market price and 30 day sales for each condition, Near Mint to Damaged). No extra charge; runs take a little longer.",
            "default": false
          },
          "includePriceHistory": {
            "title": "Include price history",
            "type": "boolean",
            "description": "Off by default. Adds rows with type 'priceHistory' for each product found: one row per printing, language and condition, with the dated market price and sales series. Charged as a separate event, US$ 3 per 1,000 products with history, however many rows a product gets. Price history mode does the same without the product rows.",
            "default": false
          },
          "historyRange": {
            "title": "History period",
            "enum": [
              "month",
              "quarter",
              "semi-annual",
              "annual"
            ],
            "type": "string",
            "description": "Period of the price history series. Default 'quarter' (last 3 months, a point about every 3 days). 'month' gives daily points, 'semi-annual' and 'annual' weekly points up to 12 months back. Same price for any period.",
            "default": "quarter"
          },
          "productUrls": {
            "title": "Product links or IDs",
            "type": "array",
            "description": "TCGplayer product links (https://www.tcgplayer.com/product/42382/pokemon-base-set-charizard) or numeric product IDs (42382), one per line, for example the 'productId' of a previous run. Used by products and priceHistory modes, for collections or watch lists you run on a schedule. An invalid link returns a free INVALID_PRODUCT row; a removed product a free PRODUCT_NOT_FOUND row.",
            "items": {
              "type": "string"
            }
          },
          "compareWithPreviousRun": {
            "title": "Compare prices with the previous run",
            "type": "boolean",
            "description": "Keeps the last market price of every product in a key-value store on your account (named after this input, or after 'Snapshot name') and adds to each product row: previousPrice, priceChange, priceChangePct, isNewProduct, firstSeenAt and previousSeenAt. On the first run every product is new. Every product is still delivered. Save the input as a Task and schedule it daily to see what changed since the previous run. Not used in the price history mode.",
            "default": false
          },
          "snapshotName": {
            "title": "Snapshot name (optional)",
            "type": "string",
            "description": "Name of the price history to compare with. Leave empty to derive it from the search terms, product links and filters of this input (the same input always compares with itself). Set a new name to start a fresh history."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Default: Apify datacenter proxy, which works for TCGplayer. Change it only if you see rows with errorCode BLOCKED."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}