The Intraday Historical Data API returns OHLCV bars within the trading day, at intervals from one minute to one hour. It is used to backtest strategies, study intraday volatility and volume, and analyse short-term price behaviour for stocks, forex, and cryptocurrencies on major exchanges worldwide.
The Endpoint
Retrieve intraday OHLCV bars for one symbol at a chosen interval. The ticker follows the CODE.EXCHANGE format, for example AAPL.US or EURUSD.FOREX. The time window is given with Unix timestamps.
https://eodhd.com/api/intraday/{ticker}?api_token=YOUR_TOKEN&interval=5m
https://eodhd.com/api/intraday/AAPL.US?api_token=demo&interval=5m&fmt=json&from=1627896900&to=1630575300
(Sign up for free to get an API token)
curl --location "https://eodhd.com/api/intraday/AAPL.US?api_token=demo&interval=5m&fmt=json&from=1627896900&to=1630575300"
(Sign up for free to get an API token)
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://eodhd.com/api/intraday/AAPL.US?api_token=demo&interval=5m&fmt=json&from=1627896900&to=1630575300',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
));
$data = curl_exec($curl);
curl_close($curl);
try {
$data = json_decode($data, true, 512, JSON_THROW_ON_ERROR);
var_dump($data);
} catch (Exception $e) {
echo 'Error. '.$e->getMessage();
}
(Sign up for free to get an API token)
import requests
url = f'https://eodhd.com/api/intraday/AAPL.US?api_token=demo&interval=5m&fmt=json&from=1627896900&to=1630575300'
data = requests.get(url).json()
print(data)
(Sign up for free to get an API token)
library(httr)
library(jsonlite)
url <- 'https://eodhd.com/api/intraday/AAPL.US?api_token=demo&interval=5m&fmt=json&from=1627896900&to=1630575300'
response <- GET(url)
if (http_type(response) == "application/json") {
content <- content(response, "text", encoding = "UTF-8")
cat(content)
} else {
cat("Error while receiving data\n")
}
(Sign up for free to get an API token)
New to coding? Our ChatGPT assistant can generate code in any language tailored to our API.
Simply describe how you want to use our data, and get a working piece of code.
Don’t forget to replace the API token with your own.
Try it now (it's free)!
How to use it (YouTube)
Try it now (it's free)!
How to use it (YouTube)
Parameters
api_token
string
required
Your EODHD API token
interval
enum
optional
Bar interval. Allowed values: 1m, 5m, 1h
(Default: 5m)
from
integer
optional
Start time as a Unix timestamp in UTC, for example 1627896900 (2021-08-02 09:35:00)
to
integer
optional
End time as a Unix timestamp in UTC, on or after from
split-dt
integer
optional
Set to 1 to return date and time as two separate fields instead of a single datetime (useful for Zorro)
fmt
enum
optional
Output format. Allowed values: csv, json
(Default: csv)
Response Example
[
{
"timestamp": 1700058600,
"gmtoffset": 0,
"datetime": "2023-11-15 14:30:00",
"open": 187.845001,
"high": 188.699996,
"low": 187.800003,
"close": 188.149993,
"volume": 11861855
},
{
"timestamp": 1700062200,
"gmtoffset": 0,
"datetime": "2023-11-15 15:30:00",
"open": 188.149993,
"high": 188.559997,
"low": 187.660003,
"close": 187.889999,
"volume": 6482122
}
]
Response Fields
| Field | Type | Description |
|---|---|---|
| timestamp | integer | Bar start time as a Unix timestamp (UTC) |
| gmtoffset | integer | GMT offset in seconds, usually 0 (UTC) |
| datetime | string | Bar start time, YYYY-MM-DD HH:MM:SS in UTC. With split-dt=1 this is replaced by separate date and time fields |
| open | number | Opening price of the interval |
| high | number | Highest price of the interval |
| low | number | Lowest price of the interval |
| close | number | Closing price of the interval |
| volume | integer | Traded volume in the interval |
Data Availability
US Stocks (NYSE and NASDAQ)
- 1-minute data available since 2004, including pre-market and after-hours trading.
- 5-minute and 1-hour intervals available from October 2020.
Other Exchanges
- 5-minute and 1-hour intervals available from October 2020.
- 1-minute data may be available depending on the ticker and exchange; it is not guaranteed and varies.
Forex and Cryptocurrencies
- 1-minute data available since 2009.
- 5-minute and 1-hour intervals available from October 2020.
Time Range Limitations
Each interval allows a maximum from-to window per request. If no from and to are given, the last 120 days are returned.
| Interval | Maximum range (from to to) |
|---|---|
| 1m | 120 days |
| 5m | 600 days |
| 1h | 7200 days |
Data Updates
- Intraday data is delayed and finalized about 2-3 hours after the market close.
- For US tickers, 1-minute data is updated 2-3 hours after the end of after-hours trading.
Compare plans and find your fit
Free and paid plans for individual and commercial use