Documentation Index
Fetch the complete documentation index at: https://docs.codex.io/llms.txt
Use this file to discover all available pages before exploring further.
Usage Guidelines
- Maximum datapoints: 1500 per request
- Use
countback: 1500withfrom: 0for maximum results - Add
removeEmptyBars: trueto eliminate gaps in low-activity tokens - Use
currencyCode: "TOKEN"for native token pricing instead of USD - For charting by Market cap: multiply price data by
circulatingSupplyfromEnhancedToken - For volume, be sure to use
volumeinstead ofv. Due to large volume numbers exceeding max integer lengths, we needed to deprecatevin place ofvolume.
Troubleshooting Tips
When should I use getBars vs getTokenBars?
When should I use getBars vs getTokenBars?
getBars when you want price data for a specific trading pair. Use getTokenBars when you want aggregate price data for a token across all its trading pairs — it uses weighted average pricing based on liquidity.Wrong or inconsistent base token in pair (Token0 vs Token1)
Wrong or inconsistent base token in pair (Token0 vs Token1)
quoteToken parameter to auto-detect the correct base token of the pair automatically.Null or empty values returned
Null or empty values returned
-Ensure the token has started trading (we do not index tokens until trades occur)
-Use
removeLeadingNullValues: trueSome BSC tokens return stale or incorrect data, such as '0' Volume
Some BSC tokens return stale or incorrect data, such as '0' Volume
symbolType: Token to your query. This is a common issue with four.meme tokens as their pair and token address is the same.Integrating data with TradingView
Integrating data with TradingView
Updating charts in real-time
Updating charts in real-time
getBars to do an initial fetch of bars and then subscribe to onBarsUpdated to keep it updated in real-time. More info on creating real-time charts is available here.Incorrect values or errors returned with resolutions under 1m
Incorrect values or errors returned with resolutions under 1m
1S, 5S, 15S, 30S) only goes back 24 hours due to the volume of data required at those resolutions.Can I get sparklines for a past time period?
Can I get sparklines for a past time period?
tokenSparklines only returns recent values. To approximate a sparkline for a past time window, call getBars for the desired range and extract the closing values for each bar.Related Recipes
- Charts: Render token charts with OHLCV data and real-time updates