0

My group has subgroups and projects. How do I retrieve all projects under "gpt" group in gitlab through API.

kulNinja
  • 526
  • 6
  • 14
  • Does this answer your question? [Gitlab API for all projects under group](https://stackoverflow.com/questions/31498473/gitlab-api-for-all-projects-under-group) – sytech Aug 22 '22 at 18:31

1 Answers1

0

Gitlab Groups API for projects is paginated which means it gives max 100 records on 1 page. You need to check the 'X-Total-Pages' under the response header. X-Total-Pages are the total pages that you need to loop through.

resp.headers["X-Total-Pages"] should get you the total pages.

You will iterate through X-Total-Pages to get the all projects.

kulNinja
  • 526
  • 6
  • 14