Skip to content

Commit 70c4ddd

Browse files
author
clickingbuttons
authored
add market type for grouped endpoint (#208)
* add market type for grouped endpoint * move to end * add note
1 parent 5820020 commit 70c4ddd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

polygon/rest/aggs.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,15 @@ def get_aggs(
5050
raw=raw,
5151
)
5252

53+
# TODO: next breaking change release move "market_type" to be 2nd mandatory
54+
# param
5355
def get_grouped_daily_aggs(
5456
self,
5557
date: str,
5658
adjusted: Optional[bool] = None,
5759
params: Optional[Dict[str, Any]] = None,
5860
raw: bool = False,
61+
market_type: str = "stocks",
5962
) -> Union[GroupedDailyAgg, HTTPResponse]:
6063
"""
6164
Get the daily open, high, low, and close (OHLC) for the entire market.
@@ -66,7 +69,7 @@ def get_grouped_daily_aggs(
6669
:param raw: Return raw object instead of results object
6770
:return: List of grouped daily aggregates
6871
"""
69-
url = f"/v2/aggs/grouped/locale/us/market/stocks/{date}"
72+
url = f"/v2/aggs/grouped/locale/us/market/{market_type}/{date}"
7073

7174
return self._get(
7275
path=url,

0 commit comments

Comments
 (0)