Tutorial overview
Pull historical OHLCV from a pool usingstart, limit, and interval, with tips for smoothing and inverted ratios.
Having trouble with the API? We’re here to help - drop us a line and we’ll get you sorted.
Why you need historical price data?
Building a crypto app? You’ll likely need price charts, volatility analysis, or backtesting data. That’s where OHLCV (Open, High, Low, Close, Volume) data comes in - it’s the backbone of any serious crypto application. Common use cases:- Price charts in trading apps
- Backtesting trading strategies
- Volatility analysis for risk management
- Historical performance dashboards
- Market research and analytics
Step 1: Find your token’s trading pool
Here’s the thing - on this endpoint historical data comes from one trading pool, not from the token as a whole. This makes sense because prices happen where people trade.Quick search (recommended)
The fastest way to find what you need using the Search API:If you have the token address
Skip the search and go straight to pools using pool search with thetoken_address filter:
The
token_address filter only works on the per-network /networks/{network}/pools/search. The cross-network /pools/search accepts the parameter but silently ignores it.Always pick pools with decent volume (>$10k daily). Low-volume pools can have weird price spikes that don’t reflect real market conditions.
Step 2: Get price history data
Now for the good stuff. Here’s how to pull historical OHLCV data using the Pool OHLCV API:1h and up over the last 24 hours, which start=-24h selects. A free key opens 7 days at 10m and longer, Dev 30 days at every interval, and Pro everything. The full table is in OHLCV limits by plan.
With a free key, send it as the Authorization header on its own:
What these parameters do:
What you get back:
Time intervals that actually matter
Choose based on what you’re building, within what your plan allows: For Trading Apps:1m,5m- Real-time trading (Dev or Pro)1h,6h- Swing trading24h- Position trading
24h- Daily summaries- Use daily data and aggregate for weekly/monthly views
24hover long date ranges: 30 days back on Dev, unlimited on Pro, up to 1000 candles per request
Production tips that’ll save you time
Cache aggressively
Historical data doesn’t change - cache it locally:Handle data gaps
Some pools have quiet periods. Here’s how to deal with gaps:Multi-pool strategy
For major tokens, cross-reference data from multiple pools:Rate limiting
Don’t hammer the API. Keyless requests are capped at 15 a minute and free-key requests at 30, and Pro lifts that to 500 a minute. Batch your requests and cache results:Troubleshooting common issues
”Empty response”
Pool might not have data for your date range:“Weird price spikes”
You hit a low-liquidity period. Switch to longer intervals or higher-volume pools:“Upside-down prices”
You need the inverted ratio:“403 Forbidden”
The request asked for more history or finer candles than your plan allows. Themessage says which plan lifts the limit:
start inside the window, pick a coarser interval, or send a key. A 403 is not worth retrying unchanged.
What’s next?
Pool details API
Get liquidity, fees, and other pool metrics.
Real-time price feeds
Combine historical data with live prices.
FAQs
What if my date range predates the pool?
What if my date range predates the pool?
First check the pool’s
created_at; set start to not precede the creation time.Which interval should I use?
Which interval should I use?
For charts:
1h/24h. For anomaly smoothing: 6h/12h. For near real-time: 1m/5m, which need Dev or Pro.Why is volume zero in some windows?
Why is volume zero in some windows?
No trades occurred in that interval; aggregate longer or switch pools with higher activity.
How do I invert the pair?
How do I invert the pair?
Pass
inversed=true to flip from token0/token1 to token1/token0.Need help?
Discord community
Ask questions and see what others are building.
Direct support
Hit a wall? We’ll help you debug it.