You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: polygon/rest/aggs.py
+10-4Lines changed: 10 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@
2
2
fromtypingimportOptional, Any, Dict, List, Union
3
3
from .modelsimportAgg, Sort
4
4
fromurllib3importHTTPResponse
5
+
fromdatetimeimportdatetime
5
6
6
7
# https://polygon.io/docs/stocks
7
8
classAggsClient(BaseClient):
@@ -11,8 +12,8 @@ def get_aggs(
11
12
multiplier: int,
12
13
timespan: str,
13
14
# "from" is a keyword in python https://www.w3schools.com/python/python_ref_keywords.asp
14
-
from_: str,
15
-
to: str,
15
+
from_: Union[str, int, datetime],
16
+
to: Union[str, int, datetime],
16
17
adjusted: Optional[bool] =None,
17
18
sort: Optional[Union[str, Sort]] =None,
18
19
limit: Optional[int] =None,
@@ -25,8 +26,8 @@ def get_aggs(
25
26
:param ticker: The ticker symbol.
26
27
:param multiplier: The size of the timespan multiplier.
27
28
:param timespan: The size of the time window.
28
-
:param _from: The start of the aggregate time window.
29
-
:param to: The end of the aggregate time window.
29
+
:param _from: The start of the aggregate time window as YYYY-MM-DD, Unix MS Timestamps, or a datetime.
30
+
:param to: The end of the aggregate time window as YYYY-MM-DD, Unix MS Timestamps, or a datetime.
30
31
:param adjusted: Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits.
31
32
:param sort: Sort the results by timestamp. asc will return results in ascending order (oldest at the top), desc will return results in descending order (newest at the top).The end of the aggregate time window.
32
33
:param limit: Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on Aggregate Data API Improvements.
Copy file name to clipboardExpand all lines: polygon/rest/reference.py
-4Lines changed: 0 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,6 @@ def list_tickers(
74
74
) ->Union[Iterator[Ticker], HTTPResponse]:
75
75
"""
76
76
Query all ticker symbols which are supported by Polygon.io. This API currently includes Stocks/Equities, Crypto, and Forex.
77
-
78
77
:param ticker: Specify a ticker symbol. Defaults to empty string which queries all tickers.
79
78
:param ticker_lt: Ticker less than
80
79
:param ticker_lte: Ticker less than or equal to
@@ -113,7 +112,6 @@ def get_ticker_details(
113
112
) ->Union[TickerDetails, HTTPResponse]:
114
113
"""
115
114
Get a single ticker supported by Polygon.io. This response will have detailed information about the ticker and the company behind it.
116
-
117
115
:param ticker: The ticker symbol of the asset.
118
116
:param date: Specify a point in time to get information about the ticker available on that date. When retrieving information from SEC filings, we compare this date with the period of report date on the SEC filing.
119
117
:param params: Any additional query params
@@ -143,7 +141,6 @@ def get_ticker_news(
143
141
) ->Union[TickerDetails, HTTPResponse]:
144
142
"""
145
143
Get the most recent news articles relating to a stock ticker symbol, including a summary of the article and a link to the original source.
146
-
147
144
:param ticker: Return results that contain this ticker.
148
145
:param published_utc: Return results published on, before, or after this date.
149
146
:param limit: Limit the number of results returned, default is 10 and max is 1000.
0 commit comments