{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/alpaca/json-schema/alpaca-bars-response-schema.json",
  "title": "BarsResponse",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/alpaca-crypto-pricing-data-api-api-openapi.yml#/components/schemas/BarsResponse",
  "type": "object",
  "properties": {
    "bars": {
      "type": "array",
      "uniqueItems": true,
      "minItems": 1,
      "description": "The array of Bar data",
      "items": {
        "$ref": "#/$defs/Bar"
      }
    },
    "symbol": {
      "type": "string",
      "minLength": 1,
      "description": "the stock ticker or crypto symbol this set of bar data is for"
    },
    "next_page_token": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1
    }
  },
  "required": [
    "bars",
    "symbol",
    "next_page_token"
  ],
  "$defs": {
    "Bar": {
      "title": "Bar",
      "type": "object",
      "description": "The bars API returns aggregate historical data for the requested securities.\n",
      "properties": {
        "t": {
          "type": "string",
          "description": "Timestamp in RFC-3339 format with nanosecond precision.",
          "format": "date-time"
        },
        "x": {
          "type": "string",
          "description": "Exchange. Only present on Bars for Crypto symbols",
          "enum": [
            "FTXU",
            "ERSX",
            "CBSE"
          ]
        },
        "o": {
          "type": "number",
          "description": "Open price"
        },
        "h": {
          "type": "number",
          "description": "High price."
        },
        "l": {
          "type": "number",
          "description": "Low price.\n"
        },
        "c": {
          "type": "number",
          "description": "Close price."
        },
        "v": {
          "description": "Volume.",
          "type": "number"
        },
        "n": {
          "type": "integer",
          "description": "Number of trades.",
          "format": "int64"
        },
        "vw": {
          "description": "Volume weighted average price.",
          "type": "number"
        }
      },
      "required": [
        "t",
        "o",
        "h",
        "l",
        "c",
        "v"
      ]
    }
  }
}