Check the response for the X-Total-Pages header. As long as page is smaller than total pages, you have to call the api again and increment the page variable. https://docs.gitlab.com/ee/api/rest/index.html#pagination-link-header

Answer from Sascha Frinken on Stack Overflow
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api
REST API | GitLab Docs
Keyset-pagination allows for more efficient retrieval of pages and - in contrast to offset-based pagination - runtime is independent of the size of the collection. This method is controlled by the following parameters. order_by and sort are both mandatory. The following example lists 50 projects ...
🌐
Elastic
discuss.elastic.co › elastic stack › logstash
GitLab API Pagination - Logstash - Discuss the Elastic Stack
July 9, 2018 - Hello guys, I'm trying to get some global information about GitLab projects from the API. The problem is that this API is limited to 100 projects per page. I've managed to retrieve the number of pages with the following command: echo $(curl --head "https://gitlab.xxxxxxx/api/v4/projects?pe...
🌐
GitLab
gitlab.com › gitlab.org › #17329
Make API pagination size configurable (#17329) · Issues · GitLab.org / GitLab · GitLab
</summary> - [Label this issue](https://contributors.gitlab.com/manage-issue?action=label&projectId=278964&issueIid=17329) - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=17329) </details> <!--IssueSummary end--> ### Description Currently the `per_page` parameter for API pagination defaults to `20` and can be set to a maximum of `100`. The spirit of this limit was to help with performance, by restricting very large queries.
🌐
Python GitLab
python-gitlab.readthedocs.io › en › stable › api-usage.html
Using the REST API - python-gitlab v8.5.0
Gitlab allows to also use keyset pagination. You can supply it to your project listing, but you can also do so globally. Be aware that GitLab then also requires you to only use supported order options.
🌐
GitLab
docs.gitlab.com › gitlab docs › contribute › contribute to gitlab › feature development › database › pagination guidelines › keyset pagination
Keyset pagination | GitLab Docs
For the REST API, the paginate_with_strategies helper can be used on a relation in order to use either keyset pagination or offset pagination. desc 'Get the things related to a project' do detail 'This feature was introduced in GitLab 16.1' success code: 200, model: ::API::Entities::Thing failure [ { code: 401, message: 'Unauthorized' }, { code: 403, message: 'Forbidden' }, { code: 404, message: 'Not Found' } ] end params do use :pagination requires :project_id, type: Integer, desc: 'The ID of the project' optional :cursor, type: String, desc: 'Cursor for obtaining the next set of records' opt
🌐
Microsoft Community
community.fabric.microsoft.com › microsoft fabric community › power bi forums › power query
Problem with GitLab API pagination in Power BI - Limited response size | Microsoft Fabric Community
July 16, 2024 - Fixed it. Needed to set the header parameter "scope=all" as described in the api docs for gitlab: https://docs.gitlab.com/ee/api/issues.html
Find elsewhere
🌐
GitLab
docs.gitlab.com › gitlab docs › contribute › contribute to gitlab › feature development › graphql › graphql pagination
GraphQL pagination | GitLab Docs
January 1, 2025 - GitLab uses two primary types of pagination: offset and keyset (sometimes called cursor-based) pagination. The GraphQL API mainly uses keyset pagination, falling back to offset pagination when needed.
🌐
GitLab
docs.gitlab.com › gitlab docs › contribute › contribute to gitlab › feature development › database › offset pagination optimization
Offset pagination optimization | GitLab Docs
# - Only apply optimization for large page number lookups # - When label_names filter parameter is given, the optimization will not have effect (complex JOIN). if params[:page] > 100 && params[:label_names].blank? && Feature.enabled?(:my_optimized_offet_query) Gitlab::Pagination::Offset::PaginationWithIndexOnlyScan.new(scope: scope, page: params[:page], per_page: params[:per_page]).paginate_with_kaminari else scope.page(params[:page]).per(params[:per_page]) end
🌐
University of Toronto
microfluidics.utoronto.ca › help › help
Pagination · Graphql guide · Development · Help · GitLab
January 1, 2026 - GitLab uses two primary types of pagination: offset and keyset (sometimes called cursor-based) pagination. The GraphQL API mainly uses keyset pagination, falling back to offset pagination when needed.
🌐
Python GitLab
python-gitlab.readthedocs.io › en › v2.3.1 › api-usage.html
Getting started with the API — python-gitlab 2.3.1 documentation
The following example will only make one API call to the GitLab server to star a project (the previous example used 2 API calls): # star a git repository project = gl.projects.get(1, lazy=True) # no API call project.star() # API call · You can use pagination to iterate over long lists.
🌐
GitLab
forum.gitlab.com › how to use gitlab › self-managed
GltLab REST API for listing tags ignores pagination when page=1 - Self-managed - GitLab Forum
April 3, 2025 - Problem to solve The GitLab REST API for listing tags ignores pagination when using a search criteria if page=1. Steps to reproduce Using non authenticated REST API on the public GitLab.com instance Listing all tags in the gitlab-org/gitlab ...
🌐
GitHub
github.com › DLR-SC › gitlab2prov › issues › 41
API client pagination - can't use 'x-total-pages' for GitLab.com · Issue #41 · DLR-SC/gitlab2prov
May 9, 2021 - The api client does not request more than the first page for some resources from projects hosted at GitLab.com. The pagination approach relies on the key x-total or x-total-pages being present in the request response headers. The GitLab ...
Author: DLR-SC
🌐
Javadoc.io
javadoc.io › static › org.gitlab › java-gitlab-api › 4.1.1 › org › gitlab › api › Pagination.html
Pagination (Gitlab Java API Wrapper 4.1.1 API)
org.gitlab.api.query.PaginationQuery · org.gitlab.api.Pagination · Deprecated. Use PaginationQuery.PARAM_PAGE instead. @Deprecated public class Pagination extends PaginationQuery · setPage, setPerPage · append, appendIf, appendIf, mergeWith, toString · clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait ·
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › jobs
Jobs API | GitLab Docs
By default, this request returns ... the API results are paginated · This endpoint supports both offset-based and keyset-based pagination, but keyset-based pagination is strongly recommended when requesting consecutive pages of results. Jobs are returned by ID in descending order.
🌐
Stack Overflow
stackoverflow.com › questions › 72965949 › pagination-issue-in-gitlab
Pagination issue in GitLab - api
Its only supported for Projects API, Groups API and Group Audit Events. Keyset-based pagination is supported only for selected resources and ordering options: Projects | Groups | Group audit events