Available with: All-In-One, EOD Historical Data — All World, EOD+Intraday — All World Extended and Free packages.
Consumption: Each request consumes 1 API call per ticker.
With this API endpoint, you are able to get delayed (15-20 minutes) information about almost all stocks on the market.
Quick jump:
Major features
- We support almost all symbols and exchanges all around the world.
- Prices are provided with 15-20 minutes delay.
- We provide only a 1-minute interval within this API, then you will get prices only with 1-minute frequency.
- Multiple tickers with one request.
- Supports Excel WEBSERVICE.
Examples
Here is an example of live (delayed) stock prices API for AAPL (Apple Inc), please notice, that API token ‘demo’ works only for AAPL.US symbol:
https://eodhd.com/api/real-time/AAPL.US?api_token=demo&fmt=json
curl --location "https://eodhd.com/api/real-time/AAPL.US?api_token=demo&fmt=json"
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://eodhd.com/api/real-time/AAPL.US?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/real-time/AAPL.US?api_token=demo&fmt=json'
data = requests.get(url).json()
print(data)
library(httr)
library(jsonlite)
url <- 'https://eodhd.com/api/real-time/AAPL.US?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")
}
The output for the URL above will be like this:
Timestamp field explanation
We use Unix time for our timestamp field. It is a system for describing a point in time, defined as the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970. You can easily check and convert all our timestamps here: http://www.onlineconversion.com/unix_time.htm.
For example, for output above 1509733800 it will be Fri, 03 Nov 2017 18:30:00 GMT.
Multiple Tickers with One Request
Just add “s=” parameter to your URL and you will be able to get data for multiple tickers at one request, all tickers should be separated with a comma. For example, you can get data for AAPL.US, VTI, and EUR.FOREX with the following request:
https://eodhd.com/api/real-time/AAPL.US?s=VTI,EUR.FOREX&api_token=demo&fmt=json
curl --location "https://eodhd.com/api/real-time/AAPL.US?s=VTI,EUR.FOREX&api_token=demo&fmt=json"
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://eodhd.com/api/real-time/AAPL.US?s=VTI,EUR.FOREX&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/real-time/AAPL.US?s=VTI,EUR.FOREX&api_token=demo&fmt=json'
data = requests.get(url).json()
print(data)
library(httr)
library(jsonlite)
url <- 'https://eodhd.com/api/real-time/AAPL.US?s=VTI,EUR.FOREX&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")
}
Please note, that AAPL.US used here at the beginning and additional tickers with the parameter “s=”.
We do not recommend using more than 15-20 tickers per request.
Excel WEBSERVICE support
If you need only one field, just use the ‘filter=FIELDNAME’ parameter. For examples, if you use the following URL:
https://eodhd.com/api/real-time/AAPL.US?filter=close&api_token=demo&fmt=json
curl --location "https://eodhd.com/api/real-time/AAPL.US?filter=close&api_token=demo&fmt=json"
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://eodhd.com/api/real-time/AAPL.US?filter=close&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/real-time/AAPL.US?filter=close&api_token=demo&fmt=json'
data = requests.get(url).json()
print(data)
library(httr)
library(jsonlite)
url <- 'https://eodhd.com/api/real-time/AAPL.US?filter=close&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")
}
Then only one number will be returned: 172.5. Which is very useful for Excel WEBSERVICE function like this:
=WEBSERVICE("https://eodhd.com/api/real-time/AAPL.US?filter=close&api_token=demo&fmt=json")
We support live (delayed) stock prices data both in JSON and CSV format, if you want to get a CSV output, just change ‘fmt=json’ to ‘fmt=csv’ or simply remove this parameter.
We have API limits 100 000 requests per day. Each symbol request costs 1 API call. For example, multiple tickers request with 10 symbols costs 10 API calls.
Enjoy!