Available with: All-In-One, EOD+Intraday — All World Extended packages.
Consumption: Each request consumes 5 API calls per ticker.
Quick jump:
Get Exchange Details and Trading Hours
To get details on each exchange you should use the following URL:
https://eodhd.com/api/exchange-details/{EXCHANGE_CODE}?api_token={YOUR_API_TOKEN}&fmt=json
curl --location "https://eodhd.com/api/exchange-details/{EXCHANGE_CODE}?api_token={YOUR_API_TOKEN}&fmt=json"
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://eodhd.com/api/exchange-details/{EXCHANGE_CODE}?api_token={YOUR_API_TOKEN}&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/exchange-details/{EXCHANGE_CODE}?api_token={YOUR_API_TOKEN}&fmt=json'
data = requests.get(url).json()
print(data)
library(httr)
library(jsonlite)
url <- 'https://eodhd.com/api/exchange-details/{EXCHANGE_CODE}?api_token={YOUR_API_TOKEN}&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")
}
Please use the exchange code from the API endpoint above. With this API endpoint, you will get detailed information about each exchange we support, including:
- Timezone – the timezone of the exchange
- isOpen – boolean value which indicates if the exchange is open right now or closed.
- Trading hours and working days – open hours with working days for each exchange in the exchange timezone. This field could also include lunch hours if the exchange has it.
- ActiveTickers – tickers with any activity for the past two months.
- UpdatedTickers – tickers updated for the current day.
An example of the US exchange you can find below:
Stock Market Holidays Data API
The second important part of the same API endpoint is Stock Market Holidays Data.
https://eodhd.com/api/exchange-details/{EXCHANGE_CODE}?api_token={YOUR_API_TOKEN}&fmt=json
curl --location "https://eodhd.com/api/exchange-details/{EXCHANGE_CODE}?api_token={YOUR_API_TOKEN}&fmt=json"
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://eodhd.com/api/exchange-details/{EXCHANGE_CODE}?api_token={YOUR_API_TOKEN}&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/exchange-details/{EXCHANGE_CODE}?api_token={YOUR_API_TOKEN}&fmt=json'
data = requests.get(url).json()
print(data)
library(httr)
library(jsonlite)
url <- 'https://eodhd.com/api/exchange-details/{EXCHANGE_CODE}?api_token={YOUR_API_TOKEN}&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")
}
Additional Parameters:
- from – the format is ‘YYYY-MM-DD’. If you need data from Jan 5, 2017, to Feb 10, 2017, you should use from=2017-01-05. The default value is 6 months before the current date.
- to – the format is ‘YYYY-MM-DD’. If you need data up to Feb 10, 2022, you should use to=2022-02-10. The default value is 6 months after the current date.
We provide market holiday data for all exchanges we support. And it’s easy to understand if the exchange is open or closed on a particular day.
Exchange holidays are provided 6 months back and 6 months forward. There are also two types of holidays: bank and official. Some countries, like the United Kingdom, have bank holidays, but they are not official.
You can find the example of output below:
Symbol Change History
To get symbol change history you should use the following URL (only US exchanges are supported now):
https://eodhd.com/api/symbol-change-history?from=2022-10-01&api_token=demo&fmt=json
curl --location "https://eodhd.com/api/symbol-change-history?from=2022-10-01&api_token=demo&fmt=json"
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://eodhd.com/api/symbol-change-history?from=2022-10-01&api_token=demo&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/symbol-change-history?from=2022-10-01&api_token=demo&fmt=json' data = requests.get(url).json() print(data)
library(httr) library(jsonlite) url <- 'https://eodhd.com/api/symbol-change-history?from=2022-10-01&api_token=demo&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") }
With this API endpoint, you will get a symbol change history. The history starts from 2022-07-22 and is updated on daily basis. Only US exchanges are supported for the moment, other exchanges are coming.
The API is available under the All World Extended and All-In-One packages.
- api_token – your own API KEY, which you will get after you subscribe to our services.
- from and to – the format is ‘YYYY-MM-DD’. If you need data from Jul 22, 2022, to Aug 10, 2022, you should use from=2022-07-22 and to=2022-08-10.
An example of the output you can find here:
And do not forget to check our Exchanges API.