### Request Example URL Source: https://eodhd.com/financial-apis/interest-rates-api-sofr-fed-funds-ecb-boe-policy-rates Construct the URL to fetch policy rates, specifying the central bank and start date. Replace YOUR_TOKEN with your actual API token. ```url https://eodhd.com/api/rates/policy-rates?api_token=YOUR_TOKEN&filter[central_bank]=ECB&filter[from]=2025-01-01 ``` -------------------------------- ### Python Requests Example Source: https://eodhd.com/financial-apis/interest-rates-api-sofr-fed-funds-ecb-boe-policy-rates A Python script using the 'requests' library to retrieve policy rates. It makes a GET request and prints the JSON response. ```python import requests url = f'https://eodhd.com/api/rates/policy-rates?api_token=YOUR_TOKEN&filter[central_bank]=ECB&filter[from]=2025-01-01&fmt=json' data = requests.get(url).json() print(data) ``` -------------------------------- ### Install Node.js/TypeScript SDK Source: https://eodhd.com/financial-apis/node-js-typescript-sdk-for-eodhd-financial-apis Install the EODHD SDK using npm. For WebSocket streaming in Node.js, also install the 'ws' peer dependency. ```bash npm install eodhd ``` ```bash npm install ws ``` -------------------------------- ### cURL Request Example Source: https://eodhd.com/financial-apis/interest-rates-api-sofr-fed-funds-ecb-boe-policy-rates Use cURL to make a GET request for policy rates, including the API token and filter parameters. The 'fmt=json' parameter ensures the response is in JSON format. ```curl curl --location "https://eodhd.com/api/rates/policy-rates?api_token=YOUR_TOKEN&filter[central_bank]=ECB&filter[from]=2025-01-01&fmt=json" ``` -------------------------------- ### Install EODHD Claude Skills Plugin Source: https://eodhd.com/financial-apis/eodhd-claude-skills Installs the EODHD Claude Skills plugin using the Claude Code plugin system. This command should be run after registering the marketplace. ```bash # Install the plugin /plugin install eodhd-api@eodhd-claude-skills ``` -------------------------------- ### ID Mapping API Request Example Source: https://eodhd.com/financial-apis/id-mapping-api-cusip-isin-figi-lei-cik-%E2%86%94-symbol This example shows how to construct a URL to retrieve common identifiers for a given symbol. Ensure you replace 'YOUR_API_TOKEN' with your actual API token. ```URL https://eodhd.com/api/id-mapping?filter[symbol]=AAPL.US&page[limit]=100&page[offset]=0&api_token=YOUR_API_TOKEN&fmt=json ``` -------------------------------- ### Install EODHD Claude Skills Plugin Source: https://eodhd.com/financial-apis-blog/announcing-eodhd-claude-skills-teach-your-ai-the-entire-financial-api Use these commands to install the EODHD Claude Skills plugin from the marketplace. Ensure your API token is set before making requests. ```bash /plugin marketplace add EodHistoricalData/eodhd-claude-skills /plugin install eodhd-api@eodhd-claude-skills ``` -------------------------------- ### IPO Response Example Source: https://eodhd.com/financial-apis/calendar-upcoming-earnings-ipos-and-splits This is an example of the JSON response structure for IPO data, showing fields like code, name, dates, and pricing. ```json { "type": "IPOs", "description": "Historical and upcoming IPOs", "from": "2018-12-02", "to": "2018-12-06", "ipos": [ { "code": "603629.SHG", "name": "Jiangsu Lettall Electronic Co Ltd", "exchange": "Shanghai", "currency": "CNY", "start_date": "2018-12-11", "filing_date": "2017-06-15", "amended_date": "2018-12-03", "price_from": 0, "price_to": 0, "offer_price": 0, "shares": 25000000, "deal_type": "Expected" }, { "code": "SPK.MC", "name": "Solarpack Corporacion Tecnologica S.A", "exchange": "MCE", "currency": "EUR", "start_date": "2018-12-03", "filing_date": "2018-11-05", "amended_date": "2018-11-20", "price_from": 0, "price_to": 0, "offer_price": 0, "shares": 0, "deal_type": "Expected" }, ... ] ``` -------------------------------- ### Java Example for Stock Data API Source: https://eodhd.com/financial-apis-blog/category/code-examples A Java example demonstrating how to download stock data using the EOD Historical Data API. The provided code is part of the EODHistoricalDataDownloader.java file. ```java // Example Java code for EODHistoricalDataDownloader // This is a conceptual representation, actual implementation may vary. import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; public class EODHistoricalDataDownloader { private static final String API_KEY = "YOUR_API_KEY"; private static final String BASE_URL = "https://eodhistoricaldata.com/api/eod/"; public static void main(String[] args) { String symbol = "AAPL"; try { String data = downloadStockData(symbol); System.out.println(data); } catch (Exception e) { e.printStackTrace(); } } public static String downloadStockData(String symbol) throws Exception { String urlString = BASE_URL + symbol + ".US?api_token=" + API_KEY + "&fmt=json"; URL url = new URL(urlString); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("GET"); BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream())); StringBuilder response = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { response.append(line); } reader.close(); conn.disconnect(); return response.toString(); } } ``` -------------------------------- ### Register and Install EODHD Claude Skills Plugin Source: https://eodhd.com/financial-apis/eodhd-claude-skills-teach-your-ai-assistant-the-entire-financial-api Use these commands to register the EODHD Claude Skills marketplace and install the plugin via the Claude Code plugin system. ```bash # Register the marketplace /plugin marketplace add EodHistoricalData/eodhd-claude-skills # Install the plugin /plugin install eodhd-api@eodhd-claude-skills ``` -------------------------------- ### Request Example for Sanctioned Vessels by Flag Source: https://eodhd.com/financial-apis/sanctions-api-ofac-screening-data-entities-vessels Example URL to fetch sanctioned vessels flagged in a specific country. Ensure to replace YOUR_TOKEN with your API token. ```http https://eodhd.com/api/sanctions/vessels?api_token=YOUR_TOKEN&flag=Panama ``` -------------------------------- ### Example Response Snippet for Ticker List Source: https://eodhd.com/financial-apis/covered-tickers-eodhd This is an example of the JSON response format for the ticker list endpoint, showing details for individual stocks on a specific exchange. ```json { "Code": "CDR", "Name": "CD PROJEKT SA", "Country": "Poland", "Exchange": "WAR", "Currency": "PLN", "Type": "Common Stock", "Isin": "PLOPTTC00011" }, { "Code": "PKN", "Name": "PKN Orlen SA", "Country": "Poland", "Exchange": "WAR", "Currency": "PLN", "Type": "Common Stock", "Isin": "PLPKN0000018" } ``` -------------------------------- ### Install EODHD Python Library Source: https://eodhd.com/financial-apis/python-financial-libraries-and-code-samples Use this command to install or update the EODHD Python library. Ensure you are using Python 3. ```bash python3 -m pip install eodhd -U ``` -------------------------------- ### Get All Indices Starting with 'A' Source: https://eodhd.com/financial-apis-blog/types-feature-for-search-api Example of how to filter search results to retrieve all indices whose ticker starts with the letter 'A'. ```http https://eodhistoricaldata.com/api/search/A?api_token=YOUR_API_TOKEN&fmt=json&type=index ``` -------------------------------- ### Initialize API Client with API Key Source: https://eodhd.com/financial-apis/python-financial-libraries-and-code-samples Create an instance of the APIClient by passing your EODHD API key. Replace "" with your actual key. ```python api = APIClient("") ``` -------------------------------- ### Matlab EODML Connector: Get Historic Earning Reports Source: https://eodhd.com/financial-apis/matlab-api-connector-and-example This example shows how to fetch historical earning reports for a stock symbol using the EODML connector. You can specify a start date using 'fromdate'. The output is a struct array that can be converted to a table for easier viewing. ```matlab data = EODML('earnings', 'symbol','AAPL', 'fromdate','2019-01-01') ``` -------------------------------- ### Get Exchange Details (v2) - R Source: https://eodhd.com/financial-apis/exchanges-api-trading-hours-and-stock-market-holidays Retrieve trading hours and holiday data for a specific exchange using R. This example demonstrates making the GET request and printing the JSON content. ```R library(httr) library(jsonlite) url <- 'https://eodhd.com/api/v2/exchange-details/US?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") } ``` -------------------------------- ### Quick Start: Initialize Client and Fetch Data Source: https://eodhd.com/financial-apis/node-js-typescript-sdk-for-eodhd-financial-apis Initialize the EODHDClient with your API token and demonstrate fetching historical end-of-day prices, live quotes, and searching for stocks. ```typescript import { EODHDClient } from 'eodhd'; const client = new EODHDClient({ apiToken: 'YOUR_API_TOKEN' }); // Get historical end-of-day prices const prices = await client.eod('AAPL.US', { from: '2024-01-01', to: '2024-12-31' }); console.log(prices[0]); // { date: '2024-01-02', open: 187.15, high: 188.44, low: 183.89, close: 185.64, adjusted_close: 184.53, volume: 82488700 } // Get live (delayed) stock price const quote = await client.realTime('AAPL.US'); console.log(`${quote.code}: $${quote.close} (${quote.change_p}%)`); // Search for stocks const results = await client.search('Tesla', { limit: 5 }); ``` -------------------------------- ### Manual Setup for EODHD Claude Skills Source: https://eodhd.com/financial-apis/eodhd-claude-skills-teach-your-ai-assistant-the-entire-financial-api Clone the EODHD Claude Skills repository manually and set your API token. ```bash git clone https://github.com/EodHistoricalData/eodhd-claude-skills.git export EODHD_API_TOKEN="your_token_here" ``` -------------------------------- ### Get Dividends History (cURL) Source: https://eodhd.com/financial-apis/api-splits-dividends Use cURL to make a GET request to the Dividends History API. Replace 'demo' with your actual API token. The 'from' parameter specifies the start date for dividend data. ```bash curl --location "https://eodhd.com/api/div/AAPL.US?from=2000-01-01&api_token=demo&fmt=json" ``` -------------------------------- ### Get Last EMA Value Source: https://eodhd.com/financial-apis/technical-indicators-api Retrieve the last calculated Exponential Moving Average (EMA) for a given stock ticker. This example demonstrates how to use the `filter` and `fmt` query parameters to get a single numerical value. ```APIDOC ## GET /api/technical/{ticker} ### Description Retrieves technical indicator data for a specified ticker. Supports filtering to return only the last calculated value of an indicator. ### Method GET ### Endpoint https://eodhd.com/api/technical/{ticker} ### Query Parameters - **function** (string) - Required - The technical indicator function to calculate (e.g., `ema`). - **filter** (string) - Optional - Filters the output. Use `last_ema` to get only the last EMA value. - **api_token** (string) - Required - Your unique API token. - **fmt** (string) - Optional - The desired output format. Use `json` for JSON output. ### Request Example ``` https://eodhd.com/api/technical/AAPL?function=ema&filter=last_ema&api_token={YOUR_API_TOKEN}&fmt=json ``` ### Response #### Success Response (200) - **value** (number) - The last calculated value of the requested technical indicator. #### Response Example ```json { "AAPL": 170.50 } ``` ``` -------------------------------- ### Search with Limit (Apple Inc) Source: https://eodhd.com/financial-apis/search-api-for-stocks-etfs-mutual-funds This example demonstrates how to limit the number of search results returned by the API. Use the 'limit' parameter along with your query and API token. Remember to replace '{YOUR_API_TOKEN}' with your actual token. ```url https://eodhd.com/api/search**/**Apple Inc?limit=1&api_token={YOUR_API_TOKEN}&fmt=json ``` ```curl curl --location "https://eodhd.com/api/search**/**Apple Inc?limit=1&api_token={YOUR_API_TOKEN}&fmt=json" ``` ```php $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(); } ``` -------------------------------- ### Subscribe to Crypto via websocat (Mac Terminal) Source: https://eodhd.com/financial-apis/new-real-time-data-api-websockets Use the 'websocat' command-line tool to connect to the crypto WebSocket API and subscribe to BTC-USD. Ensure websocat is installed via Homebrew. ```bash printf '{"action":"subscribe","symbols":"BTC-USD"}\n' | websocat "wss://ws.eodhistoricaldata.com/ws/crypto?api_token=demo" ``` -------------------------------- ### Get US Treasury Long-Term Rates Source: https://eodhd.com/financial-apis/node-js-typescript-sdk-for-eodhd-financial-apis Fetch US Treasury long-term rates starting from a specified date. Requires the 'from' parameter. ```typescript const longTerm = await client.treasury.longTermRates({ from: '2025-01-01' }); ``` -------------------------------- ### Get US Treasury Yield Rates Source: https://eodhd.com/financial-apis/node-js-typescript-sdk-for-eodhd-financial-apis Fetch US Treasury yield rates starting from a specified date. Requires the 'from' parameter. ```typescript const yields = await client.treasury.yieldRates({ from: '2025-01-01' }); ``` -------------------------------- ### Request JSON Output Format Source: https://eodhd.com/financial-apis/bulk-api-eod-splits-dividends/. This example demonstrates how to explicitly request JSON output for bulk end-of-day data by adding the `fmt=json` parameter to the URL. ```bash https://eodhd.com/api/eod-bulk-last-day/US?api_token={YOUR_API_TOKEN}&symbols=MSFT,AAPL&fmt=json ``` -------------------------------- ### Initialize API Client using Configuration File Source: https://eodhd.com/financial-apis/python-financial-libraries-and-code-samples Initialize the APIClient by loading your EODHD API key from a configuration file (e.g., config.py). This method is useful for managing sensitive information. ```python # config.py API_KEY = "" # main.py import config as cfg api = APIClient(cfg.API_KEY) ``` -------------------------------- ### Get US Treasury Bill Rates Source: https://eodhd.com/financial-apis/node-js-typescript-sdk-for-eodhd-financial-apis Fetch US Treasury bill rates starting from a specified date. Requires the 'from' parameter. ```typescript const bills = await client.treasury.billRates({ from: '2025-01-01' }); ``` -------------------------------- ### Get Symbol Change History Source: https://eodhd.com/financial-apis/node-js-typescript-sdk-for-eodhd-financial-apis Retrieve the history of symbol changes for a given period. Specify a start date using the 'from' parameter. ```typescript const changes = await client.exchanges.symbolChangeHistory({ from: '2024-01-01' }); ``` -------------------------------- ### Connect to Forex Real-Time Data Stream Source: https://eodhd.com/financial-apis/new-real-time-data-api-websockets Establish a WebSocket connection to receive real-time bid/ask and day change data for forex currency pairs. Substitute YOUR_API_KEY with your API token. Use wss:// for production environments. ```bash wss://ws.eodhistoricaldata.com/ws/forex?api_token=YOUR_API_KEY ``` -------------------------------- ### Request Example: Sanctions Entities (Python) Source: https://eodhd.com/financial-apis/sanctions-api-ofac-screening-data-entities-vessels A Python script using the requests library to get sanctioned entities. The response is directly parsed as JSON. ```Python import requests url = f'https://eodhd.com/api/sanctions/entities?api_token=YOUR_TOKEN&program=RUSSIA-EO14024&type=entity&fmt=json' data = requests.get(url).json() print(data) ``` -------------------------------- ### Initialize API Client using Environment Variable Source: https://eodhd.com/financial-apis/python-financial-libraries-and-code-samples Initialize the APIClient by retrieving your EODHD API key from an environment variable. Ensure the environment variable "" is set. ```python import os api_key = os.environ.get("") api = APIClient(api_key) ``` -------------------------------- ### Fetch Reference Rates using cURL Source: https://eodhd.com/financial-apis/interest-rates-api-sofr-fed-funds-ecb-boe-policy-rates Command-line example using cURL to fetch reference rates data in JSON format. Ensure to replace YOUR_TOKEN with your valid API token. ```bash curl --location "https://eodhd.com/api/rates/reference-rates?api_token=YOUR_TOKEN&filter[code]=SOFR&filter[from]=2025-01-01&filter[to]=2025-06-01&fmt=json" ``` -------------------------------- ### Get US Treasury Real Yield Rates Source: https://eodhd.com/financial-apis/node-js-typescript-sdk-for-eodhd-financial-apis Fetch US Treasury real yield rates starting from a specified date. Requires the 'from' parameter. ```typescript const realYield = await client.treasury.realYieldRates({ from: '2025-01-01' }); ``` -------------------------------- ### Get ASX Corporate Actions in Python Source: https://eodhd.com/financial-apis-blog/new-api-asx-corporate-actions Use the EODHD Python SDK to retrieve ASX corporate actions. This example fetches dividend data for PMV.AU. ```python client.get_asx_corporate_actions(action_type="dividends", symbol="PMV.AU") ``` -------------------------------- ### Get Funding Stress Spreads Source: https://eodhd.com/financial-apis/interest-rates-api-sofr-fed-funds-ecb-boe-policy-rates Retrieve funding stress spreads by specifying codes, start date, and end date. Authentication is done via an api_token query parameter. ```APIDOC ## GET /spreads/funding-stress ### Description Retrieves funding stress spreads, which track dislocations in the US dollar money market. The spreads are derived from reference and policy rates and returned in basis points. ### Method GET ### Endpoint https://eodhd.com/api/spreads/funding-stress?api_token=YOUR_TOKEN ### Query Parameters - **api_token** (string) - Required - Your API token for authentication. - **filter[code]** (string) - Optional - Comma-separated list of funding stress spread codes (e.g., EFFR_SOFR,OBFR_EFFR). - **filter[from]** (string) - Optional - Start date in YYYY-MM-DD format. - **filter[to]** (string) - Optional - End date in YYYY-MM-DD format. ### Request Example ``` https://eodhd.com/api/spreads/funding-stress?api_token=YOUR_TOKEN&filter[code]=EFFR_SOFR,OBFR_EFFR&filter[from]=2026-05-01&filter[to]=2026-05-31 ``` ### Response #### Success Response (200) - **data** (array) - Array of funding stress spread observations. - **date** (string) - The date of the observation. - **code** (string) - The code for the spread. - **value_bps** (integer) - The spread value in basis points. - **formula** (string) - The formula used to calculate the spread. - **leg_a** (string) - The first leg of the spread calculation. - **leg_b** (string) - The second leg of the spread calculation. - **leg_a_rate** (float) - The rate for the first leg. - **leg_b_rate** (float) - The rate for the second leg. - **meta** (object) - Metadata about the response. - **total** (integer) - Total number of observations. - **links** (array) - An empty array as this endpoint does not paginate. #### Response Example ```json { "data": [ { "date": "2026-06-22", "code": "EFFR_SOFR", "value_bps": 2, "formula": "EFFR - SOFR", "leg_a": "EFFR", "leg_b": "SOFR", "leg_a_rate": 3.63, "leg_b_rate": 3.61 }, { "date": "2026-06-22", "code": "SOFR_TARGET_LOWER", "value_bps": 11, "formula": "SOFR - FED_TARGET_LOWER", "leg_a": "SOFR", "leg_b": "FED_TARGET_LOWER", "leg_a_rate": 3.61, "leg_b_rate": 3.5 } ], "meta": { "total": 6 }, "links": [] } ``` ``` -------------------------------- ### Get Historical Commodity Prices (WTI) Source: https://eodhd.com/financial-apis/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta Example of how to fetch historical monthly price data for a commodity like WTI. Ensure you replace 'demo' with your actual API token. ```URL https://eodhd.com/api/commodities/historical/WTI?api_token=demo&interval=monthly ``` -------------------------------- ### Get ASX Corporate Actions in Node.js / TypeScript Source: https://eodhd.com/financial-apis-blog/new-api-asx-corporate-actions Use the EODHD Node.js or TypeScript SDK to retrieve ASX corporate actions. This example fetches dividend data for PMV.AU. ```javascript client.asxCorporateActions({ type: "dividends", symbol: "PMV.AU" }) ``` -------------------------------- ### EODHD Python Client Examples Source: https://eodhd.com/financial-apis/eodhd-claude-skills-teach-your-ai-assistant-the-entire-financial-api Demonstrates various EODHD API endpoints using the built-in Python client. Ensure the client script is executable and necessary arguments are provided for each endpoint. ```bash # Historical prices python skills/eodhd-api/scripts/eodhd_client.py \ --endpoint eod --symbol AAPL.US \ --from-date 2025-01-01 --to-date 2025-03-31 ``` ```bash # Company fundamentals python skills/eodhd-api/scripts/eodhd_client.py \ --endpoint fundamentals --symbol NVDA.US ``` ```bash # Intraday 5-minute bars python skills/eodhd-api/scripts/eodhd_client.py \ --endpoint intraday --symbol TSLA.US \ --interval 5m --from-date 2025-01-15 ``` ```bash # Technical indicator (50-day SMA) python skills/eodhd-api/scripts/eodhd_client.py \ --endpoint technical --symbol AAPL.US --function sma --period 50 ``` ```bash # Stock screener python skills/eodhd-api/scripts/eodhd_client.py \ --endpoint screener --limit 20 ``` ```bash # Account status and API usage python skills/eodhd-api/scripts/eodhd_client.py --endpoint user ``` -------------------------------- ### Fetch Intraday Data (Python) Source: https://eodhd.com/financial-apis/quick-start-with-our-financial-data-apis A Python example using the requests library to retrieve intraday financial data. Always use your own API token instead of 'demo'. ```python import requests url = f'https://eodhd.com/api/intraday/AAPL.US?api_token=demo&fmt=json' data = requests.get(url).json() print(data) ``` -------------------------------- ### Get EOD Historical Data by Date Range Source: https://eodhd.com/financial-apis/api-for-historical-data-and-volumes Retrieve historical End-of-Day data for a given ticker between a specified start and end date. Supports daily period and JSON format. ```APIDOC ## GET /api/eod/{ticker} ### Description Retrieves historical End-of-Day (EOD) stock data for a specified ticker within a given date range. ### Method GET ### Endpoint https://eodhd.com/api/eod/{ticker} ### Parameters #### Query Parameters - **from** (string) - Required - The start date in 'YYYY-MM-DD' format. - **to** (string) - Required - The end date in 'YYYY-MM-DD' format. - **period** (string) - Optional - The data period (e.g., 'd' for daily). Defaults to daily. - **api_token** (string) - Required - Your API access token. - **fmt** (string) - Optional - The desired output format (e.g., 'json'). Defaults to json. ### Request Example ``` https://eodhd.com/api/eod/MCD.US?from=2020-01-05&to=2020-02-10&period=d&api_token=demo&fmt=json ``` ### Response #### Success Response (200) - The response will be a JSON object containing historical EOD data for the specified ticker and date range. ``` -------------------------------- ### EODHD Python Client Examples Source: https://eodhd.com/financial-apis/eodhd-claude-skills Demonstrates various EODHD API endpoints using the built-in Python client, including historical prices, company fundamentals, intraday data, technical indicators, stock screening, and account status. ```bash python skills/eodhd-api/scripts/eodhd_client.py \ --endpoint eod --symbol AAPL.US \ --from-date 2025-01-01 --to-date 2025-03-31 ``` ```bash python skills/eodhd-api/scripts/eodhd_client.py \ --endpoint fundamentals --symbol NVDA.US ``` ```bash python skills/eodhd-api/scripts/eodhd_client.py \ --endpoint intraday --symbol TSLA.US \ --interval 5m --from-date 2025-01-15 ``` ```bash python skills/eodhd-api/scripts/eodhd_client.py \ --endpoint technical --symbol AAPL.US --function sma --period 50 ``` ```bash python skills/eodhd-api/scripts/eodhd_client.py \ --endpoint screener --limit 20 ``` ```bash python skills/eodhd-api/scripts/eodhd_client.py --endpoint user ``` -------------------------------- ### Get EOD Historical Data (JSON) Source: https://eodhd.com/financial-apis/api-for-historical-data-and-volumes Use this URL to fetch end-of-day historical stock data in JSON format. Replace 'demo' with your API token. This example fetches data for MCD.US. ```url https://eodhd.com/api/eod/MCD.US?api_token=demo&fmt=json ``` -------------------------------- ### Get Dividends by Symbol (PHP) Source: https://eodhd.com/financial-apis/calendar-upcoming-earnings-ipos-and-splits Fetch dividend data for a given symbol using PHP. This example includes basic error handling for the JSON decoding process. Replace {YOUR_API_TOKEN} with your API token. ```PHP $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://eodhd.com/api/calendar/dividends?filter[symbol]=AAPL.US&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(); } ``` -------------------------------- ### Configuration Source: https://eodhd.com/financial-apis/node-js-typescript-sdk-for-eodhd-financial-apis Initialize the EODHDClient with your API token and optional settings like timeout and max retries. ```APIDOC ## Configuration ```typescript const client = new EODHDClient({ apiToken: 'YOUR_API_TOKEN', timeout: 60000, // 60 seconds maxRetries: 3, // retry up to 3 times on transient errors }); ``` ``` -------------------------------- ### Get Dividends History (Python) Source: https://eodhd.com/financial-apis/api-splits-dividends A Python script using the 'requests' library to retrieve dividend history. The API endpoint includes the ticker, start date, and your API token. The response is parsed as JSON. ```python import requests url = f'https://eodhd.com/api/div/AAPL.US?from=2000-01-01&api_token=demo&fmt=json' data = requests.get(url).json() print(data) ``` -------------------------------- ### Get Historical S&P Global Index Components Source: https://eodhd.com/financial-apis/node-js-typescript-sdk-for-eodhd-financial-apis Retrieves historical constituent components for an S&P Global index within a specified date range. Requires index symbol, start date, and end date. ```typescript // Historical components const historical = await client.marketplace.unicornbay.spglobal.components('GSPC.INDX', { historical: true, from: '2024-01-01', to: '2024-12-31', }); ``` -------------------------------- ### Get Fundamentals with Pagination Source: https://eodhd.com/financial-apis/bulk-fundamentals-api-via-extended-fundamentals-plan This endpoint allows paginating through the fundamental data for an exchange. You can specify the number of symbols to return using the `limit` parameter and the starting point using the `offset` parameter. This is useful for handling large datasets. ```APIDOC ## GET /bulk-fundamentals/{exchange} (with Pagination) ### Description Retrieves a paginated subset of fundamental data for symbols on a specified exchange. Use `limit` to set the number of results and `offset` to define the starting position. ### Method GET ### Endpoint `/bulk-fundamentals/{exchange}` ### Parameters #### Query Parameters - **api_token** (string) - Required - Your API token for authentication. - **fmt** (string) - Optional - Specifies the output format. Use `json` for JSON output. - **offset** (integer) - Optional - The starting symbol position for the request. - **limit** (integer) - Optional - The number of symbols to return in the response. ### Request Example ```http GET https://eodhd.com/api/bulk-fundamentals/NASDAQ?offset=1000&limit=200&api_token={YOUR_API_TOKEN}&fmt=json ``` ``` -------------------------------- ### Fetch IPOs using cURL Source: https://eodhd.com/financial-apis/calendar-upcoming-earnings-ipos-and-splits Use this cURL command to fetch IPO data. Replace {YOUR_API_TOKEN} with your actual API token. ```bash curl --location "https://eodhd.com/api/calendar/ipos?symbols=AAPL.US,MSFT.US,AI.PA&api_token={YOUR_API_TOKEN}&fmt=json" ``` -------------------------------- ### Search API Python Example Source: https://eodhd.com/financial-apis/search-api-for-stocks-etfs-mutual-funds This Python script shows how to use the 'requests' library to call the Search API and print the JSON response. ```Python 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) ``` -------------------------------- ### Get Historical Splits for AAPL.US (JSON) Source: https://eodhd.com/financial-apis/api-splits-dividends This is the base URL for fetching historical splits data for a specific ticker. Replace 'AAPL.US' with your desired ticker and 'demo' with your API token. The 'from' parameter specifies the start date. ```URL https://eodhd.com/api/splits/AAPL.US?from=2000-01-01&api_token=demo&fmt=json ``` -------------------------------- ### Get US Treasury Yield Rates using Python Requests Source: https://eodhd.com/financial-apis/us-treasury-ust-interest-rates-api-beta This Python script utilizes the 'requests' library to fetch Treasury Par Yield Curve Rates. Replace YOUR_TOKEN with your API token and ensure the 'requests' library is installed. ```python import requests url = f'https://eodhd.com/api/ust/yield-rates?api_token=YOUR_TOKEN&filter[year]=2023&fmt=json' data = requests.get(url).json() print(data) ``` -------------------------------- ### Search API Endpoint Example Source: https://eodhd.com/financial-apis/search-api-for-stocks-etfs-mutual-funds This is the base URL for the Search API. Replace {query_string} with your search term and {YOUR_API_TOKEN} with your actual API token. ```URL https://eodhd.com/api/search/{query_string}?api_token={YOUR_API_TOKEN}&fmt=json ``` -------------------------------- ### Get Bulk Fundamentals with Pagination (cURL) Source: https://eodhd.com/financial-apis/bulk-fundamentals-api-via-extended-fundamentals-plan Use this cURL command to fetch a paginated subset of bulk fundamental data for an exchange, specifying the offset and limit. Replace {YOUR_API_TOKEN} with your actual API token. ```bash curl --location "https://eodhd.com/api/bulk-fundamentals/NASDAQ?offset=1000&limit=200&api_token={YOUR_API_TOKEN}&fmt=json" ```