OHLC API Rate Limits and Errors
Know the public limits before you build a data pipeline. This page covers request quotas, response headers, error codes and safe retry behaviour.
Updated 2026-11-02 ? Data refreshed from the AlgoSpecial catalog.
Public request limits
| Limit | Value | Scope |
|---|---|---|
| Requests per minute | 60 | Per IP address |
| Requests per day | 1,000 | Per IP address |
| Maximum rows | 50,000 | Per request |
| Maximum date range | 366 days | Per request |
No API key is required for the public tier. The limits apply to the OHLC and data quality endpoints.
Rate limit headers
| Header | Meaning |
|---|---|
X-RateLimit-Limit | Requests allowed in the current minute |
X-RateLimit-Remaining | Requests left in the current minute |
X-RateLimit-Reset | Seconds until the minute window resets |
Retry-After | Seconds to wait after a 429 response |
Error codes
| Status | Meaning | Action |
|---|---|---|
200 | Success | Use the response |
400 | Invalid parameter or date range | Fix the request; do not retry unchanged |
404 | Dataset not found | Check symbol and timeframe |
413 | More than 50,000 rows | Narrow the date range or raise the timeframe |
429 | Rate limit exceeded | Wait for Retry-After |
500 | Server error | Retry later with backoff |
Best practices for large pulls
- Cache successful responses locally instead of requesting the same range twice.
- Split multi-year M1 requests into monthly windows.
- Use higher timeframes when you do not need tick-sensitive bars.
- Respect
Retry-Afteron 429; do not use a tight retry loop. - Treat 413 as a request design problem, not a transient error.
- Keep your client timeout above the expected response time for large JSON payloads.
Request examples
Inspect headers
curl -I "https://www.algospecial.com/api/ohlc.php?symbol=XAUUSD&tf=M15&from=2026-01-01&to=2026-01-31"
Retry a 429 safely
import time
import requests
url = "https://www.algospecial.com/api/ohlc.php"
params = {
"symbol": "EURUSD",
"tf": "M15",
"from": "2026-01-01",
"to": "2026-01-31",
}
for attempt in range(3):
r = requests.get(url, params=params, timeout=30)
if r.status_code != 429:
r.raise_for_status()
print(r.json()["rows"])
break
time.sleep(int(r.headers.get("Retry-After", "60")))
else:
raise SystemExit("Rate limit retry exhausted")
Reduce rows with a higher timeframe
# Instead of a multi-year M1 request, use H1 for lower-volume research.
curl "https://www.algospecial.com/api/ohlc.php?symbol=XAUUSD&tf=H1&from=2025-01-01&to=2025-12-31"
All timestamps are broker server time. Some legacy forex exports return 0 for TickVolume and Spread because those fields were not present in the source feed.
Rate Limits FAQ
Do I need an API key?
No. The public tier is anonymous and rate-limited per IP address.
What happens after 60 requests in a minute?
The API returns 429 with Retry-After. Wait for that many seconds before retrying.
Why did I get 413?
The requested range would return more than 50,000 rows. Narrow the dates or use a higher timeframe.
Are limits per endpoint or shared?
The public limits apply to the API surface; the OHLC and quality endpoints share the same per-IP allowance.
Can I request multiple symbols in one call?
No. One request returns one symbol and one timeframe. Make separate requests and cache each result.
Choose the next useful step
Most visitors arrive with one question: build, test, price, or trust. These shortcuts keep the path practical.
Go deeper before you build, download or automate
Hand-picked engineering articles, indicator breakdowns and trading-system tools so visitors keep exploring instead of leaving after one page.
Pine Script to MT4/MT5 Conversion Planner
Analyze Pine strategies, repainting risk, TradingView alert bridges, MTF synchronization and the correct MQL4/MQL5 build path before paying for conversion.
Open planner
3-in-1 MT5 Indicator Bundle
12H Bias Engine, Smart Money Institutional Flow Dashboard and D1/H1 pending-signal logic with MQ5 + EX5 source included via Etsy.
MT5 Bank Orders Institutional Flow Dashboard
Supply/demand zones, BOS/CHoCH, liquidity levels, FVG, equal highs/lows and confirmed trade-plan logic explained with EX5 download.
MT5 Asia London NY Liquidity Engine
Asia range, London raid and New York continuation/reversal planning with internal session backtest stats and entry/SL/TP dashboard.
Interactive Brokers RSI Pair Trader
Tkinter desktop trading workflow, TWS API connection handling, RSI pair logic, risk controls and custom IBKR development positioning.
XAUUSD M30 CSV Data For Backtesting
Use clean MT5 historical data for Python backtests, strategy validation, spread checks and realistic gold EA research workflows.