Skip to content

Commit 790c0f8

Browse files
authored
Merge pull request #39 from yuanweixin/main
allow "delisted" query parameter in get_exchange_symbols
2 parents 36575ca + a8258b7 commit 790c0f8

1 file changed

Lines changed: 23 additions & 20 deletions

File tree

eodhd/apiclient.py

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,16 @@ def get_exchanges(self) -> pd.DataFrame:
156156

157157
return self._rest_get("exchanges-list")
158158

159-
def get_exchange_symbols(self, uri: str = "") -> pd.DataFrame:
159+
def get_exchange_symbols(self, uri: str = "", delisted=False) -> pd.DataFrame:
160160
"""Get supported exchange symbols"""
161161

162162
try:
163163
if uri.strip() == "":
164164
raise ValueError("endpoint uri is empty!")
165165

166+
if delisted:
167+
return self._rest_get("exchange-symbol-list", uri, "&delisted=1")
168+
166169
return self._rest_get("exchange-symbol-list", uri)
167170
except ValueError as err:
168171
self.console.log(err)
@@ -780,7 +783,7 @@ def get_options_data(
780783
trade_date_from=trade_date_from,
781784
contract_name=contract_name,
782785
)
783-
786+
784787
def get_intraday_historical_data(
785788
self,
786789
symbol,
@@ -792,16 +795,16 @@ def get_intraday_historical_data(
792795
IMPORTANT: data for all exchanges is provided in the UTC timezone, with Unix timestamps.
793796
794797
Available args:
795-
symbol(string): Required - consists of two parts: {SYMBOL_NAME}.{EXCHANGE_ID},
798+
symbol(string): Required - consists of two parts: {SYMBOL_NAME}.{EXCHANGE_ID},
796799
then you can use, for example, AAPL.MX for Mexican Stock Exchange. or AAPL.US for NASDAQ
797800
interval(string) Optional - the possible intervals: ‘5m’ for 5-minutes, ‘1h’ for 1 hour, and ‘1m’ for 1-minute intervals.
798-
from_unix_time(string) and to_unix_time(string): Optional - Parameters should be passed in UNIX time with UTC timezone, for example,
799-
these values are correct: “from=1627896900&to=1630575300” and correspond to
800-
‘ 2021-08-02 09:35:00 ‘ and ‘ 2021-09-02 09:35:00 ‘.
801-
The maximum periods between ‘from’ and ‘to’ are 120 days for 1-minute intervals,
802-
600 days for 5-minute intervals and
803-
7200 days for 1-hour intervals
804-
(please note, especially with the 1-hour interval, this is the maximum theoretically possible length).
801+
from_unix_time(string) and to_unix_time(string): Optional - Parameters should be passed in UNIX time with UTC timezone, for example,
802+
these values are correct: “from=1627896900&to=1630575300” and correspond to
803+
‘ 2021-08-02 09:35:00 ‘ and ‘ 2021-09-02 09:35:00 ‘.
804+
The maximum periods between ‘from’ and ‘to’ are 120 days for 1-minute intervals,
805+
600 days for 5-minute intervals and
806+
7200 days for 1-hour intervals
807+
(please note, especially with the 1-hour interval, this is the maximum theoretically possible length).
805808
Without ‘from’ and ‘to’ specified, the length of the data obtained is the last 120 days.
806809
807810
List of supported exchanges: https://eodhd.com/financial-apis/exchanges-api-list-of-tickers-and-trading-hours/
@@ -815,7 +818,7 @@ def get_intraday_historical_data(
815818
to_unix_time=to_unix_time,
816819
from_unix_time=from_unix_time
817820
)
818-
821+
819822
def get_eod_historical_stock_market_data(
820823
self,
821824
symbol,
@@ -826,12 +829,12 @@ def get_eod_historical_stock_market_data(
826829
):
827830
"""
828831
Available args:
829-
symbol(string): Required - consists of two parts: {SYMBOL_NAME}.{EXCHANGE_ID},
832+
symbol(string): Required - consists of two parts: {SYMBOL_NAME}.{EXCHANGE_ID},
830833
then you can use, for example, AAPL.MX for Mexican Stock Exchange. or AAPL.US for NASDAQ
831834
period(string) Optional - use 'd' for daily, 'w' for weekly, 'm' for monthly prices. By default, daily prices will be shown.
832-
from_date and to_date - the format is 'YYYY-MM-DD'.
835+
from_date and to_date - the format is 'YYYY-MM-DD'.
833836
If you need data from Jan 5, 2017, to Feb 10, 2017, you should use from=2017-01-05 and to=2017-02-10.
834-
order(string) Optional - use ‘a’ for ascending dates (from old to new), ‘d’ for descending dates (from new to old).
837+
order(string) Optional - use ‘a’ for ascending dates (from old to new), ‘d’ for descending dates (from new to old).
835838
By default, dates are shown in ascending order.
836839
837840
List of supported exchanges: https://eodhd.com/financial-apis/exchanges-api-list-of-tickers-and-trading-hours/
@@ -846,7 +849,7 @@ def get_eod_historical_stock_market_data(
846849
from_date=from_date,
847850
order=order
848851
)
849-
852+
850853
def get_stock_market_tick_data(
851854
self,
852855
symbol,
@@ -856,12 +859,12 @@ def get_stock_market_tick_data(
856859
):
857860
"""
858861
Available args:
859-
symbol - , for example, AAPL.US, consists of two parts: {SYMBOL_NAME}.{EXCHANGE_ID}.
860-
This API works only for US exchanges for the moment,
862+
symbol - , for example, AAPL.US, consists of two parts: {SYMBOL_NAME}.{EXCHANGE_ID}.
863+
This API works only for US exchanges for the moment,
861864
then you can use 'AAPL' or 'AAPL.US' to get the data as well for other US tickers.
862-
from_timestamp and to_timestamp - use these parameters to filter data by datetime.
863-
Parameters should be passed in UNIX time with UTC timezone,
864-
for example, these values are correct: “from=1627896900&to=1630575300” and
865+
from_timestamp and to_timestamp - use these parameters to filter data by datetime.
866+
Parameters should be passed in UNIX time with UTC timezone,
867+
for example, these values are correct: “from=1627896900&to=1630575300” and
865868
correspond to ' 2021-08-02 09:35:00 ' and ' 2021-09-02 09:35:00 '.
866869
limit - the maximum number of ticks will be provided.
867870
"""

0 commit comments

Comments
 (0)