Alpaca-py issues - Max retries exceeded / NewConnectionError

I just upgraded to alpaca-py and am trying to get historical crypto data using my broker api keys.

I can get one or two tickers but after that it just throws the max retry exception:

HTTPSConnectionPool(host=‘’, port=443): Max retries exceeded with url: /v1beta2/crypto/bars?start=2019-11-12&end=2022-07-31&timeframe=1Day&symbols=BTC%2FUSD (Caused by NewConnectionError(‘<urllib3.connection.HTTPSConnection object at 0x4097e470a0>: Failed to establish a new connection: [Errno 110] Connection timed out’))

I don’t think im going over the 200 request per minute limit. (I proved this by waiting 2 minutes and making a single request).

I must be doing something wrong because if there was a problem with alpaca-py, im sure others would have complained by now. How can I figure out why Im getting an NewConnectionError?


I’m going to post a different question in the market data section. I think the issue is im trying to send api keys to not get rate limited, and im probably sending the wrong keys to the wrong url_override.

I was getting HTTPSConnectionPool errors a few days ago and started another thread for that. Mine was complaining about server not responding before timeout.

I was trying to retrieve positions and 1 minute bars. I have increased
APCA_RETRY_MAX and APCA_RETRY_WAIT to value of 5 and it seems to somewhat work for 1 minute bar retrieval. This morning it took over 70 retries at 5 second intervals to retrieve 1 minute candle for symbol “BJ”. That is an awful delay of almost 10 minutes before a successful response.