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

# Historical OHLCV

> Aggregated historical candles for a single coin: OHLC price, traded volume, circulating supply and period-over-period changes.<br/><br/>Available from&#58; <Badge color="green">Advanced</Badge><br/>Cost&#58; <Badge color="surface">1 credit per request</Badge>

<Note>
  All values are in USD; the `convert` parameter does not apply.
</Note>

<Note>
  Depth depends on the plan:
  Advanced — up to 30d at 1h, up to 2y at 1d/1w/1m;
  Pro — up to 90d at 1h, up to 5y at 1d/1w/1m;
  Business — up to 1y at 1h, full history at 1d/1w/1m.
  A `from`/`to` range reaching deeper than your plan allows returns `403 PLAN_LIMIT_EXCEEDED` — the window is never silently cut.
</Note>

<Tip>
  For a lightweight price line use [/currencies/{id}/sparkline](https://docs.cryptorank.io/api-reference/currencies/price-&-volume-chart) instead.
</Tip>


## OpenAPI

````yaml /openapi.json get /v3/currencies/{id}/ohlcv
openapi: 3.0.0
info:
  contact:
    email: info@cryptorank.io
    name: Cryptorank Team
    url: https://cryptorank.io
  description: >
    # Overview


    Cryptorank Public API v3 — comprehensive cryptocurrency data for B2B clients
    and partners.


    Useful Links:

    - [API Plans](https://cryptorank.io/public-api)

    - [Dashboard](https://cryptorank.io/public-api/dashboard)


    # Getting Started


    Primary Server URL:
    [https://api.cryptorank.io/v3/](https://api.cryptorank.io/v3/)


    **Authentication**


    Generate an API key in the
    [dashboard](https://cryptorank.io/public-api/dashboard) and pass it in the
    `X-Api-Key` header.


    Keep your keys secret — never commit them to public repositories or expose
    them in client-side code.
  title: Cryptorank API V3
  version: 3.0.0
servers:
  - url: https://api.cryptorank.io
security: []
tags: []
paths:
  /v3/currencies/{id}/ohlcv:
    get:
      tags:
        - Currencies
      summary: Historical OHLCV
      description: >-
        **Description**


        Aggregated historical candles for a single coin: OHLC price, traded
        volume, circulating supply and period-over-period changes.


        > **Note:** All values are in USD; the `convert` parameter does not
        apply.


        > **Note:** Depth depends on the plan:

        Advanced — up to 30d at 1h, up to 2y at 1d/1w/1m;

        Pro — up to 90d at 1h, up to 5y at 1d/1w/1m;

        Business — up to 1y at 1h, full history at 1d/1w/1m.

        A `from`/`to` range reaching deeper than your plan allows returns `403
        PLAN_LIMIT_EXCEEDED` — the window is never silently cut.


        > **Tip:** For a lightweight price line use
        [/currencies/{id}/sparkline](https://docs.cryptorank.io/api-reference/currencies/price-&-volume-chart)
        instead.


        **Access**

        - Available from: **Advanced**

        - Cost: 1 credit per request
      operationId: CurrenciesController_getOhlcv
      parameters:
        - description: >-
            Coin ID. See: [GET
            /v3/currencies/map](https://docs.cryptorank.io/api-reference/currencies/currency-map-id-reference).
          in: path
          name: id
          required: true
          schema:
            example: 1
            type: integer
        - description: Page number (1-based). Returns up to 500 items per page.
          in: query
          name: page
          required: false
          schema:
            default: 1
            maximum: 1000
            minimum: 1
            type: number
        - description: >-
            Window start, aligned down to the candle's period. Defaults to the
            earliest point your plan allows. Accepted: ISO 8601, bare date
            (YYYY-MM-DD), or Unix timestamp in seconds/milliseconds.
          in: query
          name: from
          required: false
          schema:
            type: string
        - description: >-
            Window end. Defaults to now. Accepted: ISO 8601, bare date
            (YYYY-MM-DD), or Unix timestamp in seconds/milliseconds. Bare dates
            resolve to end-of-day UTC.
          in: query
          name: to
          required: false
          schema:
            type: string
        - description: >-
            Candle granularity: hour, day, week, or month. Depth allowed per
            granularity depends on your plan.
          in: query
          name: interval
          required: false
          schema:
            default: 1d
            enum:
              - 1h
              - 1d
              - 1w
              - 1m
            type: string
        - description: Sort direction by candle time.
          in: query
          name: sortOrder
          required: false
          schema:
            default: asc
            enum:
              - asc
              - desc
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    items:
                      $ref: '#/components/schemas/CurrencyOhlcvItemDto'
                    type: array
                  meta:
                    $ref: '#/components/schemas/ListMetaDto'
                  status:
                    $ref: '#/components/schemas/ResponseStatusDto'
                required:
                  - data
                  - meta
                  - status
                type: object
          description: ''
        '400':
          content:
            application/json:
              schema:
                properties:
                  error:
                    properties:
                      code:
                        enum:
                          - VALIDATION_ERROR
                        example: VALIDATION_ERROR
                        type: string
                      message:
                        example: Validation failed
                        type: string
                      status:
                        example: 400
                        type: number
                    required:
                      - code
                      - message
                      - status
                    type: object
                required:
                  - error
                type: object
          description: Request validation failed
        '401':
          content:
            application/json:
              schema:
                properties:
                  error:
                    properties:
                      code:
                        enum:
                          - API_KEY_MISSING
                          - API_KEY_INVALID
                        example: API_KEY_MISSING
                        type: string
                      message:
                        example: API key is missing
                        type: string
                      status:
                        example: 401
                        type: number
                    required:
                      - code
                      - message
                      - status
                    type: object
                required:
                  - error
                type: object
          description: API key is missing or invalid
        '403':
          content:
            application/json:
              schema:
                properties:
                  error:
                    properties:
                      code:
                        enum:
                          - NO_ACTIVE_SUBSCRIPTION
                          - ENDPOINT_NOT_AVAILABLE
                          - PLAN_LIMIT_EXCEEDED
                        example: NO_ACTIVE_SUBSCRIPTION
                        type: string
                      message:
                        example: No active subscription found
                        type: string
                      status:
                        example: 403
                        type: number
                    required:
                      - code
                      - message
                      - status
                    type: object
                required:
                  - error
                type: object
          description: >-
            No active subscription, the endpoint is not available in your plan,
            or the request goes beyond what your plan allows
        '404':
          content:
            application/json:
              schema:
                properties:
                  error:
                    properties:
                      code:
                        enum:
                          - NOT_FOUND
                        example: NOT_FOUND
                        type: string
                      message:
                        example: Resource not found
                        type: string
                      status:
                        example: 404
                        type: number
                    required:
                      - code
                      - message
                      - status
                    type: object
                required:
                  - error
                type: object
          description: Currency not found
        '429':
          content:
            application/json:
              schema:
                properties:
                  error:
                    properties:
                      code:
                        enum:
                          - RATE_LIMIT_EXCEEDED
                          - DAILY_CREDITS_EXCEEDED
                          - MONTHLY_CREDITS_EXCEEDED
                        example: RATE_LIMIT_EXCEEDED
                        type: string
                      message:
                        example: Rate limit exceeded
                        type: string
                      status:
                        example: 429
                        type: number
                    required:
                      - code
                      - message
                      - status
                    type: object
                required:
                  - error
                type: object
          description: Rate limit or credit limit exceeded
        '500':
          content:
            application/json:
              schema:
                properties:
                  error:
                    properties:
                      code:
                        enum:
                          - INTERNAL_ERROR
                        example: INTERNAL_ERROR
                        type: string
                      message:
                        example: Internal server error
                        type: string
                      status:
                        example: 500
                        type: number
                    required:
                      - code
                      - message
                      - status
                    type: object
                required:
                  - error
                type: object
          description: Internal server error
      security:
        - X-Api-Key: []
components:
  schemas:
    CurrencyOhlcvItemDto:
      properties:
        avg:
          description: Average of the candle’s open, high, low and close, USD
          example: '64700.25'
          type: string
        circulatingSupply:
          description: Circulating supply at the candle close, tokens
          example: '19700000'
          type: string
        circulatingSupplyChangePercent:
          description: >-
            Circulating supply change against the previous candle, %. Null when
            there is no previous one.
          example: 0.11
          nullable: true
          type: number
        close:
          description: Close price, USD
          example: '65000.5'
          type: string
        high:
          description: Highest price of the candle, USD
          example: '65900.4'
          type: string
        low:
          description: Lowest price of the candle, USD
          example: '63800.01'
          type: string
        open:
          description: Open price, USD
          example: '64100.12'
          type: string
        priceChangePercent:
          description: 'Within-candle price change: (close − open) / open × 100, %'
          example: 1.4
          nullable: true
          type: number
        time:
          description: Candle open time, Unix epoch milliseconds
          example: 1715000000000
          type: number
        volume:
          description: >-
            Traded volume, USD. Hourly candles carry the 24h rolling volume at
            the candle close; daily and longer candles sum the 24h volume of
            every day in the period.
          example: '28000000000'
          type: string
        volumeChangePercent:
          description: >-
            Volume change against the previous candle, %. Null when there is no
            previous one.
          example: -8.32
          nullable: true
          type: number
      required:
        - time
        - open
        - high
        - low
        - close
        - avg
        - volume
        - circulatingSupply
        - priceChangePercent
        - volumeChangePercent
        - circulatingSupplyChangePercent
      type: object
    ListMetaDto:
      properties:
        hasNextPage:
          description: Whether a further page of results exists
          example: true
          type: boolean
        page:
          description: Current page number (1-based)
          example: 1
          type: number
        pageSize:
          description: >-
            Fixed number of items per page for this endpoint (varies per
            endpoint)
          example: 25
          type: number
      required:
        - page
        - pageSize
        - hasNextPage
      type: object
    ResponseStatusDto:
      properties:
        timestamp:
          description: Server time of the response. Unix timestamp in milliseconds
          example: 1780000000000
          type: number
        usedCredits:
          description: Credits charged for this request
          example: 1
          type: number
      required:
        - usedCredits
        - timestamp
      type: object
  securitySchemes:
    X-Api-Key:
      in: header
      name: X-Api-Key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.