{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/valotcg/json-schema/valotcg-sealed-price-history-schema.json",
  "title": "SealedPriceHistory",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/valotcg-data-v1-openapi.json#/components/schemas/SealedPriceHistory",
  "properties": {
    "source": {
      "type": "string",
      "enum": [
        "cardmarket",
        "us_market",
        "ebay"
      ],
      "title": "Source"
    },
    "variant": {
      "type": "string",
      "enum": [
        "default",
        "foil"
      ],
      "title": "Variant"
    },
    "market_language": {
      "type": "string",
      "enum": [
        "fr",
        "en",
        "global"
      ],
      "title": "Market Language",
      "description": "Language of the listings behind the curve, as on current prices: `fr` for French Cardmarket listings (cheapest offer, collected weekly at best), `en` for the US market, `global` otherwise."
    },
    "from": {
      "type": "string",
      "format": "date",
      "title": "From"
    },
    "to": {
      "type": "string",
      "format": "date",
      "title": "To"
    },
    "points": {
      "items": {
        "$ref": "#/$defs/HistoryPoint"
      },
      "type": "array",
      "title": "Points",
      "description": "One point per observed day; gaps are not interpolated."
    },
    "sealed_id": {
      "type": "integer",
      "title": "Sealed Id"
    }
  },
  "type": "object",
  "required": [
    "source",
    "variant",
    "market_language",
    "from",
    "to",
    "points",
    "sealed_id"
  ],
  "$defs": {
    "HistoryPoint": {
      "properties": {
        "date": {
          "type": "string",
          "format": "date",
          "title": "Date"
        },
        "amount": {
          "type": "number",
          "title": "Amount"
        },
        "currency": {
          "type": "string",
          "enum": [
            "EUR",
            "USD"
          ],
          "title": "Currency"
        },
        "metric": {
          "type": "string",
          "enum": [
            "trend",
            "low",
            "market",
            "sold_median_raw"
          ],
          "title": "Metric"
        },
        "sales_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sales Count",
          "description": "eBay only: sales that day."
        },
        "condition": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "NM",
                "EX",
                "GD",
                "LP",
                "PL",
                "PO"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Condition",
          "description": "French Cardmarket listings only: condition of the offer kept that day (best available, NM first, unless the `condition` filter is set)."
        }
      },
      "type": "object",
      "required": [
        "date",
        "amount",
        "currency",
        "metric"
      ],
      "title": "HistoryPoint"
    }
  }
}