Overview
The End-of-Day (EOD) Historical Data API returns daily, weekly, or monthly open, high, low, close, adjusted close, and volume for a single symbol. History reaches back over 30 years for many instruments and covers stocks, ETFs, funds, indices, forex, and cryptocurrencies across supported exchanges.
- You can start with "DEMO" API key to test the data for a few tickers only: AAPL.US, TSLA.US, VTI.US, AMZN.US, BTC-USD.CC and EURUSD.FOREX. For these tickers, all of our types of data (APIs), including Real-Time Data, are available without limitations.
- Register for the free plan to receive your API key (limited to 20 API calls per day) with access to End-Of-Day Historical Stock Market Data API for any ticker, but within the past year only. Plus a List of tickers per Exchange is available.
- We recommend to explore our plans, starting from $19.99, to access the necessary type of data without limitations.
End-of-Day Historical Data
Returns the full end-of-day price series for one symbol, or a slice of it when the date range is set. Prices can be aggregated to daily, weekly, or monthly bars and returned oldest-first or newest-first.
https://eodhd.com/api/eod/{ticker}?api_token=YOUR_TOKEN
Method GET. Authentication by api_token. The default output is CSV; add fmt=json for a JSON array of daily records. When a single-value filter is set, the response is one bare value instead of the series.
Keep your API token secret and never expose it in client-side code.
Requests without a valid api_token return HTTP 401 (Unauthenticated).
Parameters
api_token
string
required
fmt
enum
optional
period
enum
optional
order
enum
optional
from
date
optional
to
date
optional
filter
enum
optional
Request Example
https://eodhd.com/api/eod/MCD.US?api_token=YOUR_TOKEN&from=2024-01-02&to=2024-01-05&period=d&fmt=json
curl --location "https://eodhd.com/api/eod/MCD.US?api_token=YOUR_TOKEN&from=2024-01-02&to=2024-01-05&period=d&fmt=json"
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://eodhd.com/api/eod/MCD.US?api_token=YOUR_TOKEN&from=2024-01-02&to=2024-01-05&period=d&fmt=json',
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();
}
import requests
url = f'https://eodhd.com/api/eod/MCD.US?api_token=YOUR_TOKEN&from=2024-01-02&to=2024-01-05&period=d&fmt=json'
data = requests.get(url).json()
print(data)
library(httr)
library(jsonlite)
url <- 'https://eodhd.com/api/eod/MCD.US?api_token=YOUR_TOKEN&from=2024-01-02&to=2024-01-05&period=d&fmt=json'
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")
}
Try it now (it's free)!
How to use it (YouTube)
Response Example
[
{
"date": "2024-01-02",
"open": 295.05,
"high": 297.28,
"low": 295.05,
"close": 297.04,
"adjusted_close": 279.9221,
"volume": 4458400
},
{
"date": "2024-01-03",
"open": 297,
"high": 297.99,
"low": 294.25,
"close": 294.39,
"adjusted_close": 277.4248,
"volume": 3114800
}
]
Response Fields
| Field | Type | Description |
|---|---|---|
| date | string (date) | Trading date, YYYY-MM-DD |
| open | number | Opening price |
| high | number | Highest price of the period |
| low | number | Lowest price of the period |
| close | number | Closing price, not adjusted |
| adjusted_close | number | Closing price adjusted for splits and dividends |
| volume | integer | Traded volume over the period, adjusted for splits |
Adjustment behavior. The OHLC values (open, high, low, close) are raw — adjusted for neither splits nor dividends. The adjusted_close field is adjusted for both splits and dividends, while volume is adjusted for splits. If you need OHLC adjusted for splits only, use the Technical API with function=splitadjusted.
Single Value Output
Set the filter parameter to return only the last known value as a single bare number or string, instead of the full series. This is convenient for spreadsheet functions such as the Excel WEBSERVICE function. For example, filter=last_close returns the latest close and filter=last_volume returns the latest volume.
https://eodhd.com/api/eod/MCD.US?api_token=YOUR_TOKEN&filter=last_close&fmt=json
curl --location "https://eodhd.com/api/eod/MCD.US?api_token=YOUR_TOKEN&filter=last_close&fmt=json"
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://eodhd.com/api/eod/MCD.US?api_token=YOUR_TOKEN&filter=last_close&fmt=json',
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();
}
import requests
url = f'https://eodhd.com/api/eod/MCD.US?api_token=YOUR_TOKEN&filter=last_close&fmt=json'
data = requests.get(url).json()
print(data)
library(httr)
library(jsonlite)
url <- 'https://eodhd.com/api/eod/MCD.US?api_token=YOUR_TOKEN&filter=last_close&fmt=json'
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")
}
Try it now (it's free)!
How to use it (YouTube)
End-of-Day Historical Prices Update Time
We update each stock exchange 2-3 hours after the market closes. Major US exchanges, NYSE and NASDAQ, are updated within 15 minutes after the market closes. US mutual funds, PINK, OTCBB, and some indices update only the next morning, starting at 3-4 am EST and usually ending at 5-6 am EST. For these symbols we always hold the updated price up to 3-4 am.