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

# Get OHLCV data for a token

> Historical OHLCV candles for a token in USD, built from a volume-weighted price across every pool the token trades in. Needs a Dev or Pro plan.

## Endpoint overview

One candle series per token, in USD. Where [pool OHLCV](/api-reference/pools/get-ohlcv-data-for-a-pool-pair) gives you the price of one pair in one pool, this endpoint gives you the token's price across every pool it trades in on the network, weighted by volume. You do not have to pick a pool first, and a thin pool with a stray trade does not become your chart.

The candles come from the same token price series as the [real-time OHLCV stream](/streaming/ohlcv-streaming), so you can load history here and continue live on `/sse/ohlcv`.

<Warning>
  **Dev, Pro or Enterprise only.** Keyless requests and free keys get `403` with `{"message":"this endpoint requires a Dev or Pro plan"}`. Paid plans call `https://api-pro.dexpaprika.com` with the key as the whole `Authorization` header. Get a key in [console.dexpaprika.com](https://console.dexpaprika.com) and compare plans on [pricing](https://dexpaprika.com/api/pricing).
</Warning>

```bash theme={null}
curl -H "Authorization: $DEXPAPRIKA_API_KEY" \
  "https://api-pro.dexpaprika.com/networks/ethereum/tokens/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2/ohlcv?start=-24h&interval=1h&limit=24"
```

## Plan limits

| Plan | Candle intervals | History depth |
| - | - | - |
| **Free (no key or registered key)** | not available | not available |
| **Dev** | all (`1m` to `24h`) | last 30 days |
| **Pro / Enterprise** | all | no plan limit |

`start`, `end` and the number of candles are checked against the window the same way as on pool OHLCV. Details on the [rate limits page](/knowledge-base/rate-limits#ohlcv-limits-by-plan). Each request costs one credit, whatever the number of candles it returns.

## Reading the response

* `open`, `high`, `low` and `close` are USD prices. There is no `inversed` flag here, because a token series has no second token to flip to.
* `volume` is the USD value traded in the token across all its pools during the candle, as a whole number.
* A candle only exists for an interval in which the token traded. On a quiet token a series of `1m` candles has gaps; fill them on your side if your chart needs a continuous axis.
* The latest candle can still be open. Its `time_close` is then earlier than a full interval after `time_open`, and its values change until the interval ends. Re-read it rather than caching it.

<Tip>
  Walkthrough with charts and code: [Token price history across every pool](/tutorials/token-ohlcv).
  See also: [Pool OHLCV](/api-reference/pools/get-ohlcv-data-for-a-pool-pair),
  [Token details](/api-reference/tokens/get-a-tokens-latest-data-on-a-network),
  [Real-time OHLCV streaming](/streaming/ohlcv-streaming)
</Tip>

### FAQs

<AccordionGroup>
  <Accordion title="How is this different from pool OHLCV?">
    Pool OHLCV is the price of one pair in one pool, quoted in the other token of that pair unless you flip it with `inversed`. Token OHLCV is the token's USD price across every pool it trades in on the network, weighted by volume, with volume summed across those pools. Use token OHLCV for charts, backtests and valuation; use pool OHLCV when you care about one specific market.
  </Accordion>

  <Accordion title="Which plans can call it?">
    Dev, Pro and Enterprise, on `https://api-pro.dexpaprika.com`. Dev can query the last 30 days; Pro and Enterprise have no plan limit on history. Keyless requests and free keys get `403`. Plans are on [pricing](https://dexpaprika.com/api/pricing).
  </Accordion>

  <Accordion title="Which intervals are supported?">
    `1m`, `5m`, `10m`, `15m`, `30m`, `1h`, `6h`, `12h`, `24h`, up to 1000 candles per request. `interval` defaults to `24h` and `limit` to 10, so set both.
  </Accordion>

  <Accordion title="How do I request a time range?">
    `start` is required: a relative offset from now (`-24h`, `-7d`, `-90m`), an RFC3339 timestamp, a date or Unix seconds. `end` is optional and takes the same formats. On Dev the range must fit inside the last 30 days.
  </Accordion>

  <Accordion title="Why are some minutes missing?">
    A candle is only produced for an interval in which the token traded. No trades, no candle. This is expected on less active tokens and on short intervals.
  </Accordion>
</AccordionGroup>


## OpenAPI

````yaml get /networks/{network}/tokens/{token_address}/ohlcv
openapi: 3.1.0
info:
  title: DexPaprika API
  version: 1.0.4
  description: >
    # Introduction
      Welcome to the DexPaprika API! This product is developed by [CoinPaprika](https://coinpaprika.com).

      Our API enables developers to query token, pool, and DEX data across multiple blockchain networks. Feel free to explore our endpoints below.

      ---
    # Rate limits and credit quota
      Two different limits apply, signalled by distinct status codes:

      - **429 Too Many Requests**, you are sending requests too fast (per-minute limit). Slow down and retry after the number of seconds given in the `Retry-After` header.

      - **402 Payment Required**, your credit allowance is exhausted. Retrying will not help. Register a free key (keyless), upgrade your plan (free key), or enable overage in the console (Dev and Pro).

      Both codes carry a structured JSON body (`error`, `tier`, `message`, `credits`, and per-scenario fields; see the 402/429 response schemas below). A Dev or Pro 402 includes `resets_at`, the UTC end of the billing period; keyless and free keys count over a rolling 30-day window and carry no `resets_at`. A 402 deliberately carries no `Retry-After` header.

      Responses include an `X-Api-Plan` header naming the plan the request was evaluated against, `x-credits-limit`, `x-credits-remaining` and `x-credits-reset` for the credit allowance, and the `ratelimit-limit`, `ratelimit-remaining` and `ratelimit-reset` trio.

      Call `GET /usage` to check your plan and, when authenticated with an API key on `api-pro.dexpaprika.com`, your current-period credit usage and remaining allowance.

      ---
    # Getting started

    ## Testing the API with code snippets

    The snippets below show how to quickly make a **GET** request. No API key is
    needed to start, so you can call the endpoints directly.


    > **Note**: If you see CORS issues in a browser, you may need to call these
    endpoints from a backend server to avoid local browser restrictions.


    ### 1. cURL


    ```bash

    curl -X GET
    "https://api.dexpaprika.com/networks/ethereum/pools/search?limit=10" | jq

    ```

    ### 2. Node.js (JavaScript)

    ```js

    const https = require('https');


    const options = {
      hostname: 'api.dexpaprika.com',
      path: '/networks/ethereum/pools/search?limit=10',
      method: 'GET',
    };


    const req = https.request(options, res => {
      let data = '';
      res.on('data', chunk => { data += chunk; });
      res.on('end', () => { console.log(JSON.parse(data)); });
    });


    req.on('error', error => { console.error(error); });

    req.end();

    ```


    ### 3. Python

    ```python

    import requests


    url = "https://api.dexpaprika.com/networks/ethereum/pools/search?limit=10"


    response = requests.get(url)

    if response.status_code == 200:
        print(response.json())
    else:
        print(f"Error: {response.status_code} -> {response.text}")
    ```

    ### 4. PHP

    ```php

    <?php

    $curl = curl_init();


    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.dexpaprika.com/networks/ethereum/pools/search?limit=10",
      CURLOPT_RETURNTRANSFER => true
    ));


    $response = curl_exec($curl);


    if(curl_errno($curl)) {
      echo "Error: " . curl_error($curl);
    } else {
      echo $response;
    }


    curl_close($curl);

    ?>

    ```


    ### 5. Java

    ```java

    import java.io.*;

    import java.net.HttpURLConnection;

    import java.net.URL;


    public class DexPaprikaExample {
        public static void main(String[] args) {
            try {
                URL url = new URL("https://api.dexpaprika.com/networks/ethereum/pools/search?limit=10");
                HttpURLConnection con = (HttpURLConnection) url.openConnection();
                con.setRequestMethod("GET");
                int responseCode = con.getResponseCode();
                try (BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()))) {
                    String inputLine;
                    StringBuilder content = new StringBuilder();
                    while ((inputLine = in.readLine()) != null) {
                        content.append(inputLine);
                    }
                    if (responseCode == 200) {
                        System.out.println(content.toString());
                    } else {
                        System.out.println("Error: " + responseCode);
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    ```


    ### 6. Go

    ```go

    package main


    import (
        "fmt"
        "io/ioutil"
        "log"
        "net/http"
    )


    func main() {
        client := &http.Client{}
        req, err := http.NewRequest("GET", "https://api.dexpaprika.com/networks/ethereum/pools/search?limit=10", nil)
        if err != nil {
            log.Fatal(err)
        }

        resp, err := client.Do(req)
        if err != nil {
            log.Fatal(err)
        }
        defer resp.Body.Close()

        body, err := ioutil.ReadAll(resp.Body)
        if err != nil {
            log.Fatal(err)
        }

        if resp.StatusCode == http.StatusOK {
            fmt.Println(string(body))
        } else {
            fmt.Printf("Error: %d -> %s\n", resp.StatusCode, body)
        }
    }

    ```


    ### 7. C#

    ```csharp

    using System;

    using System.Net.Http;

    using System.Threading.Tasks;


    class Program

    {
        static async Task Main()
        {
            using var client = new HttpClient();
            var url = "https://api.dexpaprika.com/networks/ethereum/pools/search?limit=10";
            
            var response = await client.GetAsync(url);
            
            if (response.IsSuccessStatusCode)
            {
                var content = await response.Content.ReadAsStringAsync();
                Console.WriteLine(content);
            }
            else
            {
                Console.WriteLine($"Error: {response.StatusCode}");
            }
        }
    }

    ```


    ## Feedback and next steps

    1. **Test** any of the snippets above.  

    2. **Explore** our other endpoints in this documentation.   

    3. **Share** your feedback with us at
    [support@coinpaprika.com](mailto:support@coinpaprika.com).

    4. If you want implement our API into your project or simply discuss
    possible collaboration, please reach out to msroka@coinpaprika.com.

    ---
  contact:
    name: CoinPaprika Support
    email: support@coinpaprika.com
    url: https://coinpaprika.com
  license:
    name: Proprietary
    url: https://dexpaprika.com/terms
servers:
  - url: https://api.dexpaprika.com
    description: Production server
security: []
tags:
  - name: Networks
    description: Endpoints for retrieving information about supported blockchain networks
  - name: DEXes
    description: Endpoints for retrieving information about decentralized exchanges
  - name: Pools
    description: Endpoints for retrieving information about liquidity pools
  - name: Tokens
    description: Endpoints for retrieving information about tokens
  - name: Search
    description: Endpoints for searching across tokens, pools, and DEXes
  - name: Utils
    description: Utility endpoints for system metadata
paths:
  /networks/{network}/tokens/{token_address}/ohlcv:
    get:
      tags:
        - Tokens
      summary: Get OHLCV data for a token.
      description: |
        Retrieves Open-High-Low-Close-Volume (OHLCV) data for a specific token.

        Data is available from 2025-11-01. Requires a Dev or Pro plan. Dev
        history is limited to the last 30 days.
      operationId: getTokenOHLCV
      parameters:
        - $ref: '#/components/parameters/networkParam'
        - $ref: '#/components/parameters/tokenAddressParam'
        - $ref: '#/components/parameters/ohlcvStartParam'
        - $ref: '#/components/parameters/ohlcvEndParam'
        - $ref: '#/components/parameters/ohlcvLimitParam'
        - $ref: '#/components/parameters/ohlcvIntervalParam'
        - $ref: '#/components/parameters/ohlcvCountBackParam'
      responses:
        '200':
          description: A list of OHLCV records successfully retrieved.
          content:
            application/json:
              schema:
                type: array
                description: >-
                  An array of OHLCV records (candlesticks) matching the query
                  criteria.
                items:
                  $ref: '#/components/schemas/OHLCVRecord'
              example:
                - time_open: '2025-03-10T00:00:00Z'
                  time_close: '2025-03-11T00:00:00Z'
                  open: 126.43817748776037
                  high: 131.48201077049822
                  low: 115.52148830221141
                  close: 118.20275113239272
                  volume: 262402654
        '400':
          description: The specified network or token address is invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Invalid network or token address.
        '402':
          $ref: '#/components/responses/QuotaExceeded'
        '403':
          description: The request is not allowed on your plan.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: this endpoint requires a Dev or Pro plan
        '404':
          description: Network not found or token not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Token not found on this network.
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    networkParam:
      name: network
      in: path
      required: true
      schema:
        type: string
      description: >-
        Network slug or ID (e.g., 'solana'). You can find the list of supported
        networks with their IDs here: [/networks](/api-reference/networks).
      example: solana
    tokenAddressParam:
      name: token_address
      in: path
      required: true
      schema:
        type: string
      description: >-
        Token contract address. Such as
        `JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN` for Jupiter on Solana.
      example: JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN
    ohlcvStartParam:
      name: start
      in: query
      required: true
      example: '-24h'
      schema:
        type: string
        description: >
          Start time for the OHLCV data. Required; "-24h" selects the last 24
          hours.

          Accepted formats:

          - Relative offset from now (e.g., "-24h", "-7d", "-90m"; units: s, m,
          h, d)

          - Unix timestamp

          - RFC3339 timestamp (e.g., "2023-10-27T08:07:20Z")

          - Date (e.g., "2023-10-27", interpreted as 00:00:00 UTC)
        example: '-24h'
    ohlcvEndParam:
      name: end
      in: query
      required: false
      schema:
        type: string
        description: |
          End time for the OHLCV data.
          Accepted formats:
          - Relative offset from now (e.g., "-1h", "-2d")
          - Unix timestamp
          - RFC3339 timestamp (e.g., "2023-10-27T10:00:00Z")
          - Date (e.g., "2023-10-27", interpreted as 00:00:00 UTC)
        example: '1741508640'
    ohlcvLimitParam:
      name: limit
      in: query
      required: false
      schema:
        type: integer
        format: int32
        default: 10
        minimum: 1
        maximum: 1000
      description: Maximum number of OHLCV records to return.
    ohlcvIntervalParam:
      name: interval
      in: query
      required: false
      schema:
        type: string
        enum:
          - 1m
          - 5m
          - 10m
          - 15m
          - 30m
          - 1h
          - 6h
          - 12h
          - 24h
        default: 24h
      description: |
        The time interval for each OHLCV record (candle).
    ohlcvCountBackParam:
      name: count_back
      in: query
      required: false
      schema:
        type: integer
        format: int32
        minimum: 0
        maximum: 350
      description: |
        Returns the last N candles with data up to `end`, ignoring `start`.
  schemas:
    OHLCVRecord:
      type: object
      description: >-
        Represents a single Open-High-Low-Close-Volume (OHLCV) data point for a
        specific time interval.
      properties:
        time_open:
          type: string
          format: date-time
          description: The opening timestamp of the OHLCV period.
          example: '2023-10-27T10:00:00Z'
        time_close:
          type: string
          format: date-time
          description: The closing timestamp of the OHLCV period.
          example: '2023-10-27T11:00:00Z'
        open:
          type: number
          format: double
          description: The opening price for the period.
          example: 1500.5
        high:
          type: number
          format: double
          description: The highest price reached during the period.
          example: 1525.75
        low:
          type: number
          format: double
          description: The lowest price reached during the period.
          example: 1495.25
        close:
          type: number
          format: double
          description: The closing price for the period.
          example: 1510
        volume:
          type: integer
          format: int64
          description: The total volume traded during the period.
          example: 1234567890123
      required:
        - time_open
        - time_close
        - open
        - high
        - low
        - close
        - volume
    QuotaErrorBody:
      type: object
      description: >
        Structured body carried by every 402 and 429 emitted by the billing
        gate. The shape is constant across scenarios; only fields describing an
        available action appear. `message` is always a top-level string, so
        clients parsing the legacy `{"message": ...}` shape keep working.
      required:
        - error
        - tier
        - message
      properties:
        error:
          type: string
          enum:
            - payment_required
            - rate_limited
          description: Machine-readable discriminator matching the status code.
        tier:
          type: string
          enum:
            - keyless
            - free
            - dev
            - pro
            - enterprise
          description: The billing tier the request was evaluated against.
        message:
          type: string
          description: Human-readable message naming the next action.
        credits:
          type: object
          description: >
            Credit counters for the current period. One credit is one request.
            `plan` and `packs` are split out for Pro keys only. `limit` is plan
            + packs; usage served through overage can exceed it.
          properties:
            plan:
              type: integer
              format: int64
            packs:
              type: integer
              format: int64
            limit:
              type: integer
              format: int64
            used:
              type: integer
              format: int64
            remaining:
              type: integer
              format: int64
        overage:
          type: object
          description: >
            Overage state, present on Pro 402 bodies. Money amounts are decimal
            strings, never floats.
          properties:
            enabled:
              type: boolean
            cap:
              type: string
              example: '200.00'
            used:
              type: string
              example: '200.00'
            block:
              type: string
              example: 20.00 per 1M credits
        resets_at:
          type: string
          format: date-time
          description: When the monthly allowance rolls over (UTC). 402 only.
        retry_after:
          type: integer
          description: Seconds to wait before retrying. 429 only.
        offer:
          type: object
          description: Early-adopter offer, present on the free-tier 402 only.
          properties:
            description:
              type: string
            expires_at:
              type: string
              format: date-time
        links:
          type: object
          additionalProperties:
            type: string
          description: >
            Next-step URLs. Keys vary by scenario: register, upgrade, packs,
            portal, usage, docs. Absent until the customer-facing pages go live.
  responses:
    QuotaExceeded:
      description: >
        Credit allowance exhausted. Retrying will not help; the body names the
        available next step per tier: register (keyless), upgrade (free key), or
        enable overage and raise your spend cap (Dev and Pro). `resets_at` is
        present on Dev and Pro only and holds the end of the billing period
        (UTC); keyless and free keys count over a rolling 30-day window.
        Deliberately carries no `Retry-After` header.
      headers:
        X-Credits-Limit:
          description: Monthly credit limit for this caller.
          schema:
            type: integer
        X-Credits-Remaining:
          description: Credits left in the current month.
          schema:
            type: integer
        X-Credits-Reset:
          description: Seconds until the monthly credits reset.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/QuotaErrorBody'
          examples:
            keyless:
              summary: Keyless client over the rolling 30-day limit
              value:
                error: payment_required
                tier: keyless
                message: >-
                  Credit limit for the last 30 days reached for unauthenticated
                  use. Register for a free API key to get more credits/month.
                credits:
                  limit: 10000
                  used: 10000
                  remaining: 0
            pro_plan_exhausted:
              summary: Pro key with plan credits drained, overage off
              value:
                error: payment_required
                tier: pro
                message: Monthly credit limit reached — enable overage in the portal.
                credits:
                  plan: 5000000
                  packs: 0
                  limit: 5000000
                  used: 5000000
                  remaining: 0
                overage:
                  enabled: false
                resets_at: '2026-09-01T00:00:00Z'
    RateLimited:
      description: >
        Per-minute rate limit exceeded. Slow down and retry after the number of
        seconds given in the `Retry-After` header. Credits are unaffected;
        `credits` appears in the body only when the counters were already at
        hand for the request.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
        RateLimit-Limit:
          description: Request limit for the current minute.
          schema:
            type: integer
        RateLimit-Remaining:
          description: Requests left in the current minute.
          schema:
            type: integer
        RateLimit-Reset:
          description: Seconds until the minute limit resets.
          schema:
            type: integer
        X-Credits-Limit:
          description: Monthly credit limit for this caller.
          schema:
            type: integer
        X-Credits-Remaining:
          description: Credits left in the current month.
          schema:
            type: integer
        X-Credits-Reset:
          description: Seconds until the monthly credits reset.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/QuotaErrorBody'
          example:
            error: rate_limited
            tier: pro
            message: Request rate exceeded. Retry in 12 seconds.
            credits:
              plan: 5000000
              packs: 0
              limit: 5000000
              used: 1240880
              remaining: 3759120
            retry_after: 12

````