{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cspriceapi-com/json-schema/cspriceapi-com-market-sales-search-response-schema.json",
  "title": "MarketSalesSearchResponse",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cspriceapi-com-sales-data-api-openapi.yml#/components/schemas/MarketSalesSearchResponse",
  "type": "object",
  "properties": {
    "market_hash_names": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "count": {
      "type": "integer"
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MarketSaleSearchItem"
      }
    },
    "source": {
      "type": "string"
    },
    "requestor": {
      "type": "string",
      "format": "email"
    },
    "plan": {
      "type": "string"
    },
    "timestamp": {
      "$ref": "#/$defs/UpdatedAt"
    }
  },
  "required": [
    "market_hash_names",
    "count",
    "data",
    "source",
    "timestamp"
  ],
  "$defs": {
    "MarketSaleSearchItem": {
      "allOf": [
        {
          "$ref": "#/$defs/MarketSalesCsvSalesRow"
        },
        {
          "type": "object",
          "properties": {
            "stickers": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/MarketSalesCsvStickersRow"
              }
            },
            "keychains": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/MarketSalesCsvKeychainsRow"
              }
            }
          },
          "required": [
            "stickers",
            "keychains"
          ]
        }
      ]
    },
    "MarketSalesCsvKeychainsRow": {
      "description": "One row in `keychains.csv` inside the ZIP export.",
      "type": "object",
      "properties": {
        "marketplace": {
          "type": "string"
        },
        "sale_id": {
          "type": "string"
        },
        "sold_at": {
          "type": "string"
        },
        "position_idx": {
          "type": "integer"
        },
        "keychain_id": {
          "type": "string"
        },
        "slot": {
          "type": "integer"
        },
        "keychain_name": {
          "type": "string"
        },
        "pattern": {
          "type": "integer"
        },
        "offset_x": {
          "type": "number"
        },
        "offset_y": {
          "type": "number"
        },
        "offset_z": {
          "type": "number"
        },
        "reference_price": {
          "type": "integer"
        },
        "reference_quantity": {
          "type": "integer"
        },
        "reference_updated": {
          "type": "string"
        },
        "fetched_at": {
          "type": "string"
        }
      }
    },
    "MarketSalesCsvSalesRow": {
      "description": "One row in `sales.csv` inside the ZIP export.",
      "type": "object",
      "properties": {
        "marketplace": {
          "type": "string",
          "enum": [
            "csfloat",
            "youpin",
            "skinport"
          ]
        },
        "sale_id": {
          "type": "string",
          "description": "UInt64 as string."
        },
        "market_hash_name": {
          "type": "string"
        },
        "price": {
          "type": "integer",
          "description": "Sale price in cents."
        },
        "sold_at": {
          "type": "string"
        },
        "def_index": {
          "type": "integer"
        },
        "paint_index": {
          "type": "integer"
        },
        "paint_seed": {
          "type": "integer"
        },
        "float_value": {
          "type": "number"
        },
        "is_stattrak": {
          "type": "integer",
          "enum": [
            0,
            1
          ]
        },
        "is_souvenir": {
          "type": "integer",
          "enum": [
            0,
            1
          ]
        },
        "rarity": {
          "type": "integer"
        },
        "quality": {
          "type": "integer"
        },
        "cs2_img": {
          "type": "string"
        },
        "fetched_at": {
          "type": "string"
        }
      }
    },
    "MarketSalesCsvStickersRow": {
      "description": "One row in `stickers.csv` inside the ZIP export.",
      "type": "object",
      "properties": {
        "marketplace": {
          "type": "string"
        },
        "sale_id": {
          "type": "string"
        },
        "sold_at": {
          "type": "string"
        },
        "position_idx": {
          "type": "integer"
        },
        "sticker_id": {
          "type": "string"
        },
        "slot": {
          "type": "integer"
        },
        "sticker_name": {
          "type": "string"
        },
        "wear": {
          "type": "number"
        },
        "offset_x": {
          "type": "number"
        },
        "offset_y": {
          "type": "number"
        },
        "rotation": {
          "type": "number"
        },
        "reference_price": {
          "type": "integer",
          "description": "Reference price in cents."
        },
        "reference_quantity": {
          "type": "integer"
        },
        "reference_updated": {
          "type": "string"
        },
        "fetched_at": {
          "type": "string"
        }
      }
    },
    "UpdatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "ISO-8601 UTC timestamp (millisecond precision)."
    }
  }
}