From 7f72e70e1fdb14cb32bfa6faa0008108fbf52081 Mon Sep 17 00:00:00 2001 From: donghwan Date: Fri, 12 Apr 2024 09:18:34 +0900 Subject: [PATCH 1/2] add symbol change history api --- eod/exchanges/exchanges_stocks_financials.py | 6 ++-- .../symbol_change_history_api/__init__.py | 8 +++++ .../symbol_change_history.py | 31 +++++++++++++++++++ 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 eod/exchanges/symbol_change_history_api/__init__.py create mode 100644 eod/exchanges/symbol_change_history_api/symbol_change_history.py diff --git a/eod/exchanges/exchanges_stocks_financials.py b/eod/exchanges/exchanges_stocks_financials.py index 68d889b..038918b 100644 --- a/eod/exchanges/exchanges_stocks_financials.py +++ b/eod/exchanges/exchanges_stocks_financials.py @@ -10,12 +10,14 @@ from eod.exchanges.trading_hours_market_holidays_api import MarketHoursHolidays from eod.exchanges.search_instrument_api import SearchInstrument from eod.exchanges.stock_market_screener_api import StockMarketScreener +from eod.exchanges.symbol_change_history_api import SymbolChangeHistory class ExchangesAndMarkets(BulkMarketRequest, ExchangesAndTickers, MarketHoursHolidays, - SearchInstrument, StockMarketScreener): + SearchInstrument, StockMarketScreener, SymbolChangeHistory): def __init__(self, api_key:str, timeout:int): BulkMarketRequest.__init__(self, api_key, timeout) ExchangesAndTickers.__init__(self, api_key, timeout) MarketHoursHolidays.__init__(self, api_key, timeout) SearchInstrument.__init__(self, api_key, timeout) - StockMarketScreener.__init__(self, api_key, timeout) \ No newline at end of file + StockMarketScreener.__init__(self, api_key, timeout) + SymbolChangeHistory.__init__(self, api_key, timeout) \ No newline at end of file diff --git a/eod/exchanges/symbol_change_history_api/__init__.py b/eod/exchanges/symbol_change_history_api/__init__.py new file mode 100644 index 0000000..aa89e51 --- /dev/null +++ b/eod/exchanges/symbol_change_history_api/__init__.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +""" +Created on Fri Apr 12 08:52:56 2023 + +@author: donghwan0206 +""" + +from .symbol_change_history import SymbolChangeHistory diff --git a/eod/exchanges/symbol_change_history_api/symbol_change_history.py b/eod/exchanges/symbol_change_history_api/symbol_change_history.py new file mode 100644 index 0000000..cb9dabb --- /dev/null +++ b/eod/exchanges/symbol_change_history_api/symbol_change_history.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +""" +Created on Fri Apr 12 08:52:56 2023 + +@author: donghwan0206 +""" + +from eod.request_handler_class import RequestHandler + +class SymbolChangeHistory(RequestHandler): + def __init__(self, api_key:str, timeout:int): + self.URL_SYMBOL_CHANGE_HISTORY = 'https://eodhistoricaldata.com/api/symbol-change-history/' + super().__init__(api_key, timeout) + + def get_symbol_change_history(self, **query_params): + """ + Get symbol change history you should use the following URL (only US exchanges are supported nowe. + + Parameters + ---------- + **query_params : + query_params. + + Returns + ------- + list + List of symbol change history data + + """ + self.endpoint = self.URL_SYMBOL_CHANGE_HISTORY + return super().handle_request(self.endpoint, query_params) From c3ab4d30178144a152747ba88c02d1e0a9e8fc69 Mon Sep 17 00:00:00 2001 From: donghwan Date: Fri, 12 Apr 2024 10:00:22 +0900 Subject: [PATCH 2/2] update docs for symbol change history api --- README.md | 12 ++++++++++++ sandbox.py | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c5592da..582c2d6 100644 --- a/README.md +++ b/README.md @@ -295,6 +295,18 @@ resp = client.get_search_instrument(query_string='crypto') resp = client.get_search_instrument(query_string='Chile', bonds_only=1) ``` +- **Symbol Change History**: 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. + - Parameters: + - ```from_```(str) and ```to```(str): Optional – 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'```. + - Usage: +```python +# Get symbol change history +resp = client.get_symbol_change_history() +# Get symbol change history from 2022-07-22 +resp = client.get_symbol_change_history(from_='2022-07-22') +``` + + ### Alternative Financial Data [:arrow_up:](#eod-historical-data-sdk) - **Sentiment Financial Data**: Retrieve sentimental data calculated from the EOD historical data API. The aggregated sentiment data from the EOD historical API is collected from the news (and in the nearest future from tweets) for stocks, ETFs, Forex, and cryptocurrencies data. The data is aggregated by day. - Paramaters: diff --git a/sandbox.py b/sandbox.py index d8caad9..e0bace6 100644 --- a/sandbox.py +++ b/sandbox.py @@ -103,7 +103,8 @@ # Stock Market Screener API resp = client.get_screener_signals() resp = client.get_instrument_screener(signals='wallstreet_hi') - +# Symbol Change History API +resp = client.get_symbol_change_history() # Questions and changes