Skip to content

Commit e850156

Browse files
committed
US Live Extended quotes fix
1 parent 5fe8681 commit e850156

3 files changed

Lines changed: 40 additions & 1 deletion

File tree

__main__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def main():
2+
print("EODHD Python library installed. Use APIClient in your code.")

eodhd/apiclient.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from eodhd.APIs import HistoricalSplitsAPI
2020
from eodhd.APIs import TechnicalIndicatorAPI
2121
from eodhd.APIs import LiveStockPricesAPI
22+
from eodhd.APIs import LiveExtendedQuotesAPI
2223
from eodhd.APIs import EconomicEventsDataAPI
2324
from eodhd.APIs import InsiderTransactionsAPI
2425
from eodhd.APIs import FundamentalDataAPI
@@ -541,7 +542,7 @@ def get_technical_indicator_data(
541542
maximum=maximum
542543
)
543544

544-
def get_live_stock_prices(self, ticker, date_to=None, date_from=None, s=None) -> list:
545+
def get_live_stock_prices(self, ticker, s=None) -> list:
545546
"""Available args:
546547
ticker (required) - consists of two parts: [SYMBOL_NAME].[EXCHANGE_ID]. Example: AAPL.US
547548
s (not required) - add “s=” parameter to your function and you will be able to get data for multiple
@@ -553,6 +554,40 @@ def get_live_stock_prices(self, ticker, date_to=None, date_from=None, s=None) ->
553554
api_call = LiveStockPricesAPI()
554555
return api_call.get_live_stock_prices(api_token=self._api_key, ticker=ticker, s=s)
555556

557+
def get_us_extended_quotes(
558+
self,
559+
s,
560+
page_limit = None,
561+
page_offset = None,
562+
fmt = None, # "json" or "csv"
563+
) ->list:
564+
"""Available args (Live v2 US Stocks — Extended/Delayed Quotes):
565+
566+
api_token (required) - your API access token (if not already configured in the client)
567+
568+
s (required) - one or more symbols in the format [SYMBOL].[EXCHANGE_ID], separated by commas.
569+
Example symbols: AAPL.US, TSLA.US
570+
Example request:
571+
https://eodhd.com/api/us-quote-delayed?s=AAPL.US,TSLA.US&api_token=YOUR_API_TOKEN&fmt=json
572+
573+
page[limit] (optional) - number of symbols per page (max 100; defaults apply if omitted)
574+
575+
page[offset] (optional) - pagination offset
576+
577+
Returns:
578+
- meta.count: number of returned symbols
579+
- data: an object keyed by symbol (e.g., data["AAPL.US"]) containing the extended quote snapshot
580+
(bid/ask with sizes + event times, last trade price/time, OHLC, volume, change, averages,
581+
52-week high/low, market cap, P/E, dividends, issuer fields, etc.)
582+
- links.next: URL for the next page of results (or null)
583+
584+
For more information visit:
585+
https://eodhd.com/financial-apis/live-v2-for-us-stocks-extended-quotes-2025
586+
"""
587+
api_call = LiveExtendedQuotesAPI()
588+
return api_call.get_us_extended_quotes(api_token=self._api_key, symbols=s, page_limit = page_limit, page_offset = page_offset,
589+
fmt = fmt)
590+
556591
def get_economic_events_data(
557592
self,
558593
date_from: str = None,

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,6 @@
3838
"numpy>=1.25.2",
3939
"matplotlib>=3.7.2",
4040
],
41+
entry_points={"console_scripts": ["eodhd=eodhd.__main__:main"]}
42+
4143
)

0 commit comments

Comments
 (0)