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

# Get Index Historical Data

> [OpenAPI JSON Spec](/docs/output/v1_macro_index_historical_get.json)
Retrieve historical data for a specified stock index symbol. Returns time series data including open, high, low, close prices and volume.

**Response Data Structure**

- `data` ([]IndexData): Array of historical index data

**IndexData fields:**
- `symbol` (string): Index symbol (e.g., "^SPX", "^DJI")
- `date` (string): Date in YYYY-MM-DD format
- `open` (float): Opening price
- `high` (float): Highest price
- `low` (float): Lowest price
- `close` (float): Closing price
- `volume` (int): Trading volume

Bars are returned newest-first (date descending) by default. Pass `sort_order=asc` for chronological (oldest-first) order, which most time-series/technical-analysis consumers expect.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/macro/index/historical
openapi: 3.0.0
info:
  contact: {}
  description: >-
    Welcome to Arrays!


    Arrays is a unified financial data layer for both financial institutions and
    retail users, delivering comprehensive market data across crypto and equity
    markets. Our datasets cover fundamentals, ETFs, options, crypto, and more.


    Visit [arrays.org](https://arrays.org) to request an API key and start your
    free trial. You can explore our full API offerings in the documentation
    below.


    For any questions regarding APIs or pricing, please contact
    support@arrays.org.
  title: Arrays API
  version: '1.0'
servers:
  - url: https://data-tools.prd.arrays.org/api
security: []
paths:
  /v1/macro/index/historical:
    get:
      tags:
        - Macro
      summary: Get Index Historical Data
      description: >-
        [OpenAPI JSON Spec](/docs/output/v1_macro_index_historical_get.json)

        Retrieve historical data for a specified stock index symbol. Returns
        time series data including open, high, low, close prices and volume.


        **Response Data Structure**


        - `data` ([]IndexData): Array of historical index data


        **IndexData fields:**

        - `symbol` (string): Index symbol (e.g., "^SPX", "^DJI")

        - `date` (string): Date in YYYY-MM-DD format

        - `open` (float): Opening price

        - `high` (float): Highest price

        - `low` (float): Lowest price

        - `close` (float): Closing price

        - `volume` (int): Trading volume


        Bars are returned newest-first (date descending) by default. Pass
        `sort_order=asc` for chronological (oldest-first) order, which most
        time-series/technical-analysis consumers expect.
      parameters:
        - description: >-
            Index symbol. Accepts the roster form (^SPX, DX-Y.NYB), the bare
            form (SPX), or a common alias (DXY, GSPC, 10Y). See
            /v1/macro/index/symbols for the full list.
          in: query
          name: symbol
          required: true
          schema:
            type: string
        - description: Start time (Unix timestamp in seconds)
          in: query
          name: start_time
          required: true
          schema:
            type: integer
            format: int64
        - description: End time (Unix timestamp in seconds)
          in: query
          name: end_time
          required: true
          schema:
            type: integer
            format: int64
        - description: >-
            Sort order by date: desc (default, newest first) or asc (oldest
            first)
          in: query
          name: sort_order
          schema:
            type: string
            enum:
              - asc
              - desc
      responses:
        '200':
          description: Successfully retrieved index historical data
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/model.APIResponse'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/model.IndexData'
                        type: array
                    type: object
        '400':
          description: Invalid parameters
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/model.APIResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/model.APIError'
                    type: object
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/model.APIResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/model.APIError'
                    type: object
      security:
        - ApiKeyAuth: []
components:
  schemas:
    model.APIResponse:
      properties:
        data: {}
        error:
          $ref: '#/components/schemas/model.APIError'
        metadata: {}
        pagination: {}
        request_id:
          type: string
        success:
          type: boolean
      type: object
    model.IndexData:
      properties:
        change:
          example: 6.25
          type: number
        change_percent:
          example: 0.13
          type: number
        close:
          example: 4756.5
          type: number
        date:
          example: '2024-01-01'
          type: string
        high:
          example: 4765.89
          type: number
        low:
          example: 4742.15
          type: number
        open:
          example: 4750.25
          type: number
        symbol:
          example: ^SPX
          type: string
        volume:
          example: 1234567
          type: integer
        vwap:
          example: 4753.45
          type: number
      type: object
    model.APIError:
      properties:
        code:
          example: RESOURCE_NOT_FOUND
          type: string
        details:
          items:
            $ref: '#/components/schemas/model.APIErrorDetail'
          type: array
        docs_url:
          type: string
        examples:
          items:
            type: string
          type: array
        hint:
          type: string
        message:
          example: The requested resource was not found.
          type: string
        suggestions:
          items:
            type: string
          type: array
      type: object
    model.APIErrorDetail:
      properties:
        field:
          type: string
        got:
          type: string
        reason:
          type: string
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: 'API Key authentication. Example: "your-api-key-here"'
      in: header
      name: X-API-Key
      type: apiKey

````