Understanding the historical performance of digital tokens is crucial for developers, analysts, and blockchain enthusiasts building or evaluating decentralized applications. Whether you're tracking native cryptocurrencies, ERC-20 tokens, or emerging inscription standards on Bitcoin-based chains, access to accurate, granular price data empowers better decision-making and deeper insights into market behavior.
This comprehensive guide explores a powerful Web3 API endpoint that enables seamless querying of historical token prices across multiple blockchains and token standards. Built for flexibility and precision, this tool supports a wide range of use cases—from portfolio tracking to on-chain analytics dashboards.
Query Historical Token Prices with Precision
The /wallet/token/historical-price API endpoint allows users to retrieve time-series price data for various token types across supported networks. With configurable parameters for time range, granularity, and pagination, it delivers structured, machine-readable responses ideal for integration into analytics platforms, wallets, or trading bots.
Key Features
- ✅ Support for native tokens (e.g., ETH, BTC) and contract-based tokens (e.g., ERC-20, BEP-20)
✅ Inscription token support on Bitcoin and Fractal Bitcoin chains:
- BRC-20
- Runes
- ARC-20
- SRC-20
- FBRC-20 (Fractal Bitcoin)
- ✅ Customizable time intervals from 1 minute to 1 day
- ✅ Pagination via cursor for large datasets
- ✅ High-precision pricing (up to 18 decimal places)
👉 Access real-time and historical token data using a reliable Web3 API platform.
How to Use the Historical Price Endpoint
The API follows a RESTful design and uses standard HTTP GET requests. All responses are returned in JSON format, ensuring compatibility with most programming environments.
Request Path
GET https://web3.okx.com/api/v5/wallet/token/historical-priceThis endpoint is part of the OKX Web3 Wallet-as-a-Service (WaaS) API suite, designed to simplify blockchain interactions for developers.
Request Parameters Explained
To tailor your query, several optional and required parameters can be passed as URL query strings.
| Parameter | Type | Required | Description |
|---|---|---|---|
chainIndex | String | Yes | Unique identifier for the target blockchain (e.g., eth, btc, fractal_btc) |
tokenAddress | String | No | Token address format varies by type: • Empty string ( "") → native token• Contract address → standard tokens • Special format → inscription tokens |
limit | String | No | Number of records per page (default: 50, max: 200) |
cursor | String | No | Pagination cursor; defaults to first page |
begin | String | No | Start timestamp in milliseconds (Unix epoch) |
end | String | No | End timestamp in milliseconds; if not set, defaults to current time |
period | String | No | Time interval: 1m, 5m, 30m, 1h, or 1d (default) |
Token Address Formatting Guide
Different token standards require specific formatting:
- Native Token: Leave empty (
"") - ERC-20 / BEP-20: Use contract address (e.g.,
0x123...abc) - BRC-20:
btc-brc20-tick, e.g.,btc-brc20-ordi - Runes:
btc-runesMain-tickId, e.g.,btc-runesMain-840000:2 - SRC-20:
btc-src20-name, e.g.,btc-src20-utxo - FBRC-20 (Fractal BTC):
fbtc_fbrc20_name, e.g.,fbtc_fbrc20_babymusk
This structured naming convention ensures unambiguous identification across layered ecosystems.
Understanding the Response Structure
The API returns a clean JSON object containing an array of price points and pagination metadata.
Response Parameters
prices: Array of objects containing:time: Timestamp (in milliseconds), aligned to the minuteprice: Price value as a string with up to 18 decimals
cursor: Optional next cursor for pagination (if more results exist)
Example Response
{
"data": {
"prices": [
{ "time": "1700006400000", "price": "43567.89" },
{ "time": "1700006460000", "price": "43612.45" }
],
"cursor": "next_page_token_abc123"
}
}Each entry represents the closing price for the specified period (e.g., every 1 minute or 1 day). This makes it easy to plot trends or calculate moving averages.
Practical Use Cases
1. Portfolio Performance Tracking
Developers can integrate this API into wallet interfaces to show users how their token holdings have appreciated or depreciated over time.
2. On-Chain Analytics Dashboards
Data analysts can pull historical prices alongside transaction volumes or holder counts to identify correlations and market cycles.
3. Trading Bot Backtesting
Algorithmic traders can use granular price data (down to 1-minute intervals) to simulate strategies before live deployment.
4. NFT and Inscription Valuation Tools
With support for BRC-20 and Runes, this API helps assess the underlying value trends of Bitcoin-native digital assets.
👉 Build powerful blockchain analytics tools with access to comprehensive historical pricing data.
Best Practices for Integration
- Use pagination wisely: Set a reasonable
limitand manage thecursorto avoid timeouts when fetching long time ranges. - Cache responses: Historical data changes infrequently—caching reduces redundant calls and improves performance.
- Handle precision carefully: Always parse
priceas a decimal or BigInt to prevent floating-point errors. - Monitor rate limits: While not detailed here, production systems should implement retry logic with exponential backoff.
Frequently Asked Questions (FAQ)
Q: Can I query prices for multiple tokens in one request?
A: No, each request supports a single token. You’ll need to make separate calls for multiple tokens.
Q: What is the maximum time range I can query?
A: The API does not enforce a hard limit. However, using the begin and end parameters effectively helps manage response size and performance.
Q: Is real-time price data available through this endpoint?
A: This endpoint focuses on historical data. For live prices, consider combining it with a real-time market data API.
Q: Are all Bitcoin inscription standards supported?
A: Yes—BRC-20, Runes, ARC-20, SRC-20, and FBRC-20 on Fractal Bitcoin are all supported with standardized input formats.
Q: How often is the price data updated?
A: Prices are updated at the end of each period (e.g., every minute for 1m). Data reflects verified on-chain and market-aggregated sources.
Q: Is there a cost to use this API?
A: Usage may depend on the service tier. Check the official documentation for rate limits and access policies.
Core Keywords
This article naturally integrates the following SEO-focused keywords:
- Historical token price
- On-chain information query
- Web3 API
- Wallet API
- Token price data
- Blockchain price history
- Inscription tokens
- WaaS API
These terms reflect common search intents related to blockchain data access, developer tools, and cryptocurrency analytics.
Whether you're building a decentralized finance dashboard or analyzing Bitcoin ordinals' market trends, having reliable access to historical token prices is foundational. With robust support for both traditional and emerging token standards, this Web3 API offers a scalable solution for developers seeking accurate, structured financial data from the blockchain.