Hi, Have you checked the API endpoints of Merge requests? Looks like something there could be useful for you if you want to get info about MRs from all projects you’re involved. Worst case scenario, you can always write a small Python script to loop through different projects or to get info from m… Answer from paula.kokic on forum.gitlab.com
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › projects
Projects API | GitLab Docs
REST API to create, retrieve, update, delete, and manage projects and project features.
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources
REST API resources | GitLab Docs
The GitLab REST API gives you programmatic control over GitLab resources. Build integrations with your existing tools, automate repetitive tasks, and extract data for custom reports. Access and manipulate projects, groups, issues, and merge requests without using the web interface.
Discussions

How to get a list of all your Gitlab personal projects via API?
My favourite would probably be https://gitlab.com/api/v4/projects?search=$your_username&search_namespaces=true However, that returns a 500 error for me :/ Alternatively you could do https://gitlab.com/api/v4/projects?owned=true , then iterate through the results and only keep those were the namespace.id matches your personal namespace. More on reddit.com
🌐 r/gitlab
3
3
June 17, 2022
How to get the project details using Gitlab API
Currently i have the below url for my gitlab and i would like to fetch all the projects details of MRs which are open. I know if we provide the project id in the url i could fetch. But it involves lot of manual task to g… More on forum.gitlab.com
🌐 forum.gitlab.com
1
0
February 15, 2024
Gitlab projects API "Search by project name" - How to Use GitLab - GitLab Forum
Unfortunately they did not put in the project ID, and I have a project to automate some changes in the Gitlab project files. Goal In a Powershell script I’m using AWS cli to retrieve the tags from the resource which includes the project name, then I’m using the gitlab projects api Search ... More on forum.gitlab.com
🌐 forum.gitlab.com
0
April 1, 2024
Create a new project in a group using API
I’m kind of new to the GitLab experience and I’m wanting to automate the local repo creation process with a Linux command line command that will create a project in GitLab using the API. I found the documentation hard to understand. I would like to use curl to do the API project creation. More on forum.gitlab.com
🌐 forum.gitlab.com
13
1
August 19, 2015
🌐
University of Toronto
microfluidics.utoronto.ca › help › help
Projects · Api · Help · GitLab
Use this API to manage GitLab projects and their associated settings. A project is a central hub for collaboration where you store code, track issues, and organize team activities.
🌐
Medium
medium.com › devops-with-valentine › how-to-use-the-gitlab-rest-api-ba4e4ca1fcae
How to use the GitLab REST API. The GitLab API allows you to perform… | by Valentin Despa | DevOps with Valentine | Medium
September 24, 2021 - I am using gitlab.com, so the GitLab API base URL will be this: ... I will call the projects endpoint to get a list of all public projects.
🌐
GitLab
forum.gitlab.com › how to use gitlab
How to get the project details using Gitlab API - How to Use GitLab - GitLab Forum
February 15, 2024 - Currently i have the below url for my gitlab and i would like to fetch all the projects details of MRs which are open. I know if we provide the project id in the url i could fetch. But it involves lot of manual task to go through all 45 projects and provide the id and retrive the details using postman.
Find elsewhere
🌐
DZone
dzone.com › testing, deployment, and maintenance › deployment › using the gitlab rest api to create a git projects
Using the GitLab REST API to Create a Git Projects
October 4, 2019 - Git some REST with the GitLab REST API. Git is one of the most popular SCM used currently and GitLab is one of the most popular products used to manage git repositories in a centralized way — not to mention, it comes with lots of handy features. Instead of using a flat structure, it allows the user to organize repositories into subgroups and use templates to generate repositories and apply security per group to create a group structure. When it comes to projects, we have two options, one is using the WebUI console and the other is using the REST API.
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api
REST API | GitLab Docs
The root endpoint is the GitLab host name. The path must start with /api/v4 (v4 represents the API version). In the following example, the API request retrieves the list of all projects on GitLab host gitlab.example.com:
🌐
GitLab
forum.gitlab.com › how to use gitlab
Gitlab projects API "Search by project name" - How to Use GitLab - GitLab Forum
April 1, 2024 - Unfortunately they did not put in the project ID, and I have a project to automate some changes in the Gitlab project files. Goal In a Powershell script I’m using AWS cli to retrieve the tags from the resource which includes the project name, then I’m using the gitlab projects api Search ...
🌐
Rewind
rewind.com › home › blog › backup blogs
Using the GitLab API | Rewind
September 3, 2024 - It is important to note that it is also possible to use personal or project tokens with OAuth2 compliant headers. That would look something like this: curl --header "Authorization: Bearer <your_access_token>" "https://gitlab.example.com/api/v4/projects"
🌐
GitProtect.io
gitprotect.io › strona główna › how to use gitlab api – best practices for your development team
How to Use GitLab API - Best Practices for Your Development Team - Blog | GitProtect.io
December 11, 2024 - GraphQL – it co-exists with v4 of REST API and according to the very idea of GraphQL, it allows you to create a request for only what we need ... Such a query returns all projects of a given user. The –include flag also returns HTTP response header, for example, HTTP/2 200 or HTTP/2 302, as it was in my case. Yes, I received the above HTTP/2 302 code for a reason. This code means a redirection, in particular a redirection to the address https://gitlab...
🌐
GitLab
forum.gitlab.com › how to use gitlab
Create a new project in a group using API - How to Use GitLab - GitLab Forum
August 19, 2015 - I'm kind of new to the GitLab experience and I'm wanting to automate the local repo creation process with a Linux command line command that will create a project in GitLab using the API. I found the documentation hard t…
Top answer
1 of 9
98

If only your private token is available, you can only use the API:

PROJECTS

Use the following command to request projects:

curl "https://<host>/api/v4/projects?private_token=<your private token>"

This will return you the first 20 entries. To get more you can add the paramater per_page

curl "https://<host>/api/v4/projects?private_token=<your private token>&per_page=100"

with this parameter you can request between 20and 100 entries (see REST API Pagination documentation).

If you now want all projects, you have to loop through the pages. To get to another page add the parameter page.

curl "https://<host>/api/v4/projects?private_token=<your private token>&per_page=100&page=<page_number>"

Now you may want to know how many pages there are. For that, add the curl parameter --head. This will not return the payload, but the header.

The result should look like this:

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 13 Jul 2017 17:43:24 GMT
Content-Type: application/json
Content-Length: 29428
Cache-Control: no-cache
Link: <request link>
Vary: Origin
X-Frame-Options: SAMEORIGIN
X-Next-Page: 2
X-Page: 1
X-Per-Page: 20
X-Prev-Page:
X-Request-Id: 80ecc167-4f3f-4c99-b09d-261e240e7fe9
X-Runtime: 4.117558
X-Total: 312257
X-Total-Pages: 15613
Strict-Transport-Security: max-age=31536000

The two interesting parts here are X-Totaland X-Total-Pages. The first is the count of available entries and the second the count of total pages.

I suggest to use python or some other kind of script to handle the requests and concat the results at the end.

If you want to refine the search, consult this wiki page: https://docs.gitlab.com/api/projects.html#projects-api

GROUPS

For groups simply replace projects with groups in the curls. https://docs.gitlab.com/api/groups.html#list-groups


UPDATE:

Here is the official list of Gitlab API clients/wrappers: https://docs.gitlab.com/api/rest/third_party_clients/

I highly recommend using one of these.

2 of 9
10

In bash for Gitlab API V4:

#!/bin/bash
GL_DOMAIN=""
GL_TOKEN=""
echo "" > gitlab_projects_urls.txt
for ((i=1; ; i+=1)); do
    contents=$(curl "$GL_DOMAIN/api/v4/projects?private_token=$GL_TOKEN&per_page=100&page=$i")
    if jq -e '. | length == 0' >/dev/null; then 
       break
    fi <<< "$contents"
    echo "$contents" | jq -r '.[].ssh_url_to_repo' >> gitlab_projects_urls.txt
done
🌐
Zuplo
zuplo.com › blog › 2025 › 03 › 24 › gitlab-api
GitLab API Guide: Unlock Powerful Integrations for Developers - DEV Community
June 11, 2026 - This JavaScript snippet fetches all your accessible projects. From here, you can create new projects, modify existing ones, or even nuke projects when they're no longer needed. GitLab's CI/CD capabilities are where the platform really shines, and the API gives you the keys to the kingdom:
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › repositories
Repositories API | GitLab Docs
Works exactly like POST /projects/:id/repository/changelog, except the changelog data is not committed to any changelog file. ... Optional. You can add a .txt suffix that returns the changelog as plain text Markdown instead of JSON: ... curl --header "PRIVATE-TOKEN: token" \ --url "https://gitlab.com/api/v4/projects/42/repository/changelog?version=1.0.0"
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › projects › import and export
Project import and export API | GitLab Docs
Imports a project from an archive stored in a specified AWS S3 bucket. ... The passed override parameters take precedence over all values defined in the export file. curl --request POST \ --url "https://gitlab.example.com/api/v4/projects/remote-import-s3" \ --header "PRIVATE-TOKEN: <your gitlab ...
🌐
GitHub
github.com › topics › gitlab-api
gitlab-api · GitHub Topics · GitHub
gitlab tools monitoring cybersecurity gitlab-api infosec red-team dlp blueteam blue-team data-loss-prevention redteam purpleteam purple-team gitlab-watchman ... Import commits from a private GitLab repository in an anonymized way. ... Simple python project for exporting GitLab projects with Export Project funkcionality in GitLab API.
🌐
GitLab
docs.gitlab.com › gitlab docs › extend
Extend with GitLab | GitLab Docs
Configure and manage project and group webhooks in GitLab. ... Use the GitLab REST API for programmatic interaction with GitLab.
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › package registry
Packages API | GitLab Docs
Use this API to interact with GitLab Packages. ... Lists all packages for a specified project. All package types are included in results. When accessed without authentication, only packages of public projects are returned. By default, packages with default, deprecated, and error status are returned.