I'm downloading a list of commits through the Bitbucket REST API, and I'm running into the flowing message:
AppError: Rate limit for this resource has been exceeded.
There is information on the rate limits here: https://confluence.atlassian.com/bitbucket/rate-limits-668173227.html
However, there isn't a lot of information around how they work, when they reset, or what the timeout is. I would like to modify my download script in a way that can download the full list of commits, while still respecting the limits.
Community moderators have prevented the ability to post new answers.
Hi Jeremy, rate limits are divided into one hour windows for both authenticated and unauthenticated requests. To obtain a list of repository commits, the rate is 1,000 requests per hour. Once you reach it you'll need to wait until 1 hour has passed so you can continue sending requests.
Hope this clarifies!
Ana
So, does that mean If I make 1000 requests from 9:45 to 9:59, I can then make 1000 more requests from 10:01-10:15.
Is the one hour window based on clock time? is it a rolling count? Does it start with the last request?
My workload is bursty, so, I would like some clarification around how it's calculated to better prepare for this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jeremy,
It's the rolling count I believe , not by clock hour.
Cheers.
Yana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks! Is there no official documentation on this behavior, aside from the above link?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jeremy,
The document linked above is what we have available right now.
If you do get more questions or need clarification on anything please do get in touch via the community or raise a support ticket with us.
Cheers.
Yana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm responding to this to add to the documentation. My tests confirmed that it's a rolling count.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ana Retamal your comment here contradicts the documentation
Rate limits are divided into a one-hour rolling window for both authenticated and unauthenticated requests, which means that for every minute that passes, you will be provided that time to run new requests but the total you can run consecutively over an hour is 1,000.
That would imply that when you hit the limit, you may only have to wait 1 minute to have some requests available. For example, if I send 500 requests at 3:33 and 500 requests at 4:32, as soon as it ticks 4:33, you'll get those first 500 requests back. But if I send all 1000 requests at 4:32, I'll have to wait until 5:32 to send another request.
... assuming my understanding of the documentation and its intended meaning are the same thing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I may be missing something, but rather than using the API could you clone the entire repo and extract the list of commits locally?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not able to find an endpoint to clone the repository from the OAuth Credentials.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I realize that this is a year late, but in case anyone lands here, you can use an oauth access token to clone repos as described on this page: https://developer.atlassian.com/bitbucket/api/2/reference/meta/authentication
Since add-ons will not be able to upload their own SSH keys to clone with, access tokens can be used as Basic HTTP Auth credentials to clone securely over HTTPS. This is much like GitHub, yet slightly different:
$ git clone https://x-token-auth:{access_token}@bitbucket.org/user/repo.git
The literal string x-token-auth
as a substitute for username is required (note the difference with GitHub where the actual token is in the username field).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.