Skip to main content
POST
https://api.blockdb.io
/
v1
/
evm
/
prices
/
spot
/
fiat
/
ohlc
curl -X POST "https://api.blockdb.io/v1/evm/prices/spot/fiat/ohlc" \
  -H "Authorization: Bearer $BLOCKDB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "chain_id": 1,
  "base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "quote_currency_code": "USD",
  "from_timestamp": "2025-11-11T00:00:00Z",
  "to_timestamp": "2025-11-11T01:00:00Z",
  "exchange_ids": [
    1,
    2
  ],
  "aggregation_interval": "1m",
  "aggregation_timezone": "UTC",
  "limit": 200,
  "cursor": null
}'
{
  "chain_id": 1,
  "base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "quote_currency_code": "USD",
  "meta": {
    "request_window": {
      "from_block": null,
      "to_block": null,
      "from_timestamp": "2025-11-11T00:00:00Z",
      "to_timestamp": "2025-11-11T01:00:00Z"
    },
    "filters": {
      "exchange_ids": [
        1,
        2
      ],
      "pool_uids": []
    }
  },
  "data": [
    {
      "open": "3010.112233445566778899",
      "high": "3033.998877665544332211",
      "low": "3008.001122334455667788",
      "close": "3025.219821481234567890",
      "volume_base": "420.000000000000000000",
      "volume_quote": "1269000.000000000000000000",
      "start_timestamp": "2025-11-11T00:00:00Z",
      "end_timestamp": "2025-11-11T00:59:59Z",
      "bucket": "2025-11-11T00:00:00Z",
      "_tracing_id": "0603000000000000000000000000000000000000",
      "_parent_tracing_ids": [
        "0203000000000000000000000000000000000000"
      ],
      "_genesis_tracing_ids": [
        "0103000000000000000000000000000000000000"
      ],
      "_created_at": "2025-11-11T01:00:05.000Z",
      "_updated_at": "2025-11-11T01:00:05.000Z"
    }
  ],
  "cursor": null,
  "count": 1
}

Description

Returns open-high-low-close (OHLC) candles for ERC-20 base tokens quoted in fiat currencies. The backend normalizes results into the requested fiat, making it easy to power dashboards and backtests without running local FX conversions.
The only difference from the ERC-20 pairing is the quote_currency_code field, which must match the Fiat Currency enumeration.

Parameters

chain_id
number
required
Target EVM chain. See the Chain enumeration for supported values.
base_token_address
string
required
ERC-20 contract address for the base asset (hex string, 20 bytes, no 0x prefix).
quote_currency_code
string
required
ISO-4217 fiat currency code. Must match the Fiat Currency enumeration.

Range Filters (mutually exclusive)

from_block
number
Starting block number (inclusive) for the query window.
to_block
number
Ending block number (inclusive) for the query window.
from_timestamp
string
Starting timestamp (ISO-8601). If it falls between blocks, the next block after this timestamp is used.
to_timestamp
string
Ending timestamp (ISO-8601). If it falls between blocks, the last block before this timestamp is used.
Validation rule:
You must provide either a block range, a time range, or at least one direct selector.
Providing more than one option results in HTTP 400.
Providing none results in HTTP 400.

Direct Selectors

exchange_ids
number[]
Filter by exchange identifiers. See the DigitalExchange enumeration.
pool_uids
string[]
Restrict to specific BlockDB pool identifiers.

Candle Controls

aggregation_interval
string
Candle width, expressed as an ISO-8601 duration shorthand (1m, 5m, 1h, 1d). Default is 1m.
aggregation_timezone
string
IANA timezone identifier used to anchor candle boundaries. Default is UTC.

Pagination Controls

limit
number
default:"250"
Recommended default 250; maximum 1000 to stay under ~10 MB responses.
cursor
string
Opaque pagination cursor supplied by a previous response.

Response Fields

chain_id
number
EVM chain ID echoed at the response root.
base_token_address
string
ERC-20 contract address of the base asset.
quote_currency_code
string
Fiat currency code associated with the quoted prices.

Meta

meta
object
Echo of request metadata, including normalized filters and window bounds.
meta.request_window
object
Block/timestamp bounds applied to the query.
meta.filters
object
Filters applied to the query (exchange IDs, pool UIDs).

Data

data
object[]
Fiat-denominated OHLC candles that match the request.
data.open
string
Opening price for the bucket (in fiat per base unit).
data.high
string
Highest price within the bucket.
data.low
string
Lowest price within the bucket.
data.close
string
Closing price for the bucket.
data.volume_base
string
Aggregated executed volume in base units.
data.volume_quote
string
Aggregated executed volume in fiat units.
data.start_timestamp
string
Inclusive start of the candle window (ISO-8601).
data.end_timestamp
string
Inclusive end of the candle window (ISO-8601).
data.bucket
string
Bucket anchor timestamp for the interval.
data._tracing_id
string
Tracing identifier for the candle.
data._parent_tracing_ids
string[]
Parent lineage references.
data._genesis_tracing_ids
string[]
Lineage references to original on-chain events.
data._created_at
string
Record creation timestamp.
data._updated_at
string
Record update timestamp.

Envelope Fields

cursor
string | null
Pagination cursor.
count
number
Number of candles returned.
curl -X POST "https://api.blockdb.io/v1/evm/prices/spot/fiat/ohlc" \
  -H "Authorization: Bearer $BLOCKDB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "chain_id": 1,
  "base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "quote_currency_code": "USD",
  "from_timestamp": "2025-11-11T00:00:00Z",
  "to_timestamp": "2025-11-11T01:00:00Z",
  "exchange_ids": [
    1,
    2
  ],
  "aggregation_interval": "1m",
  "aggregation_timezone": "UTC",
  "limit": 200,
  "cursor": null
}'
{
  "chain_id": 1,
  "base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "quote_currency_code": "USD",
  "meta": {
    "request_window": {
      "from_block": null,
      "to_block": null,
      "from_timestamp": "2025-11-11T00:00:00Z",
      "to_timestamp": "2025-11-11T01:00:00Z"
    },
    "filters": {
      "exchange_ids": [
        1,
        2
      ],
      "pool_uids": []
    }
  },
  "data": [
    {
      "open": "3010.112233445566778899",
      "high": "3033.998877665544332211",
      "low": "3008.001122334455667788",
      "close": "3025.219821481234567890",
      "volume_base": "420.000000000000000000",
      "volume_quote": "1269000.000000000000000000",
      "start_timestamp": "2025-11-11T00:00:00Z",
      "end_timestamp": "2025-11-11T00:59:59Z",
      "bucket": "2025-11-11T00:00:00Z",
      "_tracing_id": "0603000000000000000000000000000000000000",
      "_parent_tracing_ids": [
        "0203000000000000000000000000000000000000"
      ],
      "_genesis_tracing_ids": [
        "0103000000000000000000000000000000000000"
      ],
      "_created_at": "2025-11-11T01:00:05.000Z",
      "_updated_at": "2025-11-11T01:00:05.000Z"
    }
  ],
  "cursor": null,
  "count": 1
}