Available with: All-In-One, EOD Historical Data — All World, EOD+Intraday — All World Extended, Fundamentals Data Feed and Free packages.
Consumption: Each request consumes 1 API call.
Our Search API for Stocks, ETFs, Mutual Funds, and Indices is one of the best ways to quickly search assets either by code or by company or asset name. The search engine automatically understands if there asset name or code or even ISIN and prioritizes the search fields accordingly. The search engine has several parameters for result ordering. We take into account not only search queries but also market capitalization and the average trading volume for the past period.
Quick jump:
Basic URL to access:
https://eodhd.com/api/search/{query_string}?api_token={YOUR_API_TOKEN}&fmt=json
curl --location "https://eodhd.com/api/search/{query_string}?api_token={YOUR_API_TOKEN}&fmt=json"
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://eodhd.com/api/search/{query_string}?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/search/{query_string}?api_token={YOUR_API_TOKEN}&fmt=json'
data = requests.get(url).json()
print(data)
library(httr)
library(jsonlite)
url <- 'https://eodhd.com/api/search/{query_string}?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")
}
Parameters
- {query_string}: String. REQUIRED. Could be any string with a ticker code or company name. Examples: ‘AAPL’, ‘Apple Inc’, ‘Apple’. You can also use ISINs for the search: US0378331005. There are no limitations to a minimum number of symbols in the query string.
- limit: Number. OPTIONAL. The number of results returned for the query. Default value: 15. The maximum possible value is 500.
- bonds_only: Number. OPTIONAL. The default value is 0 and search returns only tickers, ETFs, and funds. To get bonds in result use value 1: “bonds_only=1”.
- exchange: String. Optional. Filters output by exchange. Allowed input is the exchange code, for example: US, PA, CC, FOREX and others. In addition, it’s possible to use ‘NYSE’ and ‘NASDAQ’ exchange codes to filter out only tickers from these exchanges.
- api_token: String. REQUIRED. Your api_token to access the API. You will get it after registration.
- type: String. OPTIONAL. The default value is ‘all’. You can specify the type of asset you search for.
- Possible values: all, stock, etf, fund, bond, index, crypto.
- Please note: with the value ‘all’ bonds will not be displayed, you should explicitly request bonds.
The demo API key does not work for search API, but you can get access to the stock search by registering in our service and getting the free API key.
Examples
An example of using Stock Search API to get all tickers with AAPL code
https://eodhd.com/api/search/AAPL?api_token={YOUR_API_TOKEN}&fmt=json
curl --location "https://eodhd.com/api/search/AAPL?api_token={YOUR_API_TOKEN}&fmt=json"
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://eodhd.com/api/search/AAPL?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/search/AAPL?api_token={YOUR_API_TOKEN}&fmt=json'
data = requests.get(url).json()
print(data)
library(httr)
library(jsonlite)
url <- 'https://eodhd.com/api/search/AAPL?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")
}
An example of using Stock Search API to get all tickers with the company name ‘Apple Inc’
https://eodhd.com/api/search/Apple Inc?api_token={YOUR_API_TOKEN}&fmt=json
curl --location "https://eodhd.com/api/search/Apple Inc?api_token={YOUR_API_TOKEN}&fmt=json"
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://eodhd.com/api/search/Apple Inc?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/search/Apple Inc?api_token={YOUR_API_TOKEN}&fmt=json'
data = requests.get(url).json()
print(data)
library(httr)
library(jsonlite)
url <- 'https://eodhd.com/api/search/Apple Inc?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")
}
An example of using Stock Search API to get all tickers with AAPL code and limit only 1 result
https://eodhd.com/api/search/Apple Inc?limit=1&api_token={YOUR_API_TOKEN}&fmt=json
curl --location "https://eodhd.com/api/search/Apple Inc?limit=1&api_token={YOUR_API_TOKEN}&fmt=json"
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://eodhd.com/api/search/Apple Inc?limit=1&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/search/Apple Inc?limit=1&api_token={YOUR_API_TOKEN}&fmt=json' data = requests.get(url).json() print(data)
library(httr) library(jsonlite) url <- 'https://eodhd.com/api/search/Apple Inc?limit=1&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") }
Output
The output of Stock Search API is available only in JSON format now, here you can see an example:
Each request to the Search Stocks API consumes 1 API call from the daily API limit.