{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cspriceapi-com/json-schema/cspriceapi-com-steam-market-response-schema.json",
  "title": "SteamMarketResponse",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cspriceapi-com-steam-api-openapi.yml#/components/schemas/SteamMarketResponse",
  "allOf": [
    {
      "$ref": "#/$defs/BaseWrapper"
    },
    {
      "type": "object",
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SteamMarketItem"
          }
        },
        "meta": {
          "$ref": "#/$defs/SteamMarketMeta"
        },
        "source": {
          "type": "string",
          "enum": [
            "Steam Community Market"
          ]
        }
      },
      "required": [
        "data",
        "meta",
        "source"
      ]
    }
  ],
  "$defs": {
    "BaseWrapper": {
      "type": "object",
      "description": "Envelope fields returned by every `GET /v1/prices/*` response.",
      "properties": {
        "source": {
          "type": "string",
          "description": "Human-readable marketplace identifier."
        },
        "requestor": {
          "type": "string",
          "format": "email",
          "description": "Email address associated with the API key making the call."
        },
        "plan": {
          "type": "string",
          "description": "Plan of the API key (e.g. `free`, `pro`, `enterprise`)."
        },
        "timestamp": {
          "allOf": [
            {
              "$ref": "#/$defs/UpdatedAt"
            }
          ],
          "description": "Server time when this response was produced."
        }
      },
      "required": [
        "source",
        "timestamp"
      ]
    },
    "DecimalString": {
      "type": "string",
      "description": "Fixed-point decimal value serialized as a string (preserves precision\nacross languages). Parse with an arbitrary-precision decimal library;\ndo **not** parse as a native float.\n",
      "pattern": "^-?\\d+(\\.\\d+)?$"
    },
    "Exterior": {
      "type": [
        "string",
        "null"
      ],
      "description": "Exterior (wear) of the skin. Typical values: `Factory New`,\n`Minimal Wear`, `Field-Tested`, `Well-Worn`, `Battle-Scarred`.\nCasing may vary between sources (e.g. Buff163 uses `\"Factory new\"`).\n"
    },
    "SteamMarketItem": {
      "type": "object",
      "description": "Steam Community Market snapshot for one catalog skin. Includes spread\nmetrics, order book depth, and internal liquidity score.\n",
      "properties": {
        "market_hash_name": {
          "type": "string"
        },
        "stattrak": {
          "$ref": "#/$defs/TinyBool"
        },
        "souvenir": {
          "$ref": "#/$defs/TinyBool"
        },
        "exterior": {
          "$ref": "#/$defs/Exterior"
        },
        "item_page_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "item_nameid": {
          "type": [
            "integer",
            "null"
          ]
        },
        "currency": {
          "type": "string"
        },
        "liquidity": {
          "allOf": [
            {
              "$ref": "#/$defs/DecimalString"
            }
          ],
          "nullable": true
        },
        "best_ask": {
          "allOf": [
            {
              "$ref": "#/$defs/DecimalString"
            }
          ],
          "nullable": true
        },
        "ask_listings": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Listing count at the best ask (Steam histogram `sell_order_count`)."
        },
        "best_bid": {
          "allOf": [
            {
              "$ref": "#/$defs/DecimalString"
            }
          ],
          "nullable": true
        },
        "bid_orders": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Highest-bid order count from histogram."
        },
        "spread": {
          "allOf": [
            {
              "$ref": "#/$defs/DecimalString"
            }
          ],
          "nullable": true,
          "description": "best_ask − best_bid"
        },
        "spread_pct": {
          "allOf": [
            {
              "$ref": "#/$defs/DecimalString"
            }
          ],
          "nullable": true,
          "description": "Spread as % of best_ask."
        },
        "bucket": {
          "type": [
            "integer",
            "null"
          ],
          "enum": [
            1,
            2,
            3
          ],
          "description": "Collector refresh tier."
        },
        "collected_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "updated_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "orderbook": {
          "allOf": [
            {
              "$ref": "#/$defs/SteamOrderbook"
            }
          ],
          "nullable": true
        }
      },
      "required": [
        "market_hash_name",
        "currency",
        "updated_at"
      ]
    },
    "SteamMarketMeta": {
      "type": "object",
      "properties": {
        "count": {
          "type": "integer"
        },
        "currency": {
          "type": "string"
        },
        "filtered": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Present when `market_hash_name` filter was applied."
        },
        "bucket": {
          "type": "integer",
          "enum": [
            1,
            2,
            3
          ],
          "description": "Present when `bucket` query filter was applied."
        }
      }
    },
    "SteamOrderbook": {
      "type": "object",
      "description": "Normalized bid/ask ladder from Steam order histogram.",
      "properties": {
        "ask_levels": {
          "type": "integer"
        },
        "bid_levels": {
          "type": "integer"
        },
        "asks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SteamOrderbookLevel"
          }
        },
        "bids": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SteamOrderbookLevel"
          }
        }
      }
    },
    "SteamOrderbookLevel": {
      "type": "object",
      "properties": {
        "price": {
          "allOf": [
            {
              "$ref": "#/$defs/DecimalString"
            }
          ]
        },
        "quantity": {
          "type": "integer"
        }
      },
      "required": [
        "price",
        "quantity"
      ]
    },
    "TinyBool": {
      "type": [
        "integer",
        "null"
      ],
      "enum": [
        0,
        1
      ],
      "description": "Boolean stored as `tinyint(1)`; `0` = false, `1` = true."
    },
    "UpdatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "ISO-8601 UTC timestamp (millisecond precision)."
    }
  }
}