List all the projects in Gitlab

Hi,

I am an admin and I am trying to list all the projects using the private token in the curl command. However, it doesn’t provide me all the projects. If I look up on the UI, I can see all the projects though.
Is there any reason why the curl doesn’t return all the projects/pages that are there in Gitlab?

curl "https://git.comp.biz/api/v3/projects?private_token=???

Are you sure the user of the private token has access to all the projects? I’ve found that GitLab differentiates between being an admin and being owner/master of a project. Sometimes, it’s necessary to be an owner/master of a project.

Hi @hozawa, Actually I do not have access to all the projects but being an admin, I thought it should list them. Looks like that is not the case?

Check if those that are listed are the one you have access.
Personally, I just query the database “projects” table.
e.g.
SELECT * FROM gitlabhq_production.projects where archived=false

hello @devtakh, gitlab uses a paged API, the default is to return 20 entries per request. The http headers (use curl -i) will show you links to the next resp. previous page and how many pages are left. Basically you need to iterate on the pages, i.e. add query parameters " ?page=2&per_page=100".