How to get the all project IDs (about 250 projects) within a given Group in GitLab by using API curl

I use following part of the bash script to retrieve all IDs of the projects within a given GitLab group using API calls. There are about 250 projects in the group. But when use this script it only retrieves 100 projects ids. How do I retrieve all of the project ids?

page=1 #------Retrieve the IDs of the non archived projects in the group
while [[ “$page” != “0” ]]
do
urlCheck=curl -s "$GIT_API/groups?private_token=$GIT_TOKEN&per_page=100&page=$page" | jq -r ".[] | .name"

if [[ -n $urlCheck ]]
then
        
    PROJECT_ID_ARRAY+=($(curl -sS --request GET --header "PRIVATE-TOKEN: $GIT_TOKEN" "$GIT_API/groups/1079/projects?include_subgroups=true&per_page=100&page=${page}" | jq -r '.[] .id'))

    page=$((page+1))
else
        page=0
fi

done

Hi @dhanushka278

I would say your pagination logic isn’t working.
Fetch the first page to get number of pages and then just do a for incrementing the page.