Skip to content

stock list_aggs throw errors #888

Closed
Closed
@investment-radar

Description

@investment-radar

I am using version: 1.14.6

When calling client.list_aggs, now it's throw error:
polygon.exceptions.BadResponse: {"status":"ERROR","request_id":"708a85cecad66756c956da798714ac63","error":"The parameter 'to' cannot be a time that occurs before 'from'"}

I didn't change my calling code.
Even I used the example code:
aggs = []
for a in client.list_aggs(
"AAPL",
1,
"day",
"2023-01-09",
"2023-02-10",
adjusted="true",
sort="desc",
limit=2,
):
aggs.append(a)

I still get same error:
Request URL: https://api.polygon.io/v2/aggs/ticker/AAPL/range/1/day/2023-01-09/2023-02-10?adjusted=true&sort=desc&limit=2
Request Headers: {'Authorization': 'Bearer REDACTED', 'Accept-Encoding': 'gzip', 'User-Agent': 'Polygon.io PythonClient/1.14.6'}
Response Headers: {'Date': 'Mon, 16 Jun 2025 12:26:53 GMT', 'Content-Type': 'application/json', 'Content-Length': '348', 'Connection': 'keep-alive', 'Content-Encoding': 'gzip', 'Vary': 'Accept-Encoding', 'X-Polygon-Cluster-Name': 'polygon-ny5', 'X-Request-Id': '294c7b52f57a6ee48a895473ab336ca2', 'Strict-Transport-Security': 'max-age=15724800; includeSubDomains'}

polygon.exceptions.BadResponse: {"status":"ERROR","request_id":"708a85cecad66756c956da798714ac63","error":"The parameter 'to' cannot be a time that occurs before 'from'"}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions