> ## Documentation Index
> Fetch the complete documentation index at: https://docs.benzinga.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Historical Bars

> Retrieves historical OHLCV (Open, High, Low, Close, Volume) price bar data for specified securities. Returns aggregated price data based on the specified interval. Supports multiple ticker symbols and various time ranges including relative dates.

<ResponseExample>
  ```json Response (200 OK) theme={null}
  [
    {
      "symbol": "AAPL",
      "interval": 7200,
      "candles": [
        {
          "time": "1765202400000",
          "open": 278.11,
          "high": 279.6693,
          "low": 277.05,
          "close": 277.335,
          "volume": "9174901",
          "dateTime": "2025-12-08T09:00:00.000-05:00"
        },
        {
          "time": "1765209600000",
          "open": 277.335,
          "high": 277.88,
          "low": 276.7,
          "close": 277.33,
          "volume": "6501561",
          "dateTime": "2025-12-08T11:00:00.000-05:00"
        },
        {
          "time": "1765987200000",
          "open": 274.6,
          "high": 275.07,
          "low": 272.28,
          "close": 273.38,
          "volume": "7179965",
          "dateTime": "2025-12-17T11:00:00.000-05:00"
        },
        {
          "time": "1766073600000",
          "open": 272,
          "high": 273.164,
          "low": 269.94,
          "close": 272.4,
          "volume": "8374648",
          "dateTime": "2025-12-18T11:00:00.000-05:00"
        },
        {
          "time": "1766080800000",
          "open": 272.37,
          "high": 272.96,
          "low": 270.5,
          "close": 270.865,
          "volume": "6415588",
          "dateTime": "2025-12-18T13:00:00.000-05:00"
        },
        {
          "time": "1767636000000",
          "open": 267.57,
          "high": 267.89,
          "low": 266.14,
          "close": 266.61,
          "volume": "5846734",
          "dateTime": "2026-01-05T13:00:00.000-05:00"
        }
      ]
    }
  ]
  ```
</ResponseExample>


## OpenAPI

````yaml /openapi/data-api-proxy_api.spec.yml GET /api/v2/bars
openapi: 3.0.0
info:
  contact: {}
  description: >-
    This REST API provides endpoints to search for fundamentals and get
    fundamental details.
  termsOfService: http://swagger.io/terms/
  title: Data API Proxy
  version: 2.0.0
servers:
  - url: https://api.benzinga.com
    description: PROD
security: []
paths:
  /api/v2/bars:
    get:
      tags:
        - Market Data
      summary: Historical Price Bars
      description: >-
        Retrieves historical OHLCV (Open, High, Low, Close, Volume) price bar
        data for specified securities. Returns aggregated price data based on
        the specified interval. Supports multiple ticker symbols and various
        time ranges including relative dates.
      operationId: get-bars-v2
      parameters:
        - description: >-
            Comma-separated list of stock ticker symbols (e.g., AAPL,MSFT,TSLA).
            Required.
          in: query
          name: symbols
          required: true
          schema:
            type: string
        - description: >-
            Start date/time for bars. Formats: YYYY-MM-DD, YYYY-MM-DDTHH:MM:SS,
            YTD (year-to-date), or relative values like 1MONTH/1m/1M,
            1WEEK/1w/1W, 1DAY/1d/1D. Required.
          in: query
          name: from
          required: true
          schema:
            type: string
        - description: >-
            End date/time for bars. Format: YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS.
            Defaults to current date/time if not specified.
          in: query
          name: to
          schema:
            type: string
        - description: >-
            Time bucket interval for aggregating price bars. Supported values:
            1m (1 minute), 5m (5 minutes), 15m (15 minutes), 30m (30 minutes),
            1h (1 hour), 1d (1 day), 1w (1 week), 1M (1 month). Default: 1d
          in: query
          name: interval
          schema:
            type: string
        - description: >-
            Trading session filter. Supported values: ANY (all sessions),
            PRE_MARKET (pre-market trading), REGULAR (regular trading hours),
            AFTER_MARKET (after-hours trading). Default: ANY
          in: query
          name: session
          schema:
            type: string
      responses:
        '200':
          description: Array of chart data with OHLCV bars for each symbol
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/httpapi.Chart'
                type: array
        '400':
          description: Bad request - missing or invalid required parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bzhttp.Resp'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bzhttp.Resp'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    httpapi.Chart:
      properties:
        candles:
          items:
            properties:
              close:
                type: number
              dateTime:
                type: string
              high:
                type: number
              low:
                type: number
              open:
                type: number
              time:
                type: string
              volume:
                type: string
            type: object
          type: array
        interval:
          type: integer
        symbol:
          type: string
      type: object
    bzhttp.Resp:
      properties:
        data:
          additionalProperties: true
          type: object
        errors:
          items:
            $ref: '#/components/schemas/bzhttp.Error'
          type: array
        ok:
          type: boolean
      type: object
    bzhttp.Error:
      properties:
        code:
          $ref: '#/components/schemas/bzhttp.ErrorCode'
        id:
          type: string
        value:
          type: string
      type: object
    bzhttp.ErrorCode:
      enum:
        - unsupported_message_type
        - database_query_error
        - json_unmarshaling_error
        - no_data_found
        - no_matching_endpoint
        - bad_request
        - db_error
        - internal_server_error
        - auth_failed
        - forbidden
        - failed_dependency
        - service_unavailable
        - upstream_api_error
      type: string
      x-enum-varnames:
        - ErrorUnsupportedMessageType
        - ErrorDBQueryError
        - ErrorJSONUnmarshaling
        - ErrorNoDataFound
        - ErrorNoMatchingEndpoint
        - ErrorBadRequest
        - ErrorDBError
        - ErrorInternalServerError
        - ErrorAuthFailed
        - ErrorForbidden
        - ErrorFailedDependency
        - ErrorServiceUnavailable
        - ErrorUpstreamAPIError
  securitySchemes:
    ApiKeyAuth:
      in: query
      name: token
      type: apiKey

````