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

API to pull the list of pipelines ran between timestamps

Devendra Sharma July 15, 2021

I need to build a report and need the list of pipelines ran between two dates timestamp in the entire workspace with their current status.
I found the below API to get the pipelines, but it only returns the data for one repo at a time. This API also has a limitation of thousand calls per hour, and I have more than a thousand repositories in my workspace-
https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/pipelines/


Please suggest how I can solve this.

 

Thanks,

Dev

1 answer

0 votes
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 28, 2021

Hi @Devendra Sharma

Thanks for reaching out to the community.

Indeed, you can use that Pipelines Bitbucket Cloud REST API endpoint to get your Pipelines builds.
However, I'm afraid it will only get Pipelines builds one repository at a time.
You'll have to make multiple requests to get Pipelines builds from multiple repositories.

That is also true that we have the API rate limits for the API endpoints from /2.0/repositories.
For this, we normally suggest doing the following to avoid getting rate limited:

  • Putting a delay/sleep 5-10 min for the API calls made against your account to the repositories to avoid reaching throttling limit (Also please note that the hour is rolling hour not "fixed clock hour")
  • Set up multiple users and make API calls from multiple authenticated users to the list of specific repositories to avoid hitting that limit.

You mentioned that you need to build a report to list Pipelines builds.
May I know if you wanted to get Pipelines build minutes usage across your repositories?

Regards,
Mark C

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events