Historical Token Price Data & On-Chain Information Query API

ยท

Accessing accurate historical token price data is essential for developers, analysts, and investors building or evaluating blockchain-based applications. Whether you're tracking native cryptocurrencies, ERC-20 tokens, or emerging inscription standards like BRC-20 and Runes, having reliable, time-series pricing information empowers smarter decision-making across trading strategies, portfolio analysis, and Web3 application development.

The OKX Web3 API offers a powerful endpoint to retrieve granular historical price data for a wide range of digital assets across multiple chains. This guide explores how to use the Historical Token Price API, its supported token types, request parameters, response structure, and practical use cases โ€” all designed to enhance your on-chain data analysis and wallet-as-a-service (WaaS) integrations.

Supported Token Types

The API supports historical price queries for diverse token standards, making it one of the most comprehensive tools for cross-chain and on-chain data retrieval:

This breadth ensures developers can analyze both traditional and emerging asset classes within a unified framework.

๐Ÿ‘‰ Discover real-time and historical pricing for BRC-20 and Runes tokens with advanced API access.

How to Query Historical Prices

To fetch historical token prices, send a GET request to the following endpoint:

https://web3.okx.com/api/v5/wallet/token/historical-price

This RESTful API is designed for simplicity and scalability, supporting pagination, time filtering, and customizable intervals.

Request Parameters

ParameterTypeRequiredDescription
chainIndexStringYesUnique identifier for the blockchain (e.g., btc, eth).
tokenAddressStringNoToken address format varies by type:
- Empty string ("") for native tokens
- Contract address for standard tokens
- Special formats for inscriptions:
โ€ƒโ€ข BRC-20: btc-brc20-ordi
โ€ƒโ€ข Runes: btc-runesMain-840000:2
โ€ƒโ€ข SRC-20: btc-src20-utxo
โ€ƒโ€ข FBRC-20: fbtc_fbrc20_babymusk
limitStringNoNumber of records per page (default: 50, max: 200).
cursorStringNoPagination cursor; defaults to first page.
beginStringNoStart timestamp in milliseconds (Unix epoch).
endStringNoEnd timestamp in milliseconds. If not provided, defaults to current time.
periodStringNoTime interval: 1m, 5m, 30m, 1h, or 1d (default).

Example Request

GET https://web3.okx.com/api/v5/wallet/token/historical-price?
chainIndex=btc&
tokenAddress=btc-brc20-ordi&
period=1h&
limit=100&
begin=1672531200000&
end=1675123200000

This retrieves hourly price data for the ORDI BRC-20 token over a one-month period in early 2023.

Understanding the Response

The API returns structured JSON with timestamped price points.

Response Parameters

Example Response

{
  "prices": [
    { "time": "1672531200", "price": "45.6789" },
    { "time": "1672534800", "price": "46.1234" },
    { "time": "1672538400", "price": "47.0011" }
  ]
}

Each entry represents the opening price for the specified time interval (e.g., hourly). The high precision allows for accurate financial modeling and analytics.

๐Ÿ‘‰ Get structured on-chain pricing data for Runes and BRC-20 tokens with minimal latency.

Practical Use Cases

1. Portfolio Performance Analysis

Developers building crypto portfolio trackers can pull daily price histories for both native coins and niche inscription tokens to calculate gains, losses, and asset allocation trends over time.

2. Market Research & Trend Identification

Analysts can compare price movements between different inscription standards (e.g., BRC-20 vs. Runes) to identify market sentiment shifts and adoption patterns on Bitcoin-based ecosystems.

3. Algorithmic Trading Bots

By integrating minute-level (1m, 5m) data, traders can design technical indicators and execute automated strategies based on precise historical behavior.

4. Wallet-as-a-Service (WaaS) Platforms

WaaS providers can enrich user experiences by displaying historical balance valuations in fiat or stablecoins, powered by accurate time-series pricing.

5. NFT and Inscription Marketplaces

Platforms listing BRC-20 or FBRC-20 tokens can show price charts and volatility metrics to improve buyer confidence and transparency.

Core Keywords

This guide focuses on the following SEO-optimized keywords to align with user search intent:

These terms are naturally integrated throughout the content to support discoverability without compromising readability.

Frequently Asked Questions

Q: Can I query historical prices for native Bitcoin (BTC) using this API?
A: Yes. Simply set chainIndex=btc and leave tokenAddress as an empty string ("") to retrieve BTCโ€™s historical price.

Q: What is the maximum time range I can query at once?
A: There is no fixed limit on time range, but each request returns a maximum of 200 data points. Use pagination with the cursor parameter for longer histories.

Q: Are prices adjusted for splits or token migrations?
A: The API reflects actual on-chain market prices. For tokens that have undergone migrations or rebrandings, ensure you're querying the correct tokenAddress format for the relevant period.

Q: How frequently is the data updated?
A: Data is updated in near real-time. For 1m and 5m intervals, new candles are available shortly after each period closes.

Q: Is there rate limiting on this API?
A: Yes. To ensure fair usage, rate limits apply based on your API key tier. Refer to OKXโ€™s official documentation for specific thresholds.

Q: Can I use this API for commercial applications?
A: Absolutely. The Web3 API is designed for integration into commercial platforms, including analytics dashboards, wallets, and trading systems.

๐Ÿ‘‰ Start integrating high-frequency historical token price data into your Web3 app today.