{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pokefocus-com/json-schema/pokefocus-com-card-schema.json",
  "title": "Card",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pokefocus-com-openapi.json#/components/schemas/Card",
  "type": "object",
  "required": [
    "id",
    "name",
    "url",
    "market",
    "recentSales",
    "affiliateDisclosure"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "number": {
      "type": [
        "string",
        "null"
      ]
    },
    "rarity": {
      "type": [
        "string",
        "null"
      ]
    },
    "printing": {
      "type": [
        "string",
        "null"
      ]
    },
    "set": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": "string"
        },
        "year": {
          "type": [
            "integer",
            "null"
          ]
        },
        "imageUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "The set logo."
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "The set card list on PokeFocus."
        },
        "sealedUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "The set sealed products on PokeFocus."
        }
      }
    },
    "imageUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "The PokeFocus card page with price history."
    },
    "tcgplayerUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "The card on TCGplayer (affiliate link)."
    },
    "market": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "price": {
          "type": [
            "number",
            "null"
          ],
          "description": "US dollars."
        },
        "asOf": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "stale": {
          "type": "boolean",
          "description": "TCGplayer stopped refreshing the price; it is the last known one, not current."
        },
        "change7dPercent": {
          "type": [
            "number",
            "null"
          ]
        },
        "change30dPercent": {
          "type": [
            "number",
            "null"
          ]
        },
        "low30d": {
          "type": [
            "number",
            "null"
          ],
          "description": "Lowest daily market price in the last 30 days, US dollars."
        },
        "high30d": {
          "type": [
            "number",
            "null"
          ],
          "description": "Highest daily market price in the last 30 days, US dollars."
        },
        "rsi14": {
          "type": [
            "object",
            "null"
          ],
          "description": "The overbought/oversold reading of the market price, as the card page shows it.",
          "properties": {
            "value": {
              "type": "number",
              "description": "14-day RSI, 0 to 100."
            },
            "band": {
              "type": "string",
              "enum": [
                "oversold",
                "neutral",
                "overbought"
              ],
              "description": "Oversold at RSI 30 or below with a 5%+ fall over 14 days; overbought at 70 or above with a 5%+ rise; otherwise neutral."
            },
            "change14dPercent": {
              "type": [
                "number",
                "null"
              ]
            }
          }
        },
        "history": {
          "type": "array",
          "description": "Daily TCGplayer market price for 90 days, oldest first, as the card page charts it.",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string"
              },
              "price": {
                "type": "number"
              }
            }
          }
        }
      }
    },
    "soldMedians": {
      "type": "object",
      "description": "Stored verified sold medians and sale counts by grade, US dollars.",
      "properties": {
        "raw": {
          "type": "object",
          "properties": {
            "median7d": {
              "type": [
                "number",
                "null"
              ]
            },
            "median30d": {
              "type": [
                "number",
                "null"
              ]
            },
            "sales7d": {
              "type": [
                "number",
                "null"
              ]
            },
            "sales30d": {
              "type": [
                "number",
                "null"
              ]
            }
          }
        },
        "psa9": {
          "type": "object",
          "properties": {
            "median7d": {
              "type": [
                "number",
                "null"
              ]
            },
            "median30d": {
              "type": [
                "number",
                "null"
              ]
            },
            "sales7d": {
              "type": [
                "number",
                "null"
              ]
            },
            "sales30d": {
              "type": [
                "number",
                "null"
              ]
            }
          }
        },
        "psa10": {
          "type": "object",
          "properties": {
            "median7d": {
              "type": [
                "number",
                "null"
              ]
            },
            "median30d": {
              "type": [
                "number",
                "null"
              ]
            },
            "sales7d": {
              "type": [
                "number",
                "null"
              ]
            },
            "sales30d": {
              "type": [
                "number",
                "null"
              ]
            }
          }
        }
      }
    },
    "grades": {
      "type": [
        "object",
        "null"
      ],
      "description": "The card page's grade table: live 30-day verified sold median and sale count for raw, PSA 9, and PSA 10. A median needs one raw sale or three graded sales.",
      "properties": {
        "raw": {
          "type": "object",
          "properties": {
            "soldMedian30d": {
              "type": [
                "number",
                "null"
              ],
              "description": "Median verified sale in the last 30 days, US dollars."
            },
            "sales30d": {
              "type": [
                "number",
                "null"
              ]
            }
          }
        },
        "psa9": {
          "type": "object",
          "properties": {
            "soldMedian30d": {
              "type": [
                "number",
                "null"
              ],
              "description": "Median verified sale in the last 30 days, US dollars."
            },
            "sales30d": {
              "type": [
                "number",
                "null"
              ]
            }
          }
        },
        "psa10": {
          "type": "object",
          "properties": {
            "soldMedian30d": {
              "type": [
                "number",
                "null"
              ],
              "description": "Median verified sale in the last 30 days, US dollars."
            },
            "sales30d": {
              "type": [
                "number",
                "null"
              ]
            }
          }
        }
      }
    },
    "psa10Multiple": {
      "type": [
        "number",
        "null"
      ],
      "description": "The PSA 10 sold median as a multiple of the raw price."
    },
    "recentSales": {
      "type": "object",
      "description": "Verified recent sales for the requested grade and range, as the card page charts them, newest first: the day and price of each sale.",
      "properties": {
        "grade": {
          "type": "string",
          "description": "Raw, PSA 9, or PSA 10."
        },
        "range": {
          "type": "string",
          "enum": [
            "7d",
            "30d",
            "90d"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "complete",
            "partial",
            "empty",
            "unavailable"
          ],
          "description": "complete: the median and count cover every verified sale in the range; partial: the range had more sales than one read holds, so the median and count come from the server total; empty: no verified sales; unavailable: sales could not be read this time."
        },
        "median": {
          "type": [
            "number",
            "null"
          ],
          "description": "Median verified sale in the range, US dollars."
        },
        "count": {
          "type": "number"
        },
        "asOf": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "sales": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Sale day (UTC), YYYY-MM-DD."
              },
              "price": {
                "type": "number",
                "description": "Sold price, US dollars."
              }
            }
          }
        }
      }
    },
    "affiliateDisclosure": {
      "type": "string",
      "description": "The affiliate disclosure that applies to the TCGplayer links."
    },
    "capturedAt": {
      "type": "string",
      "format": "date-time",
      "description": "When PokeFocus answered; market.asOf is when a price was refreshed."
    }
  }
}