Options Data for US Stocks: End-of-Day and Historical Learn more

End-Of-Day Historical Stock Market Data API

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.

Test Drive with "DEMO" Key
  1. 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.
  2. 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.
  3. 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
Your EODHD API token
fmt enum optional
Output format. Allowed values: csv, json (Default: csv)
period enum optional
Aggregation period. Allowed values: d (daily), w (weekly), m (monthly). Weekly and monthly bars also aggregate the volume (Default: d)
order enum optional
Sort by date. Allowed values: a (ascending, oldest to newest), d (descending, newest to oldest) (Default: a)
from date optional
Start date, YYYY-MM-DD, inclusive
to date optional
End date, YYYY-MM-DD, inclusive, on or after from
filter enum optional
Return a single value instead of the series. Allowed values: last_date, last_open, last_high, last_low, last_close, last_volume

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
(Sign up for free to get an API token)
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"
(Sign up for free to get an API token)
$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();
}
(Sign up for free to get an API token)
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)
(Sign up for free to get an API token)
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")
}
(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)

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

FieldTypeDescription
datestring (date)Trading date, YYYY-MM-DD
opennumberOpening price
highnumberHighest price of the period
lownumberLowest price of the period
closenumberClosing price, not adjusted
adjusted_closenumberClosing price adjusted for splits and dividends
volumeintegerTraded 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
(Sign up for free to get an API token)
curl --location "https://eodhd.com/api/eod/MCD.US?api_token=YOUR_TOKEN&filter=last_close&fmt=json"
(Sign up for free to get an API token)
$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();
}
(Sign up for free to get an API token)
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)
(Sign up for free to get an API token)
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")
}
(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)

Sign up & Get Data

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.

Compare plans and find your fit
Free and paid plans for individual and commercial use
Go to Pricing
Chat