Feature Guide · Historical Data API
Historical Stock Data API: OHLCV Price History for Stocks, Forex & Crypto
Pull clean OHLCV candles from 1-minute to monthly bars through one REST endpoint. Backtest strategies, train models and fill charts with years of stock, forex, index, futures and crypto history.
- 10+ years of historical stock price data across 50+ global exchanges
- OHLCV bars from 1-minute to monthly, returned as JSON in milliseconds
- Same schema for stocks, forex, crypto, indices, futures and funds
- Free API key to start - export to CSV or pandas in a few lines
import requests
import pandas as pd
# kType = bar interval (1 = 1-minute ... 10 = monthly, see docs)
url = "https://api.itick.org/stock/kline"
params = {"region": "US", "code": "AAPL", "kType": 8, "limit": 500}
headers = {"accept": "application/json", "token": "YOUR_API_TOKEN"}
bars = requests.get(url, params=params, headers=headers, timeout=10).json()["data"]
df = pd.DataFrame(bars).rename(columns={
"t": "time", "o": "open", "h": "high", "l": "low", "c": "close", "v": "volume"
})
df["time"] = pd.to_datetime(df["time"], unit="ms")
df.to_csv("AAPL_ohlcv.csv", index=False)
print(df.tail())Everything you need from a historical market data API
Built for quants, data scientists and fintech teams who need reliable price history without scraping.
OHLCV candles
Open, high, low, close, volume and turnover for every bar - the standard OHLC data format used by backtesting libraries.
Intraday to monthly
Choose 1, 5, 15, 30 or 60-minute bars for intraday research, or daily, weekly and monthly bars for long-horizon studies.
Global stock history
US (NYSE, NASDAQ, AMEX), Hong Kong, China A-shares, Japan, Singapore and more - one historical stock price data API.
Forex historical data
Daily and intraday history for 150+ currency pairs and precious metals, ideal for FX backtests and carry analysis.
Crypto price history
Bitcoin, Ethereum and 2,000+ coins with minute-level history aggregated from major exchanges.
Easy bulk download
Page backwards with an end timestamp to download historical stock data in bulk and store it in CSV, Parquet or your database.
Historical data coverage
One request format across every asset class. Bar intervals are selected with the kType parameter.
| Asset class | Markets | Intervals | Typical use |
|---|---|---|---|
| Stocks | US, HK, China A-shares, Japan, Singapore, 50+ exchanges | 1m, 5m, 15m, 30m, 60m, D, W, M | Equity backtesting, factor research |
| Forex | 150+ currency pairs, gold and silver | 1m to monthly | FX strategy testing, risk models |
| Crypto | 2,000+ coins and trading pairs | 1m to monthly | Crypto quant, on-chain + price studies |
| Indices | 300+ global equity, commodity and volatility indices | 1m to monthly | Benchmarking, asset allocation |
| Futures | Energy, metals, agriculture (CME, ICE, SHFE ...) | 1m to monthly | Commodity research, hedging |
| Funds | Mutual funds and ETFs | Daily to monthly | Fund performance analytics |
Exact history depth varies by market and symbol. See the docs for per-market availability.
Download historical stock data in Python
Request OHLCV bars with your token, load them into pandas and save to CSV. Change the asset path to switch between stocks, forex and crypto.
- Sign up and copy your free API token
- Call /{asset}/kline with region, code, kType and limit
- Use the et (end time) parameter to page further back in history
import requests
import pandas as pd
# kType = bar interval (1 = 1-minute ... 10 = monthly, see docs)
url = "https://api.itick.org/stock/kline"
params = {"region": "US", "code": "AAPL", "kType": 8, "limit": 500}
headers = {"accept": "application/json", "token": "YOUR_API_TOKEN"}
bars = requests.get(url, params=params, headers=headers, timeout=10).json()["data"]
df = pd.DataFrame(bars).rename(columns={
"t": "time", "o": "open", "h": "high", "l": "low", "c": "close", "v": "volume"
})
df["time"] = pd.to_datetime(df["time"], unit="ms")
df.to_csv("AAPL_ohlcv.csv", index=False)
print(df.tail())Who uses historical price data
Backtesting
Test trading strategies on years of clean OHLCV data before going live.
Machine learning
Build training sets for price forecasting and volatility models.
Charting apps
Fill candlestick charts instantly with deep price history.
Research & reporting
Compute returns, drawdowns and correlations across markets.
Historical data API FAQ
What is OHLCV data?
OHLCV stands for Open, High, Low, Close and Volume - the five values that describe price action within one time bar. iTick returns OHLCV (plus turnover) for every candle, which is the format expected by pandas, Backtrader, vectorbt and most charting libraries.
Can I get free historical stock data?
Yes. Every new account receives a free API key that can query historical stock data for personal and evaluation use. Paid plans add higher rate limits, more markets and commercial usage rights.
How far back does the historical stock data go?
For major markets such as US and Hong Kong stocks, iTick provides 10+ years of daily history. Intraday minute bars and coverage for smaller markets vary by symbol - check the docs for details.
Does the API include forex and cryptocurrency historical data?
Yes. The same kline endpoint works for forex pairs, precious metals, crypto, indices, futures and funds, so you can build a multi-asset historical market data pipeline with one integration.
How do I download historical stock data in bulk?
Request the maximum number of bars per call, then pass the earliest timestamp you received as the et parameter to fetch the previous page. Loop until you reach the start date and write the results to CSV or your database.
Start downloading historical market data today
Get a free API key and pull years of OHLCV history for stocks, forex and crypto in minutes.