### Python Financial Library Examples Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Provides installation, functions, and code samples for using the Python financial library to access EOD Historical Data. This library simplifies data retrieval for various financial metrics. ```Python from eodhd import API api_key = 'YOUR_API_KEY' api = API(api_key) # Get historical data for AAPL data = api.get_historical_data('AAPL.US') print(data) ``` -------------------------------- ### PHP/Laravel API Examples Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Code examples for integrating EOD Historical Data APIs with PHP and Laravel applications. Covers fetching various financial data points. ```PHP ``` -------------------------------- ### Java API Examples Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Illustrates how to use Java to access EOD Historical Data APIs for retrieving financial information. ```java import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; public class EodApiExample { public static void main(String[] args) throws Exception { String apiKey = "YOUR_API_KEY"; String symbol = "AAPL.US"; String url = String.format("https://eodhd.com/api/eod-bulk-get-prices?api_token=%s&fmt=json", apiKey); HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } } ``` -------------------------------- ### Fetch EOD Data using R httr Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Fetches End-of-Day stock data using R's httr and jsonlite libraries. It makes a GET request to the API and prints the content if it's in CSV format. Ensure you have 'httr' and 'jsonlite' installed (`install.packages(c('httr', 'jsonlite'))`). ```r library(httr) library(jsonlite) url <- 'https://eodhd.com/api/eod/MCD.US?period=d&api_token=demo&fmt=csv' response <- GET(url) if (http_type(response) == "application/csv") { content <- content(response, "text", encoding = "UTF-8") cat(content) } else { cat("Error while receiving data\n") } ``` -------------------------------- ### Fetch EOD Data using Python Requests Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Fetches End-of-Day stock data using Python's requests library. It constructs the API URL with a demo token and prints the binary content of the response. Make sure to install the 'requests' library (`pip install requests`). ```python import requests url = f'https://eodhd.com/api/eod/MCD.US?period=d&api_token=demo&fmt=csv' data = requests.get(url).content print(data) ``` -------------------------------- ### CLI (Curl) API Examples Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Demonstrates how to use command-line tools like curl to interact with EOD Historical Data APIs. This is useful for scripting and automated data fetching. ```bash curl -s "https://eodhd.com/api/eod-bulk-get-prices?api_token=YOUR_API_TOKEN&fmt=json" curl -s "https://eodhd.com/api/exchanges-list?api_token=YOUR_API_TOKEN&fmt=json" ``` -------------------------------- ### Matlab API Examples Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Code snippets for using Matlab to fetch and analyze financial data from EOD Historical Data APIs. ```matlab apiKey = 'YOUR_API_KEY'; symbol = 'AAPL.US'; url = sprintf('https://eodhd.com/api/eod-bulk-get-prices?api_token=%s&fmt=json', apiKey); options = weboptions('ContentType', 'json'); response = webread(url, options); disp(response); ``` -------------------------------- ### Live (Delayed) Stock Prices API Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Get live (delayed) stock prices for US and global stocks, currencies, and other financial instruments. ```APIDOC Endpoint: /live-bulk-get-prices Description: Retrieves live (delayed) stock prices for multiple symbols. Parameters: - api_token (string, required): Your EOD Historical Data API key. - symbols (string, required): Comma-separated list of stock symbols (e.g., AAPL.US,MSFT.US). - fmt (string, optional): Output format (json, csv). Defaults to json. Returns: JSON or CSV object containing live price data for each symbol, including: - code (string): Stock symbol. - exchange (string): Exchange code. - timestamp (integer): Unix timestamp of the last trade. - gmtoffset (integer): Timezone offset in seconds. - open (float): Opening price. - high (float): Highest price. - low (float): Lowest price. - close (float): Closing price. - volume (integer): Trading volume. - previous_close (float): Previous day's closing price. - change (float): Price change from previous close. - change_percent (float): Percentage change from previous close. Example: GET https://eodhd.com/api/live-bulk-get-prices?api_token=YOUR_API_TOKEN&symbols=AAPL.US,GOOGL.US&fmt=json ``` -------------------------------- ### cURL Request for Yahoo Style Data Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Example of making a GET request to the EOD Historical Data API using cURL, formatted in the Yahoo Finance style. This fetches daily data for MCD.US from May 1st, 2017, to October 2nd, 2017, with JSON output. ```cURL curl --location "https://eodhd.com/api/table.csv?s=MCD.US&a=05&b=01&c=2017&d=10&e=02&f=2017&g=d&api_token=demo&fmt=json" ``` -------------------------------- ### Fetch EOD Data by Date Range Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Fetches End-of-Day stock data for a specified date range. Requires a stock ticker, start date, end date, and an API token. The data is returned in JSON format. ```URL https://eodhd.com/api/eod/MCD.US?from=2020-01-05&to=2020-02-10&period=d&api_token=demo&fmt=json ``` -------------------------------- ### Fetch EOD Data using PHP cURL Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Fetches End-of-Day stock data using PHP's cURL library. It sets various cURL options for the request and prints the received data. Ensure you have cURL enabled in your PHP installation. ```php 'https://eodhd.com/api/eod/MCD.US?period=d&api_token=demo&fmt=csv', 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); echo $data; ?> ``` -------------------------------- ### Exchanges API Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Get lists of stock market codes, covered tickers, and trading hours for various exchanges worldwide. ```APIDOC Endpoint: /exchanges-list Description: Retrieves a list of supported exchanges and their details. Parameters: - api_token (string, required): Your EOD Historical Data API key. - fmt (string, optional): Output format (json, csv). Defaults to json. Returns: JSON or CSV array of exchange objects, each containing: - code (string): Exchange code (e.g., 'US'). - name (string): Exchange name (e.g., 'United States'). - country (string): Country of the exchange. - timezone (string): Timezone of the exchange. Example: GET https://eodhd.com/api/exchanges-list?api_token=YOUR_API_TOKEN&fmt=json ``` -------------------------------- ### Fetch EOD Data by Date Range (PHP) Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Fetches End-of-Day stock data for a specified date range using PHP. Requires a stock ticker, start date, end date, and an API token. The data is returned in JSON format and then decoded. ```PHP $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://eodhd.com/api/eod/MCD.US?from=2020-01-05&to=2020-02-10&period=d&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(); } ``` -------------------------------- ### Python Request for Yahoo Style Data Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Python script using the 'requests' library to fetch data from the EOD Historical Data API in Yahoo Finance style. It makes a GET request and directly parses the JSON response. ```Python import requests url = f'https://eodhd.com/api/table.csv?s=MCD.US&a=05&b=01&c=2017&d=10&e=02&f=2017&g=d&api_token=demo&fmt=json' data = requests.get(url).json() print(data) ``` -------------------------------- ### R Request for Yahoo Style Data Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes R script using the 'httr' and 'jsonlite' libraries to fetch data from the EOD Historical Data API in Yahoo Finance style. It performs a GET request and checks the content type before printing the JSON response. ```R library(httr) library(jsonlite) url <- 'https://eodhd.com/api/table.csv?s=MCD.US&a=05&b=01&c=2017&d=10&e=02&f=2017&g=d&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") } ``` -------------------------------- ### Fetch EOD Data by Date Range (R) Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Fetches End-of-Day stock data for a specified date range using R's httr and jsonlite libraries. Requires a stock ticker, start date, end date, and an API token. The data is returned in JSON format. ```R library(httr) library(jsonlite) url <- 'https://eodhd.com/api/eod/MCD.US?from=2020-01-05&to=2020-02-10&period=d&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") } ``` -------------------------------- ### Get End-of-Day Data (CSV) Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Fetches End-of-Day (EOD) stock price data in CSV format for a specified ticker. Supports daily period and requires an API token. ```URL https://eodhd.com/api/eod/MCD.US?period=d&api_token=demo&fmt=csv ``` ```cURL curl --location "https://eodhd.com/api/eod/MCD.US?period=d&api_token=demo&fmt=csv" ``` ```PHP $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://eodhd.com/api/eod/MCD.US?period=d&api_token=demo&fmt=csv', ``` -------------------------------- ### Get End-of-Day Data (JSON) Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Fetches End-of-Day (EOD) stock price data in JSON format for a specified ticker. Requires an API token and supports a 'demo' token for testing. ```URL https://eodhd.com/api/eod/MCD.US?api_token=demo&fmt=json ``` ```cURL curl --location "https://eodhd.com/api/eod/MCD.US?api_token=demo&fmt=json" ``` ```PHP $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://eodhd.com/api/eod/MCD.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(); } ``` ```Python import requests url = f'https://eodhd.com/api/eod/MCD.US?api_token=demo&fmt=json' data = requests.get(url).json() print(data) ``` ```R library(httr) library(jsonlite) url <- 'https://eodhd.com/api/eod/MCD.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") } ``` -------------------------------- ### Fetch EOD Data by Date Range (Python) Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Fetches End-of-Day stock data for a specified date range using Python's requests library. Requires a stock ticker, start date, end date, and an API token. The data is returned in JSON format. ```Python import requests url = f'https://eodhd.com/api/eod/MCD.US?from=2020-01-05&to=2020-02-10&period=d&api_token=demo&fmt=json' data = requests.get(url).json() print(data) ``` -------------------------------- ### Fetch EOD Data by Date Range (cURL) Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Fetches End-of-Day stock data for a specified date range using cURL. Requires a stock ticker, start date, end date, and an API token. The data is returned in JSON format. ```cURL curl --location "https://eodhd.com/api/eod/MCD.US?from=2020-01-05&to=2020-02-10&period=d&api_token=demo&fmt=json" ``` -------------------------------- ### PHP Request for Yahoo Style Data Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes PHP script to fetch data from the EOD Historical Data API using the Yahoo Finance style endpoint. It makes a GET request and attempts to decode the JSON response. Includes error handling for JSON decoding. ```PHP $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://eodhd.com/api/table.csv?s=MCD.US&a=05&b=01&c=2017&d=10&e=02&f=2017&g=d&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(); } ``` -------------------------------- ### EOD Data API Documentation Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes This section provides access to the API documentation for various financial data feeds offered by EOD Data. It covers End-of-Day historical data, live and intraday prices, US stock options, fundamental data, financial news, and more. ```APIDOC EOD Data APIs Overview: - **US Stock Options End-of-Day Data API**: Provides 6000+ US Stock Options End-of-Day Data with 40+ fields. - **Fundamental API**: Offers stock and ETF fundamental data. - **Live (Delayed) API**: Provides delayed real-time stock data. - **EOD Historical API**: Access to historical data and volumes for stocks. - **Options (US Stocks) API**: Specific API for US stock options data. - **Intraday API**: Access to intraday historical data. - **Real-Time (Websockets) API**: New real-time data via websockets. - **Financial News API**: Provides stock market financial news. - **Delisted Data API**: Historical stock prices for delisted companies. - **Indices Historical Constituents API**: Data for index constituents. - **Forex Data APIs**: APIs for foreign exchange data. Developer Tools & Solutions: - **EOD Data Downloader (FTP Alternative)** - **EODHD ChatGPT Assistant** - **Forex Tools & Converter** - **Google Sheets Add-on** - **Excel Add-on** - **Coding Libraries (Python, R, etc.)** - **Wordpress Add-on** B2B Solutions: - **Pricing (Commercial Use)** - **Investment Platform** - **For Universities** - **Investor Relations Page Creator** - **Business Solutions** - **API Marketplace** ``` -------------------------------- ### Real-Time Data API (WebSockets) Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Connect to real-time data streams using WebSockets for instant updates on stock prices and market events. ```APIDOC Endpoint: WebSocket Description: Provides real-time streaming data for subscribed symbols. Connection: Establish a WebSocket connection to wss://eodhd.com/api/ws?api_token=YOUR_API_TOKEN Subscription: Send a JSON message to subscribe to symbols: {"action": "subscribe", "symbols": ["AAPL.US", "MSFT.US"]} Unsubscription: Send a JSON message to unsubscribe: {"action": "unsubscribe", "symbols": ["AAPL.US"]} Data Format: Received messages will be in JSON format, containing real-time updates for subscribed symbols, including: - code (string): Stock symbol. - price (float): Current price. - change (float): Price change. - change_percent (float): Percentage change. - volume (integer): Current volume. - timestamp (integer): Unix timestamp. Example: Client connects to WebSocket, sends subscribe message, and receives price updates. ``` -------------------------------- ### Excel Add-on for Financial Data Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Information and video tutorials on using the Excel Add-on for accessing historical, EOD, intraday, and fundamental financial data directly within Excel. ```Excel =EODHD_GET_HISTORICAL('AAPL.US', '2023-01-01', '2023-12-31', 'Close') ``` -------------------------------- ### Yahoo Finance API Support Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Provides access to historical stock data that is compatible with the Yahoo Finance API format. This enables seamless integration for users accustomed to Yahoo Finance data structures. ```APIDOC APIDOC: Endpoint: /api/eod/{Code}.{fmt} Description: Retrieves End-of-Day historical data formatted similarly to Yahoo Finance. Parameters: Code: The stock ticker symbol. fmt: The output format (json, csv). api_token: Your API access token. from_api: Set to 'YAHOO' to retrieve data in Yahoo Finance format. Example: GET https://eodhistoricaldata.com/api/eod/AMZN.US.json?api_token=YOUR_API_TOKEN&from_api=YAHOO Response: Historical data fields are mapped to Yahoo Finance conventions. ``` -------------------------------- ### Stock Prices Data API with Dates Support Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Fetches stock prices data with support for specific date ranges. This API allows users to query historical data between a 'date_from' and 'date_to' parameter, providing flexibility in data retrieval. ```APIDOC APIDOC: Endpoint: /api/historical-prices/{Code}.{fmt} Description: Retrieves historical stock prices data for a given ticker within a specified date range. Parameters: Code: The stock ticker symbol (e.g., MSFT.US). fmt: The output format (e.g., json, csv). Defaults to json. api_token: Your API access token. date_from: The start date for the data retrieval (YYYY-MM-DD). date_to: The end date for the data retrieval (YYYY-MM-DD). Example: GET https://eodhistoricaldata.com/api/historical-prices/MSFT.US.json?api_token=YOUR_API_TOKEN&date_from=2021-01-01&date_to=2021-06-30 Response: Returns historical price data including open, high, low, close, and volume for the specified period. ``` -------------------------------- ### JSON Output Support Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Enables the retrieval of historical stock data in JSON format. This is the default format and is widely used for web-based applications and data processing. ```APIDOC APIDOC: Endpoint: /api/eod/{Code}.json Description: Retrieves End-of-Day historical data in JSON format. Parameters: Code: The stock ticker symbol. api_token: Your API access token. date_from: Start date (YYYY-MM-DD). date_to: End date (YYYY-MM-DD). Example: GET https://eodhistoricaldata.com/api/eod/NVDA.US.json?api_token=YOUR_API_TOKEN&date_from=2022-01-01&date_to=2022-12-31 Response: A JSON object containing an array of daily stock data. ``` -------------------------------- ### Fundamental Data API Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Access fundamental data for stocks, ETFs, and mutual funds, including financial statements, ratios, and key metrics. ```APIDOC Endpoint: /fundamentals Description: Retrieves fundamental data for a given stock symbol. Parameters: - api_token (string, required): Your EOD Historical Data API key. - symbol (string, required): The stock symbol (e.g., AAPL.US). - period_type (string, optional): 'annual' or 'quarterly'. Defaults to 'quarterly'. - fmt (string, optional): Output format (json, csv). Defaults to json. Returns: JSON or CSV object containing fundamental data, including: - code (string): Stock symbol. - date (string): Date of the financial report. - type (string): 'MRQ', 'FQ', 'FY'. - updated_at (string): Timestamp of the last update. - earnings_date (string): Expected earnings release date. - financial_statements (object): Contains income_statement, balance_sheet, cash_flow. - ratios (object): Financial ratios. Example: GET https://eodhd.com/api/fundamentals?api_token=YOUR_API_TOKEN&symbol=AAPL.US&period_type=annual&fmt=json ``` -------------------------------- ### JSON Output API Request Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes This snippet shows how to request data from the EOD Historical Data API with JSON output. It uses the standard endpoint and specifies the 'fmt=json' parameter. This format is not compatible with the Yahoo-like style. ```APIDOC Endpoint: https://eodhd.com/api/eod/{symbol} Parameters: - from: Start date (YYYY-MM-DD) - to: End date (YYYY-MM-DD) - period: Data period (d for daily, w for weekly, m for monthly) - api_token: Your API token - fmt: Output format (must be json for JSON output) ``` -------------------------------- ### Fetch Last Close Price (R) Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Fetches only the last closing price for a stock using R's httr and jsonlite libraries. This is useful for integration with spreadsheet functions like WEBSERVICE. Requires a stock ticker, a filter parameter, and an API token. ```R library(httr) library(jsonlite) url <- 'https://eodhd.com/api/eod/MCD.US?filter=last_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") } ``` -------------------------------- ### Fetch Last Close Price (Python) Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Fetches only the last closing price for a stock using Python's requests library. This is useful for integration with spreadsheet functions like WEBSERVICE. Requires a stock ticker, a filter parameter, and an API token. ```Python import requests url = f'https://eodhd.com/api/eod/MCD.US?filter=last_close&api_token=demo&fmt=json' data = requests.get(url).json() print(data) ``` -------------------------------- ### Fetch Last Close Price (URL) Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Fetches only the last closing price for a stock. This is useful for integration with spreadsheet functions like WEBSERVICE. Requires a stock ticker, a filter parameter, and an API token. ```URL https://eodhd.com/api/eod/MCD.US?filter=last_close&api_token=demo&fmt=json ``` -------------------------------- ### Fetch Last Close Price (PHP) Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Fetches only the last closing price for a stock using PHP. This is useful for integration with spreadsheet functions like WEBSERVICE. Requires a stock ticker, a filter parameter, and an API token. ```PHP $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://eodhd.com/api/eod/MCD.US?filter=last_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(); } ``` -------------------------------- ### Intraday Historical Stock Price Data API Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Access intraday historical stock price data, providing granular price movements throughout the trading day. ```APIDOC Endpoint: /intraday-bulk-get-prices Description: Retrieves intraday historical stock prices for a given symbol and interval. Parameters: - api_token (string, required): Your EOD Historical Data API key. - symbol (string, required): The stock symbol (e.g., AAPL.US). - interval (string, optional): Data interval (e.g., '1m', '5m', '15m', '30m', '1h'). Defaults to '1h'. - date_from (string, optional): Start date in YYYY-MM-DD format. - date_to (string, optional): End date in YYYY-MM-DD format. - fmt (string, optional): Output format (json, csv). Defaults to json. Returns: JSON or CSV array of intraday data objects, each containing: - timestamp (integer): Unix timestamp of the data point. - open (float): Opening price for the interval. - high (float): Highest price for the interval. - low (float): Lowest price for the interval. - close (float): Closing price for the interval. - volume (integer): Trading volume for the interval. Example: GET https://eodhd.com/api/intraday-bulk-get-prices?api_token=YOUR_API_TOKEN&symbol=AAPL.US&interval=5m&date_from=2023-10-26&fmt=json ``` -------------------------------- ### Filter Fields WEBSERVICE and YAHOO Support Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Allows filtering of response fields to include data compatible with WEBSERVICE or YAHOO formats. This is useful for users who need to integrate data with systems expecting specific field names or structures. ```APIDOC APIDOC: Endpoint: /api/eod/{Code}.{fmt} Description: Retrieves End-of-Day historical data with support for filtering fields. Parameters: Code: The stock ticker symbol. fmt: The output format (json, csv). api_token: Your API access token. filter: Specifies the fields to include. Supported values include 'WEBSERVICE' and 'YAHOO'. Example: GET https://eodhistoricaldata.com/api/eod/GOOGL.US.json?api_token=YOUR_API_TOKEN&filter=YAHOO Response: Historical data with fields formatted according to the YAHOO specification. ``` -------------------------------- ### EOD Historical Stock Market Data API Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Access end-of-day historical stock market data, including prices, splits, and dividends. This API provides comprehensive historical data for analysis. ```APIDOC Endpoint: /eod-bulk-get-prices Description: Retrieves end-of-day historical stock prices for a given symbol. Parameters: - api_token (string, required): Your EOD Historical Data API key. - symbol (string, required): The stock symbol (e.g., AAPL.US). - date_from (string, optional): Start date in YYYY-MM-DD format. - date_to (string, optional): End date in YYYY-MM-DD format. - fmt (string, optional): Output format (json, csv). Defaults to json. Returns: JSON or CSV array of historical data objects, each containing: - date (string): Date of the data. - open (float): Opening price. - high (float): Highest price. - low (float): Lowest price. - close (float): Closing price. - adjusted_close (float): Adjusted closing price. - volume (integer): Trading volume. Example: GET https://eodhd.com/api/eod-bulk-get-prices?api_token=YOUR_API_TOKEN&symbol=AAPL.US&fmt=json ``` -------------------------------- ### Yahoo Finance Style API Request Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes This snippet demonstrates how to construct a request to the EOD Historical Data API using a format similar to the deprecated Yahoo Finance API. It includes parameters for symbol, date ranges (month, day, year), and data period (daily, weekly, monthly). Note the date format is American (MM, DD, YYYY) and months are 0-indexed. ```APIDOC Endpoint: https://eodhd.com/api/table.csv Parameters: - s: Symbol (e.g., MCD.US) - a, b, c: From date (month, day, year). Month is 0-indexed (0-11). - d, e, f: To date (month, day, year). Month is 0-indexed (0-11). - g: Period (d for daily, w for weekly, m for monthly) - api_token: Your API token - fmt: Output format (e.g., json) ``` -------------------------------- ### Financial News Feed API Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Access a feed of financial news and stock news sentiment data to stay updated on market movements. ```APIDOC Endpoint: /financial-news Description: Retrieves financial news articles for a given symbol or globally. Parameters: - api_token (string, required): Your EOD Historical Data API key. - s (string, optional): Stock symbol (e.g., AAPL.US). If not provided, global news are returned. - limit (integer, optional): Number of news articles to retrieve. Defaults to 10. - fmt (string, optional): Output format (json, csv). Defaults to json. Returns: JSON or CSV array of news objects, each containing: - title (string): Headline of the news article. - content (string): Full content of the news article. - date (string): Publication date and time. - link (string): URL to the original news article. - sentiment (object): Sentiment analysis results (if available). Example: GET https://eodhd.com/api/financial-news?api_token=YOUR_API_TOKEN&s=MSFT.US&limit=5&fmt=json ``` -------------------------------- ### EOD Historical Data API Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Retrieves End-of-Day historical stock market data for a given ticker. Supports various data formats and filtering options. Data for US stocks is available from inception, while non-US exchanges are covered from January 3, 2000. ```APIDOC APIDOC: Endpoint: /api/eod/{Code}.{fmt} Description: Retrieves End-of-Day historical data for a specific stock ticker. Parameters: Code: The stock ticker symbol (e.g., AAPL.US for Apple Inc.). fmt: The output format (e.g., json, csv). Defaults to json. api_token: Your API access token. date_from: Start date for historical data (YYYY-MM-DD). date_to: End date for historical data (YYYY-MM-DD). period: Data period (e.g., d, w, m). Defaults to d (daily). filter: Filter fields to include in the response (e.g., 'WEBSERVICE', 'YAHOO'). from_api: Specify the data source API (e.g., 'WEBSERVICE', 'YAHOO'). Example: GET https://eodhistoricaldata.com/api/eod/AAPL.US.json?api_token=YOUR_API_TOKEN&from=2020-01-01&to=2020-12-31 Response: Contains historical data including date, open, high, low, close, volume, and adjusted close prices. ``` -------------------------------- ### Fetch Last Close Price (cURL) Source: https://eodhd.com/documentation/financial-apis/api-for-historical-data-and-volumes Fetches only the last closing price for a stock using cURL. This is useful for integration with spreadsheet functions like WEBSERVICE. Requires a stock ticker, a filter parameter, and an API token. ```cURL curl --location "https://eodhd.com/api/eod/MCD.US?filter=last_close&api_token=demo&fmt=json" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.