Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Rate Limits of Pull Request API endpoint?

I am building a check-script på a CI-env to check for new Pull Requests and run builds for them. The problem I am facing is that I do get alot of 429 errorcodes since I bombard the API to much (multiple repos and every X time-interval).

https://confluence.atlassian.com/bitbucket/rate-limits-668173227.html does not however document how many requests I am allowed to do for the endpoint(s):

/api/2.0/repositories/${project}/${repository}/pullrequests?limit=${limit}&state=OPEN

Also the document mentions that you are locked out for an hour which is not the way I "feel" how the API responds. But rather it works again just a few seconds later.

 

Is there any better way to do these checks and/or any info on how much I will have to throttle my requests?

1 answer

1 accepted

0 votes
Answer accepted

Hi @John Lindahl

Thank you for the detailed description of your scenario.

Let me share what I know about it:

  • The 1h limit is measured by a rolling window which means that in every minute you may have back some "credits" to run new requests until the total of 1000. That explains why you are not blocked for 1h.
  • Any request to /api/2.0/repositories/... will share the same request limit of 1000 calls.
    It means that you call 500 times the /api/2.0/repositories/${project}/${repository}/pullrequest endpoint and also call 500 times the /api/2.0/repositories/{username} endpoint in less than 1h you will be blocked until the rolling window frees up some calls.
  • Each user will have a new set of limits. So you will have 1000 calls per hour for user A and also 1000 request per hour for user B. In case you have more users to run those calls this is how you could handle more calls per hour.

I hope I could clarify a little bit how the limits are set.

Please let me know if you have more questions.

Thank you for this clarification. Now I Know how to work around this.

Like Daniel Santos likes this

You are welcome!
I'm glad I could help you with this one.

We are facing the same  problem with our generic account which build the release. Is it possible to increase this rate limit just for him ? We plan to migrate to gitlab just for that.

Hi @Jérôme Fraissinet

The only way to increase the number of requests is by using an extra user and splitting the requests between the two. We can't change the limits for your account, unfortunately.

@Daniel Santos - when you say "extra user" - do you mean

A) a second Member (User Account Login) of the existing Workspace, or
B) a second Workspace and move projects from the existing Workspace to the new one, or
C) something else?

where:  https://bitbucket.org/[Workspace]/[Repository]/

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

228 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you