{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/soldgraph-com/json-schema/soldgraph-com-tcgplayer-search-job-schema.json",
  "title": "TcgplayerSearchJob",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/soldgraph-com-tcgplayer-api-openapi.yml#/components/schemas/TcgplayerSearchJob",
  "type": "object",
  "required": [
    "request_id",
    "status",
    "credits",
    "cached"
  ],
  "properties": {
    "request_id": {
      "type": "string",
      "description": "ID of this request. Poll it at /v1/jobs/{request_id}."
    },
    "status": {
      "type": "string",
      "description": "pending, complete or failed. Always check it, even on HTTP 200.",
      "enum": [
        "pending",
        "complete",
        "failed"
      ]
    },
    "credits": {
      "type": "integer",
      "description": "Requests charged: 1 when complete, 0 for a page past the last one, while pending, or when failed."
    },
    "cached": {
      "type": "boolean",
      "description": "True when the result came from the 15-minute cache."
    },
    "poll_url": {
      "type": "string",
      "description": "Only while pending. A path like /v1/jobs/{id}: join it to https://api.soldgraph.com, not to the /v1 base URL."
    },
    "result": {
      "$ref": "#/$defs/TcgplayerSearchPage"
    },
    "error": {
      "type": "object",
      "required": [
        "code"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "page_mismatch",
            "schema",
            "network",
            "upstream",
            "throttled",
            "blocked",
            "rejected",
            "not_found",
            "filter_not_supported",
            "filter_not_applied",
            "location_not_served",
            "auth",
            "daily_limit",
            "deadline_exceeded",
            "credential_storage"
          ],
          "description": "Failed job code."
        },
        "message": {
          "type": "string",
          "description": "What the code means, in plain words."
        }
      }
    }
  },
  "$defs": {
    "Money": {
      "type": "object",
      "required": [
        "amount",
        "currency"
      ],
      "properties": {
        "amount": {
          "type": "number"
        },
        "currency": {
          "type": "string",
          "description": "ISO 4217 code, like USD."
        }
      }
    },
    "TcgplayerSearchPage": {
      "type": "object",
      "required": [
        "provider",
        "country",
        "query",
        "page",
        "count",
        "reported_total",
        "next_page",
        "collected_at",
        "schema_version",
        "completeness",
        "field_notes",
        "page_size",
        "summary",
        "reported_total",
        "next_cursor",
        "data"
      ],
      "properties": {
        "provider": {
          "type": "string",
          "description": "Marketplace ID, like ebay or poshmark."
        },
        "country": {
          "type": "string",
          "description": "The country searched: us, or on eBay the country you sent."
        },
        "query": {
          "type": "string",
          "description": "The q you sent, with extra spaces removed."
        },
        "page": {
          "type": "integer",
          "description": "The page you asked for."
        },
        "count": {
          "type": "integer",
          "description": "Rows in result.data on this page."
        },
        "reported_total": {
          "type": "integer",
          "description": "Source-reported result count for this response."
        },
        "next_page": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Send this as page to get the next page. Null on the last page, and on page 100, the deepest page served."
        },
        "collected_at": {
          "type": "string",
          "description": "When we collected the page, as an ISO 8601 timestamp."
        },
        "schema_version": {
          "type": "integer",
          "description": "Version of the result's shape for that marketplace: 1 or 2. It only rises when a field changes meaning."
        },
        "completeness": {
          "type": "string",
          "description": "provider_page_only: one page as the marketplace served it, not a full history. TCGplayer recent sales say recent_sample_only."
        },
        "field_notes": {
          "type": "string",
          "description": "Plain-text notes on how to read this page's fields."
        },
        "page_size": {
          "type": "integer",
          "description": "Number of source rows in this response."
        },
        "summary": {
          "type": "object",
          "properties": {
            "priced_count": {
              "type": "integer",
              "description": "Rows on this page that show one price."
            },
            "currency": {
              "type": "string",
              "description": "Currency of the amounts below."
            },
            "median": {
              "type": [
                "number",
                "null"
              ],
              "description": "Middle displayed price of those rows."
            },
            "low": {
              "type": [
                "number",
                "null"
              ],
              "description": "Lowest displayed price."
            },
            "high": {
              "type": [
                "number",
                "null"
              ],
              "description": "Highest displayed price."
            },
            "p25": {
              "type": [
                "number",
                "null"
              ],
              "description": "First-quartile displayed price: a quarter of priced rows are at or below it."
            },
            "p75": {
              "type": [
                "number",
                "null"
              ],
              "description": "Third-quartile displayed price. With `p25`, a range that ignores a stray accessory or parts listing."
            }
          },
          "required": [
            "priced_count",
            "currency",
            "median",
            "low",
            "high",
            "p25",
            "p75"
          ],
          "description": "Price maths over market_price for the products on this page: priced_count, currency, median, low, high, p25 and p75. Products with no market price are left out of the maths, never removed from data."
        },
        "next_cursor": {
          "type": [
            "string",
            "null"
          ],
          "description": "Always null; use next_page for offset pagination."
        },
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TcgplayerSearchRow"
          }
        }
      }
    },
    "TcgplayerSearchRow": {
      "type": "object",
      "required": [
        "product_id",
        "name",
        "link",
        "product_line",
        "set_name",
        "set_code",
        "card_number",
        "rarity",
        "market_price",
        "lowest_ask",
        "lowest_ask_with_shipping",
        "listed_median",
        "active_listing_count",
        "offers"
      ],
      "properties": {
        "product_id": {
          "type": "integer",
          "description": "Canonical TCGplayer product ID."
        },
        "name": {
          "type": "string",
          "description": "Product title."
        },
        "link": {
          "type": "string",
          "description": "Public product page."
        },
        "product_line": {
          "type": [
            "string",
            "null"
          ],
          "description": "TCGplayer game or product line."
        },
        "set_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Set name."
        },
        "set_code": {
          "type": [
            "string",
            "null"
          ],
          "description": "Set code."
        },
        "card_number": {
          "type": [
            "string",
            "null"
          ],
          "description": "Card number when supplied."
        },
        "rarity": {
          "type": [
            "string",
            "null"
          ],
          "description": "Source rarity when supplied."
        },
        "market_price": {
          "oneOf": [
            {
              "$ref": "#/$defs/Money"
            },
            {
              "type": "null"
            }
          ],
          "description": "TCGplayer estimate calculated from completed sales, not an individual sale."
        },
        "lowest_ask": {
          "oneOf": [
            {
              "$ref": "#/$defs/Money"
            },
            {
              "type": "null"
            }
          ],
          "description": "Lowest advertised seller ask, before shipping."
        },
        "lowest_ask_with_shipping": {
          "oneOf": [
            {
              "$ref": "#/$defs/Money"
            },
            {
              "type": "null"
            }
          ],
          "description": "Source estimate of lowest ask including shipping."
        },
        "listed_median": {
          "oneOf": [
            {
              "$ref": "#/$defs/Money"
            },
            {
              "type": "null"
            }
          ],
          "description": "Median advertised ask when available."
        },
        "active_listing_count": {
          "type": "integer",
          "description": "Source-reported number of active listings."
        },
        "offers": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Up to three current seller-offer snapshots with asking and shipping prices."
        }
      }
    }
  }
}