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

# Get Historical OHLC Data

> Fetch aggregated historical OHLC (Open, High, Low, Close) and volume data for a chosen stock symbol over a custom date range and interval in US Eastern Time (ET). Each bar is built exclusively from trades that meet specified criteria—if no eligible trades occur in an interval, no bar is generated, indicating a period of inactivity. You can adjust the multiplier and timespan parameters (for example, 5-minute bars) and include pre-market, regular market, and after-hours sessions. This level of control supports a wide array of analytical and visualization use cases.




## OpenAPI

````yaml get /v2/aggs/ticker/{symbol}/range/{multiplier}/{timespan}/{from}/{to}
openapi: 3.0.3
info:
  title: Finvera Stock Market API
  description: >
    The Finvera Stock Market API provides comprehensive, real-time, and
    historical market data for equities. It offers three primary categories of
    information:


    - **Trades:** Access tick-level executed trade data including price, size,
    timestamp, trade conditions, and exchange information. This granular data
    enables detailed analysis of trading activity and volume at specific points
    in time.


    - **Quotes:** Retrieve National Best Bid and Offer (NBBO) data featuring bid
    and ask prices, sizes, exchanges, trade conditions, and precise timestamps.
    This data is essential for understanding market depth, liquidity, and price
    discovery dynamics.


    - **Aggregates (Bars):** Obtain historical summary bars (OHLCV - open, high,
    low, close, volume, and volume-weighted average price) aggregated over
    customizable time intervals (e.g., daily, weekly). These aggregates provide
    a consolidated view of market performance over a given period for trend
    analysis and backtesting.


    This API enables developers and analysts to build robust trading, analytics,
    and financial applications by delivering accurate, timely, and
    well-structured market data tailored for diverse use cases, including
    real-time monitoring and historical research.
  version: 1.0.0
  contact:
    name: API Support
    email: support@finvera.news
  license:
    name: Proprietary
    url: https://finvera.news/terms
servers:
  - url: https://api.finvera.news/stocks
    description: Production server
security: []
tags:
  - name: Trades
    description: Retrieve comprehensive, tick-level trade data for a specified stock
  - name: Quotes
    description: Retrieve NBBO quotes for a specified stock
  - name: Custom Bars (OHLC)
    description: Retrieve aggregated historical OHLC data for a specified stock
paths:
  /v2/aggs/ticker/{symbol}/range/{multiplier}/{timespan}/{from}/{to}:
    get:
      tags:
        - Custom Bars (OHLC)
      description: >
        Fetch aggregated historical OHLC (Open, High, Low, Close) and volume
        data for a chosen stock symbol over a custom date range and interval in
        US Eastern Time (ET). Each bar is built exclusively from trades that
        meet specified criteria—if no eligible trades occur in an interval, no
        bar is generated, indicating a period of inactivity. You can adjust the
        multiplier and timespan parameters (for example, 5-minute bars) and
        include pre-market, regular market, and after-hours sessions. This level
        of control supports a wide array of analytical and visualization use
        cases.
      parameters:
        - name: symbol
          in: path
          required: true
          schema:
            type: string
        - name: multiplier
          in: path
          required: true
          schema:
            type: integer
            example: 1
        - name: timespan
          in: path
          required: true
          schema:
            type: string
            enum:
              - minute
              - hour
              - day
              - week
              - month
        - name: from
          in: path
          required: true
          schema:
            type: string
            format: date
        - name: to
          in: path
          required: true
          schema:
            type: string
            format: date
        - name: apikey
          in: query
          required: true
          schema:
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            default: 10
        - name: sort
          in: query
          schema:
            type: string
            default: asc
        - name: adjusted
          in: query
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: Success response with aggregates
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AggsResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    AggsResponse:
      type: object
      properties:
        adjusted:
          type: boolean
        count:
          type: integer
        next_url:
          type: string
        queryCount:
          type: integer
        request_id:
          type: string
        results:
          type: array
          items:
            $ref: '#/components/schemas/Agg'
        resultsCount:
          type: integer
        status:
          type: string
        ticker:
          type: string
    ErrorResponse:
      type: object
      properties:
        status:
          type: integer
          example: 400
        error:
          type: string
        details:
          oneOf:
            - type: string
            - type: object
            - type: array
              items:
                type: object
    Agg:
      type: object
      properties:
        close_price:
          type: number
          description: Close price
        high_price:
          type: number
          description: High price
        low_price:
          type: number
          description: Low price
        no_of_trades:
          type: integer
          description: Number of trades
        open_price:
          type: number
          description: Open price
        start_time:
          type: integer
          description: Bar start time (UNIX ms)
        volume_traded:
          type: integer
          description: Volume traded
        volume_weighted_avg_price:
          type: number
          description: Volume weighted avg price

````