Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,300
Community Members
 
Community Events
184
Community Groups

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
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jun 14, 2019

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
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jun 18, 2019

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.

Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Nov 04, 2019

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
AUG Leaders

Atlassian Community Events