# API pagination broken?

**URL:** <https://forum.gitea.com/t/api-pagination-broken/2185>\
**Category:** API/SDK/Tea/HelmChart/Terraform\
**Created:** [May 28, 2020, 7:36am UTC](https://forum.gitea.com/t/api-pagination-broken/2185 "2020-05-28T07:36:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric-belhomme](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/eric-belhomme/32/929_2.png) [@eric-belhomme](https://forum.gitea.com/u/eric-belhomme)\
**Post date:** [May 28, 2020, 7:36am UTC](https://forum.gitea.com/t/api-pagination-broken/2185/1 "2020-05-28T07:36:41Z")

</div>

Hello,

I working with Gitea 1.11.5 and I’m playing with its API, and I think I’m facing a bug with the pagination mechanism.

I first played with the **/repos/search** route: according to Swagger documentation, there are **page** and **limit** parameters, So I expected to find some cookies or headers in Gitea answer to get the total number of pages and the current page, but I only get a **X-Total-Count** header, so I have to compute by myself the total number of pages.

Why not, but usually this information is returned by the server.

Ok, secondly I played with **/orgs/{org}/repos** route: again, according to Swagger documentation, there are **page** and **limit** parameters. But this is not working **at all**!

```
curl -v -H 'Authorization: token <my token>' 'http://127.0.0.1:3000/api/v1/orgs/<my orga>/repos?limit=5' | jq .[].name

```

This returns the following headers and cookies:  
\< HTTP/1.1 200 OK  
\< Content-Type: application/json; charset=UTF-8  
\< Set-Cookie: lang=en-US; Path=/; Max-Age=2147483647  
\< Set-Cookie: i\_like\_gitea=1a0f5cbb5d1bdd3e; Path=/; HttpOnly  
\< Set-Cookie: \_csrf=Ucpg8ilkcqXWa4D5f7d9QF\_sBDY6MTU5MDY1MDE2NjE4MTg0MDkyNQ; Path=/; Expires=Fri, 29 May 2020 07:16:06 GMT; HttpOnly  
\< X-Content-Type-Options: nosniff  
\< X-Frame-Options: SAMEORIGIN  
\< Date: Thu, 28 May 2020 07:16:06 GMT  
\< Transfer-Encoding: chunked

And I get 12 projects enumerated (the total amount of projects in that organization)

So:

1. limit parameter seems to be totally ignored
2. I don’t even get a value in headers to get count of projects in organiszation.

I’m quite surpised with that, so am I missing something ?

Regards,

Eric
