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

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

Paging in Bitbucket REST API


I am using the docs @

I am querying my server with: https://server/rest/api/latest/repos?limit=4

I was expecting the answer to be something like:

        "size": 4,
        "limit": 4,
        "isLastPage": false,
        "values": [ ...
        "start": 0,
        "nextPageStart": 4

but what I got was:

        "size": 4,
        "limit": 4,
        "isLastPage": false,
        "values": [ ...
        "start": 0,
        "nextPageStart": 36

So my code uses "nextpageStart" of 36 for the next query (as the docs say it should), but

https://server/rest/api/latest/repos?limit=4?start=36 returns StatusCode 500 (because there are no 36 results for that query).


What should I do to get the paging to work?




2 answers

I did this in python, the parameter is start and the value for the start parameter is availabled at nextPageStart in json response if there is indeed next page, availability of next page can be checked by isLastPage in json response


def get_project_key_list(self, start='0'):
r = self.__call_service('rest/api/1.0/projects', params={'start': start, 'limit': '25'})
keys = list()
for value in r.json()['values']:
if not(r.json()['isLastPage']):
keys = keys + self.get_project_key_list(start=str(r.json()['nextPageStart']))
return keys

Do you have this solution now?
I also find out it :)
Maybe if you got it, share it for me.

Suggest an answer

Log in or Sign up to answer
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...

3,745 views 10 16
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