> ## 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>



## OpenAPI

````yaml https://api.cryptorank.io/v3/documentation-json get /v3/currencies/{id}/ohlcv
openapi: 3.0.0
info:
  title: Cryptorank API V3
  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.
  version: 3.0.0
  contact:
    name: Cryptorank Team
    url: https://cryptorank.io
    email: info@cryptorank.io
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:
        - name: id
          required: true
          in: path
          description: >-
            Coin ID. See: [GET
            /v3/currencies/map](https://docs.cryptorank.io/api-reference/currencies/currency-map-id-reference).
          schema:
            type: integer
            example: 1
        - name: page
          required: false
          in: query
          description: Page number (1-based). Returns up to 500 items per page.
          schema:
            minimum: 1
            maximum: 1000
            default: 1
            type: number
        - name: from
          required: false
          in: query
          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.
          schema:
            type: string
        - name: to
          required: false
          in: query
          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.
          schema:
            type: string
        - name: interval
          required: false
          in: query
          description: >-
            Candle granularity: hour, day, week, or month. Depth allowed per
            granularity depends on your plan.
          schema:
            default: 1d
            type: string
            enum:
              - 1h
              - 1d
              - 1w
              - 1m
        - name: sortOrder
          required: false
          in: query
          description: Sort direction by candle time.
          schema:
            default: asc
            type: string
            enum:
              - asc
              - desc
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                  - status
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/CurrencyOhlcvItemDto'
                  meta:
                    $ref: '#/components/schemas/ListMetaDto'
                  status:
                    $ref: '#/components/schemas/ResponseStatusDto'
        '400':
          description: Request validation failed
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - status
                    properties:
                      code:
                        type: string
                        enum:
                          - VALIDATION_ERROR
                        example: VALIDATION_ERROR
                      message:
                        type: string
                        example: Validation failed
                      status:
                        type: number
                        example: 400
        '401':
          description: API key is missing or invalid
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - status
                    properties:
                      code:
                        type: string
                        enum:
                          - API_KEY_MISSING
                          - API_KEY_INVALID
                        example: API_KEY_MISSING
                      message:
                        type: string
                        example: API key is missing
                      status:
                        type: number
                        example: 401
        '403':
          description: >-
            No active subscription, the endpoint is not available in your plan,
            or the request goes beyond what your plan allows
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - status
                    properties:
                      code:
                        type: string
                        enum:
                          - NO_ACTIVE_SUBSCRIPTION
                          - ENDPOINT_NOT_AVAILABLE
                          - PLAN_LIMIT_EXCEEDED
                        example: NO_ACTIVE_SUBSCRIPTION
                      message:
                        type: string
                        example: No active subscription found
                      status:
                        type: number
                        example: 403
        '404':
          description: Currency not found
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - status
                    properties:
                      code:
                        type: string
                        enum:
                          - NOT_FOUND
                        example: NOT_FOUND
                      message:
                        type: string
                        example: Resource not found
                      status:
                        type: number
                        example: 404
        '429':
          description: Rate limit or credit limit exceeded
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - status
                    properties:
                      code:
                        type: string
                        enum:
                          - RATE_LIMIT_EXCEEDED
                          - DAILY_CREDITS_EXCEEDED
                          - MONTHLY_CREDITS_EXCEEDED
                        example: RATE_LIMIT_EXCEEDED
                      message:
                        type: string
                        example: Rate limit exceeded
                      status:
                        type: number
                        example: 429
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - status
                    properties:
                      code:
                        type: string
                        enum:
                          - INTERNAL_ERROR
                        example: INTERNAL_ERROR
                      message:
                        type: string
                        example: Internal server error
                      status:
                        type: number
                        example: 500
      security:
        - X-Api-Key: []
components:
  schemas:
    CurrencyOhlcvItemDto:
      type: object
      properties:
        time:
          type: number
          example: 1715000000000
          description: Candle open time, Unix epoch milliseconds
        open:
          type: string
          example: '64100.12'
          description: Open price, USD
        high:
          type: string
          example: '65900.4'
          description: Highest price of the candle, USD
        low:
          type: string
          example: '63800.01'
          description: Lowest price of the candle, USD
        close:
          type: string
          example: '65000.5'
          description: Close price, USD
        avg:
          type: string
          example: '64700.25'
          description: Average of the candle’s open, high, low and close, USD
        volume:
          type: string
          example: '28000000000'
          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.
        circulatingSupply:
          type: string
          example: '19700000'
          description: Circulating supply at the candle close, tokens
        priceChangePercent:
          type: number
          nullable: true
          example: 1.4
          description: 'Within-candle price change: (close − open) / open × 100, %'
        volumeChangePercent:
          type: number
          nullable: true
          example: -8.32
          description: >-
            Volume change against the previous candle, %. Null when there is no
            previous one.
        circulatingSupplyChangePercent:
          type: number
          nullable: true
          example: 0.11
          description: >-
            Circulating supply change against the previous candle, %. Null when
            there is no previous one.
      required:
        - time
        - open
        - high
        - low
        - close
        - avg
        - volume
        - circulatingSupply
        - priceChangePercent
        - volumeChangePercent
        - circulatingSupplyChangePercent
    ListMetaDto:
      type: object
      properties:
        page:
          type: number
          example: 1
          description: Current page number (1-based)
        pageSize:
          type: number
          example: 25
          description: >-
            Fixed number of items per page for this endpoint (varies per
            endpoint)
        hasNextPage:
          type: boolean
          example: true
          description: Whether a further page of results exists
      required:
        - page
        - pageSize
        - hasNextPage
    ResponseStatusDto:
      type: object
      properties:
        usedCredits:
          type: number
          example: 1
          description: Credits charged for this request
        timestamp:
          type: number
          example: 1780000000000
          description: Server time of the response. Unix timestamp in milliseconds
      required:
        - usedCredits
        - timestamp
  securitySchemes:
    X-Api-Key:
      name: X-Api-Key
      type: apiKey
      in: header

````