Performance
Optimizing your queries reduces response size, improves latency, and avoids hitting rate limits.- Always include
pagination.limitto avoid unexpectedly large responses. - Use
paramsfilters to narrow the dataset before paginating. - Use time filters to limit dataset size — request only the time range you need.
- Request narrow time ranges when querying high-volume datasets such as the Orderbook.
- Use smaller time ranges when querying high-volume markets to keep responses manageable.
Pagination
Paginating correctly ensures you retrieve complete datasets without missing records.- Always check
has_morein the response to determine whether more pages are available. - Store the current
offsetvalue as you iterate so you can resume if your process is interrupted. - Use the formula
offset = limit × (page - 1)to calculate the offset for any page.
Market data
These tips apply when querying Markets, Candlesticks, and Orderbook endpoints.- Combine
min_volumeandclosedfilters to find liquid, active markets. - Use partial slugs for broad market searches — for example,
"nba"returns all NBA markets. - Match the candlestick interval with an appropriate time range to avoid empty results. A 1-hour interval over a 5-minute window will return no data.
The Orderbook endpoint uses millisecond Unix timestamps instead of seconds. Confirm the expected timestamp unit for each endpoint before sending requests.
Trade analysis
These tips apply when querying Trades endpoints for Polymarket and Kalshi.- Use Unix timestamps as strings when filtering by time.
- Combine
market_slugwith time filters to focus your analysis on a specific market and period. - Use
transaction_hashto verify Polymarket trades on-chain. - Compare
yes_priceandno_priceacross Kalshi trades to observe probability shifts over time.
Trader analytics
These tips apply when querying Leaderboard, Wallet 360, and Lifetime Performance endpoints.- Combine Lifetime Performance data with Leaderboard results for comprehensive trader analysis.
- Use
min_total_trades_15din Leaderboard queries to filter out low-activity wallets. - Use a smaller
window_daysvalue in Wallet 360 to analyze short-term behavior. - Check
sybil_risk_flagandcombined_risk_scoreto identify wallets with suspicious activity patterns.
Security
Protect your API tokens to prevent unauthorized access to your account.- Store API tokens in environment variables rather than hardcoding them in your source code.
- Never commit tokens to version control.
- Use separate tokens for development and production environments.
- Rotate tokens periodically to limit exposure if a key is compromised.