polygon-io / client-python

The official Python client library for the Polygon REST and WebSocket API.
https://polygon-api-client.readthedocs.io/
MIT License
744 stars 204 forks source link

Max retries exceeded with url #679

Closed greengooru closed 2 weeks ago

greengooru commented 3 weeks ago

I am receiving this message Max retries exceeded with url for all my calls with this code:

    for a in client.list_aggs(ticker='MSFT', multiplier=1, timespan="hour", from_="2023-07-29", to="2024-06-01"):
        aggs.append(a)
    print(aggs)

I try to download a year of this Historical Data, however I receive the above message for all calls.

I am aware that there is a API Call Limit of 5 per minute, but I am using a Starter package which is supposed to have Unlimited API calls. Probably this is not a bug in the System. But how can I get this solved?

Additional information: If I reduce the time span to a few days, it all works normally. If this is the normal usage, then the question is what is the max range of data that can be requested for any given call?

These lines work normally (15 days of data):

    for a in client.list_aggs(ticker='MSFT', multiplier=1, timespan="hour", from_="2023-05-15", to="2024-06-01"):
        aggs.append(a)
    print(aggs)

Thank you.

justinpolygon commented 3 weeks ago

Thanks for reporting @greengooru. I'll explore this. Do you mind turning on tracing in the client and then posting the results here of the headers? This will let me find your request and see what was going on.

https://github.com/polygon-io/client-python#how-to-enable-debug-mode

client = RESTClient(trace=True)
justinpolygon commented 2 weeks ago

Hello, I'm going to close this as unreproducible. But, if you're able to get this to fail again please let me know and we'll debug it.