{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pokefocus-com/json-schema/pokefocus-com-card-search-schema.json",
  "title": "CardSearch",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pokefocus-com-openapi.json#/components/schemas/CardSearch",
  "type": "object",
  "required": [
    "query",
    "cards",
    "capturedAt"
  ],
  "properties": {
    "query": {
      "type": "string"
    },
    "match": {
      "type": "string",
      "enum": [
        "exact",
        "corrected",
        "partial"
      ],
      "description": "exact: the cards match every word. corrected: they match after a typo or nickname was fixed (see matchedQuery). partial: no card matched every word, so these leave out ignoredTerms and may be a different card; confirm the name, number, and set before using a price."
    },
    "matchedQuery": {
      "type": "string",
      "description": "The query as PokeFocus read and matched it."
    },
    "ignoredTerms": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Words a partial match left out."
    },
    "total": {
      "type": [
        "number",
        "null"
      ]
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "name",
          "url"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "PokeFocus card id."
          },
          "name": {
            "type": "string"
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "set": {
            "type": [
              "string",
              "null"
            ]
          },
          "year": {
            "type": [
              "integer",
              "null"
            ]
          },
          "rarity": {
            "type": [
              "string",
              "null"
            ]
          },
          "printing": {
            "type": [
              "string",
              "null"
            ]
          },
          "imageUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "marketPrice": {
            "type": [
              "number",
              "null"
            ],
            "description": "TCGplayer market price (Near Mint), US dollars."
          },
          "rawSalesMedian30d": {
            "type": [
              "number",
              "null"
            ],
            "description": "Median verified raw sale over 30 days, US dollars."
          },
          "psa10SalesMedian30d": {
            "type": [
              "number",
              "null"
            ],
            "description": "Median verified PSA 10 sale over 30 days, US dollars."
          },
          "rawSales30d": {
            "type": [
              "number",
              "null"
            ]
          },
          "psa10Sales30d": {
            "type": [
              "number",
              "null"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The PokeFocus card page."
          }
        }
      }
    },
    "capturedAt": {
      "type": "string",
      "format": "date-time",
      "description": "When PokeFocus answered; market.asOf is when a price was refreshed."
    }
  }
}