Skip to content

Commit 1f724a5

Browse files
authored
Merge branch 'main' into dev
2 parents 2fb42c4 + c36c76d commit 1f724a5

2 files changed

Lines changed: 23 additions & 20 deletions

File tree

eodhd/apiclient.py

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,16 @@ def get_exchanges(self) -> pd.DataFrame:
157157

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

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

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

167+
if delisted:
168+
return self._rest_get("exchange-symbol-list", uri, "&delisted=1")
169+
167170
return self._rest_get("exchange-symbol-list", uri)
168171
except ValueError as err:
169172
self.console.log(err)
@@ -820,7 +823,7 @@ def get_options_data(
820823
trade_date_from=trade_date_from,
821824
contract_name=contract_name,
822825
)
823-
826+
824827
def get_intraday_historical_data(
825828
self,
826829
symbol,
@@ -832,16 +835,16 @@ def get_intraday_historical_data(
832835
IMPORTANT: data for all exchanges is provided in the UTC timezone, with Unix timestamps.
833836
834837
Available args:
835-
symbol(string): Required - consists of two parts: {SYMBOL_NAME}.{EXCHANGE_ID},
838+
symbol(string): Required - consists of two parts: {SYMBOL_NAME}.{EXCHANGE_ID},
836839
then you can use, for example, AAPL.MX for Mexican Stock Exchange. or AAPL.US for NASDAQ
837840
interval(string) Optional - the possible intervals: ‘5m’ for 5-minutes, ‘1h’ for 1 hour, and ‘1m’ for 1-minute intervals.
838-
from_unix_time(string) and to_unix_time(string): Optional - Parameters should be passed in UNIX time with UTC timezone, for example,
839-
these values are correct: “from=1627896900&to=1630575300” and correspond to
840-
‘ 2021-08-02 09:35:00 ‘ and ‘ 2021-09-02 09:35:00 ‘.
841-
The maximum periods between ‘from’ and ‘to’ are 120 days for 1-minute intervals,
842-
600 days for 5-minute intervals and
843-
7200 days for 1-hour intervals
844-
(please note, especially with the 1-hour interval, this is the maximum theoretically possible length).
841+
from_unix_time(string) and to_unix_time(string): Optional - Parameters should be passed in UNIX time with UTC timezone, for example,
842+
these values are correct: “from=1627896900&to=1630575300” and correspond to
843+
‘ 2021-08-02 09:35:00 ‘ and ‘ 2021-09-02 09:35:00 ‘.
844+
The maximum periods between ‘from’ and ‘to’ are 120 days for 1-minute intervals,
845+
600 days for 5-minute intervals and
846+
7200 days for 1-hour intervals
847+
(please note, especially with the 1-hour interval, this is the maximum theoretically possible length).
845848
Without ‘from’ and ‘to’ specified, the length of the data obtained is the last 120 days.
846849
847850
List of supported exchanges: https://eodhd.com/financial-apis/exchanges-api-list-of-tickers-and-trading-hours/
@@ -855,7 +858,7 @@ def get_intraday_historical_data(
855858
to_unix_time=to_unix_time,
856859
from_unix_time=from_unix_time
857860
)
858-
861+
859862
def get_eod_historical_stock_market_data(
860863
self,
861864
symbol,
@@ -866,12 +869,12 @@ def get_eod_historical_stock_market_data(
866869
):
867870
"""
868871
Available args:
869-
symbol(string): Required - consists of two parts: {SYMBOL_NAME}.{EXCHANGE_ID},
872+
symbol(string): Required - consists of two parts: {SYMBOL_NAME}.{EXCHANGE_ID},
870873
then you can use, for example, AAPL.MX for Mexican Stock Exchange. or AAPL.US for NASDAQ
871874
period(string) Optional - use 'd' for daily, 'w' for weekly, 'm' for monthly prices. By default, daily prices will be shown.
872-
from_date and to_date - the format is 'YYYY-MM-DD'.
875+
from_date and to_date - the format is 'YYYY-MM-DD'.
873876
If you need data from Jan 5, 2017, to Feb 10, 2017, you should use from=2017-01-05 and to=2017-02-10.
874-
order(string) Optional - use ‘a’ for ascending dates (from old to new), ‘d’ for descending dates (from new to old).
877+
order(string) Optional - use ‘a’ for ascending dates (from old to new), ‘d’ for descending dates (from new to old).
875878
By default, dates are shown in ascending order.
876879
877880
List of supported exchanges: https://eodhd.com/financial-apis/exchanges-api-list-of-tickers-and-trading-hours/
@@ -886,7 +889,7 @@ def get_eod_historical_stock_market_data(
886889
from_date=from_date,
887890
order=order
888891
)
889-
892+
890893
def get_stock_market_tick_data(
891894
self,
892895
symbol,
@@ -899,9 +902,9 @@ def get_stock_market_tick_data(
899902
symbol - for example, AAPL.US, consists of two parts: {SYMBOL_NAME}.{EXCHANGE_ID}.
900903
This API works only for US exchanges for the moment,
901904
then you can use 'AAPL' or 'AAPL.US' to get the data as well for other US tickers.
902-
from_timestamp and to_timestamp - use these parameters to filter data by datetime.
903-
Parameters should be passed in UNIX time with UTC timezone,
904-
for example, these values are correct: “from=1627896900&to=1630575300” and
905+
from_timestamp and to_timestamp - use these parameters to filter data by datetime.
906+
Parameters should be passed in UNIX time with UTC timezone,
907+
for example, these values are correct: “from=1627896900&to=1630575300” and
905908
correspond to ' 2021-08-02 09:35:00 ' and ' 2021-09-02 09:35:00 '.
906909
limit - the maximum number of ticks will be provided.
907910
"""

example_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def main() -> None:
1919
# print(resp.dtypes)
2020
# print(resp.describe())
2121

22-
resp = api.get_historical_data("BTC-USD.CC", "1h")
22+
resp = api.get_intraday_historical_data('BTC-USD.CC','1m')
2323
# resp = api.get_historical_data("BTC-USD.CC", "1m", "2021-11-27 23:56:00")
2424
# resp = api.get_historical_data("BTC-USD.CC", "1m", "2021-11-27 23:56:00", "2021-11-27 23:59:00")
2525
print(resp)
@@ -75,7 +75,7 @@ def main() -> None:
7575
# resp = api.get_economic_events_data(date_from = '2020-01-05', date_to = '2020-02-10', country = 'AU', comparison = 'yoy', offset = 50, limit = 50)
7676
print(resp)
7777

78-
resp = api.financial_news(s = 'balance sheet', t = None, from_date = '2020-01-05', to_date = '2020-02-10', limit = 100, offset = 200)
78+
resp = api.financial_news(s = 'AAPL.US', t = None, from_date = '2020-01-05', to_date = '2020-02-10', limit = 100, offset = 200)
7979
# resp = api.financial_news(s = None, t = 'balance sheet', from_date = '2020-01-05', to_date = '2020-02-10', limit = 100, offset = 200)
8080
print(resp)
8181

0 commit comments

Comments
 (0)