alpacahq / alpaca-py

The Official Python SDK for Alpaca API
https://alpaca.markets/sdks/python/getting_started.html
Apache License 2.0
537 stars 134 forks source link

[Question]: How to understand the number of API calls I'm making? #370

Open dskarbrevik opened 10 months ago

dskarbrevik commented 10 months ago

Question form pre-submit checklist.

Question

As I'm testing out the functionality of various sdk features, I'm left wondering what kind of behavior will have me hitting rate limits and what will be fine.

Does the SDK have any utils to help me monitor the number of calls I'm making?

And one specific example question on this topic, if I make a StockBarsRequest() for 2 symbols, TimeFrame="Day" and start/end of 1 year.. is this 1 API call?.. or 2 API calls (1 per symbol)?.. or more because of the start/end length?

LukeDickerson19 commented 4 months ago

+1, it'd be nice if alpaca-py provided access to the html headers X-Ratelimit-Limit, X-Ratelimit-Remaining, and X-Ratelimit-Reset, as described here.