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

# Get Historical Chart Data

> Retrieves historical price bars (OHLCV - Open, High, Low, Close, Volume) for a specific symbol within a date range. This endpoint supports various time resolutions from seconds to months. The data is returned in arrays format optimized for charting libraries, with timestamps in Unix format (seconds).



## OpenAPI

````yaml https://spec.speakeasy.com/aries/aries/aries-trading-platform-api-with-code-samples get /v1/chart/history
openapi: 3.0.3
info:
  title: Aries Trading Platform API
  description: >-
    Complete API documentation for the Aries trading platform including user
    management, authentication, account management, order management, market
    data, and analytics
  contact:
    name: Aries Financial
    email: dev@aries.com
  version: 1.0.0
servers:
  - url: https://api.tradearies.dev
    description: Production server
security: []
tags:
  - name: Accounts
    description: Account management endpoints for positions, orders, and balances
  - name: Analytics
    description: >-
      Analytics endpoints for market data analysis including top gainers,
      losers, volume leaders, sector analysis, analyst ratings, market breadth,
      and net inflow
  - name: Authentication
    description: User authentication endpoints
  - name: Calendars
    description: Calendar endpoints for economic events and historical data
  - name: Market Data
    description: >-
      Market data endpoints for symbol search, real-time data access, and equity
      details
  - name: Orders
    description: >-
      Order management endpoints for placing, updating, canceling, and
      previewing orders
  - name: Users
    description: User management endpoints
  - name: Health
    description: Service health endpoints
paths:
  /v1/chart/history:
    get:
      tags:
        - Chart
      summary: Get Historical Chart Data
      description: >-
        Retrieves historical price bars (OHLCV - Open, High, Low, Close, Volume)
        for a specific symbol within a date range. This endpoint supports
        various time resolutions from seconds to months. The data is returned in
        arrays format optimized for charting libraries, with timestamps in Unix
        format (seconds).
      operationId: getChartHistory
      parameters:
        - name: symbol
          in: query
          description: Stock symbol to fetch historical data for
          required: true
          schema:
            type: string
          example: AAPL
        - name: resolution
          in: query
          description: >-
            Bar resolution: '1', '5', '15', '30', '60' (minutes), '240' (4
            hours), 'D'/'1D' (daily), 'W'/'1W' (weekly), 'M'/'1M' (monthly)
          required: true
          schema:
            type: string
            enum:
              - '1'
              - '5'
              - '15'
              - '30'
              - '60'
              - '240'
              - D
              - W
              - M
              - 1D
              - 1W
              - 1M
          example: '60'
        - name: from
          in: query
          description: >-
            Start time as Unix timestamp in seconds (or milliseconds, will be
            auto-converted)
          required: true
          schema:
            type: integer
            minimum: 1
            format: int64
          example: 1672531200
        - name: to
          in: query
          description: >-
            End time as Unix timestamp in seconds (or milliseconds, will be
            auto-converted). Must be greater than 'from' parameter.
          required: true
          schema:
            type: integer
            minimum: 1
            format: int64
          example: 1675209600
      responses:
        '200':
          description: Historical chart data retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChartBars'
              examples:
                success:
                  value:
                    s: ok
                    t:
                      - 1672531200
                      - 1672534800
                      - 1672538400
                    c:
                      - 130.15
                      - 130.89
                      - 131.24
                    o:
                      - 129.93
                      - 130.15
                      - 130.89
                    h:
                      - 130.28
                      - 131.05
                      - 131.37
                    l:
                      - 129.88
                      - 130.09
                      - 130.81
                    v:
                      - 1234567
                      - 1345678
                      - 1456789
                    nextTime: 1672542000
                noData:
                  value:
                    s: no_data
                    errmsg: No data available for the requested period
                error:
                  value:
                    s: error
                    errmsg: Failed to fetch historical data
        '400':
          description: Bad request - invalid or missing parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                missingSymbol:
                  value:
                    error: symbol is required
                invalidResolution:
                  value:
                    error: >-
                      Invalid resolution. Must be one of: 1, 5, 15, 30, 60, 240,
                      D, W, M
                invalidTimeRange:
                  value:
                    error: '''to'' parameter must be greater than ''from'' parameter'
        '401':
          description: Unauthorized - invalid authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from finance_dev import FinanceDev, models
            import os


            with FinanceDev(
                security=models.Security(
                    client_id=os.getenv("FINANCEDEV_CLIENT_ID", ""),
                    client_secret=os.getenv("FINANCEDEV_CLIENT_SECRET", ""),
                ),
            ) as fd_client:

                res = fd_client.chart.get_chart_history(symbol="AAPL", resolution=models.Resolution.SIXTY, from_=1672531200, to=1675209600, include_extended=False)

                # Handle response
                print(res)
        - lang: java
          label: Java (SDK)
          source: >-
            package hello.world;


            import java.lang.Exception;

            import org.openapis.openapi.AriesJava;

            import org.openapis.openapi.models.errors.ErrorResponse;

            import
            org.openapis.openapi.models.operations.GetChartHistoryResolution;

            import
            org.openapis.openapi.models.operations.GetChartHistoryResponse;


            public class Application {

                public static void main(String[] args) throws ErrorResponse, Exception {

                    AriesJava sdk = AriesJava.builder()
                            .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
                        .build();

                    GetChartHistoryResponse res = sdk.chart().getHistory()
                            .symbol("AAPL")
                            .resolution(GetChartHistoryResolution.SIXTY)
                            .from(1672531200L)
                            .to(1675209600L)
                            .call();

                    if (res.chartBars().isPresent()) {
                        // handle response
                    }
                }
            }
components:
  schemas:
    ChartBars:
      type: object
      properties:
        s:
          type: string
          enum:
            - ok
            - no_data
            - error
          description: Status of the response
        errmsg:
          type: string
          description: Error message (only present if s='error' or s='no_data')
        t:
          type: array
          items:
            type: integer
            format: int64
          description: Array of bar timestamps (Unix time in seconds)
        c:
          type: array
          items:
            type: number
          description: Array of close prices
        o:
          type: array
          items:
            type: number
          description: Array of open prices
        h:
          type: array
          items:
            type: number
          description: Array of high prices
        l:
          type: array
          items:
            type: number
          description: Array of low prices
        v:
          type: array
          items:
            type: integer
            format: int64
          description: Array of volumes
        nextTime:
          type: integer
          format: int64
          description: Next expected bar time (optional)
      required:
        - s
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
        codes:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                description: Error code
              description:
                type: string
                description: Error description
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````