The GET api/components/search by default returns 100 items. How can I return more?

sonarqube
web_api

(Jason Stanley) #1

Hello

Sonarqube version 6.7 LTS

I currently have 108 sonarqube projects.
When I run a curl command to list the projects, I only get 100 returned.

curl -s GET http://XXXX.com/api/components/search?qualifiers=TRK

Snip:
{“paging”:{“pageIndex”:1,“pageSize”:100,“total”:108},

How can I get all the projects to be listed?
I have tried to add the ps value set to 200, but that does nothing.
curl -s GET http://XXXX.com/api/components/search?qualifiers=TRK&ps=200

Any help is appreciated.
Thanks
Jason


(Jason Stanley) #2

I figured it out, using &pageSize=200 solved my problem.


(Duarte Meneses) #3

For future readers, there is no way, for most webservices, to return all results. There is typically a limit of 500 items per page and 20 pages (making 10.000 items) that can be returned.