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
Retrieves the specified project. This endpoint can be accessed without authentication if the project is publicly accessible. ... curl --header "PRIVATE-TOKEN: <your_access_token>" \ --header "Accept: application/json" \ --url "https://gitlab.example.com/api/v4/projects/<project_id>"
🌐
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 ...
Discussions

gitlab - List all the projects and all the groups - Stack Overflow
What is the easiest method to list all the projects and groups in GitLab using my private token? ... Save this answer. ... Show activity on this post. If only your private token is available, you can only use the API: ... This will return you the first 20 entries. To get more you can add the ... More on stackoverflow.com
🌐 stackoverflow.com
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
Where do I find the project ID for the GitLab API? - Stack Overflow
Or is this way of using the API not intended for hosted GitLab projects? ... A GitLab project's main page should come with the "More actions" menu (button with three vertical dots; usually top right) which shows the ID when clicked. ... Save this answer. ... Show activity on this post. I just found out an even easier way to get ... More on stackoverflow.com
🌐 stackoverflow.com
Gitlab projects API "Search by project name" - How to Use GitLab - GitLab Forum
Unfortunately they did not put ... to retrieve the tags from the resource which includes the project name, then I’m using the gitlab projects api Search by Project Name to get the ID of the project so that my ...... More on forum.gitlab.com
🌐 forum.gitlab.com
0
April 1, 2024
🌐
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.
🌐
Python GitLab
python-gitlab.readthedocs.io › en › stable › gl_objects › projects.html
Projects - python-gitlab v8.5.0 - Read the Docs
GitLab API: https://docs.gitlab.com/api/projects · List projects: projects = gl.projects.list(get_all=True) The API provides several filtering parameters for the listing methods: archived: if True only archived projects will be returned · visibility: returns only projects with the specified visibility (can be public, internal or private) search: returns project matching the given pattern ·
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
🌐
University of Toronto
microfluidics.utoronto.ca › help › help
Projects · Api · Help · GitLab
List projects. The _links.cluster_agents attribute in the response was introduced in GitLab 15.0. Get a list of all visible projects across GitLab for the authenticated user.
Find elsewhere
🌐
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 ... to retrieve the tags from the resource which includes the project name, then I’m using the gitlab projects api Search by Project Name to get the ID of the project so that my ......
🌐
Stack Overflow
stackoverflow.com › questions › 52944992 › gitlab-api-how-am-i-able-the-get-the-list-of-projects-using-gitlab-api
GitLab api: how am i able the get the list of projects using gitlab api? - Stack Overflow
i was trying to get the list of projects in my gitlab using Git api. for that i was following Git lab api instruction. they said i can access the list of project by this link: https://gitlab.com...
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › repositories
Repositories API | GitLab Docs
Use this API to manage Git repositories. ... Lists all repository files and directories in a specified project. This endpoint can be accessed without authentication if the repository is publicly accessible. This command provides essentially the same features as the git ls-tree command.
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › package registry
Packages API | GitLab Docs
By default, the GET request returns 20 results, because the API is paginated. Lists all pipelines for a specified package. The results are sorted by id in descending order. The results are paginated and return up to 20 records per page. ... curl --header "PRIVATE-TOKEN: <your_access_token>" \ --url "https://gitlab.example.com/api/v4/projects/:id/packages/:package_id/pipelines"
🌐
Pulumi
pulumi.com › registry › gitlab › api docs
gitlab.getProjects | Pulumi Registry
July 23, 2026 - The gitlab.getProjects data source allows details of multiple projects to be retrieved. Optionally filtered by the set attributes. This data source supports all available filters exposed by the client-go package, which might not expose all available ...
🌐
GitLab
forum.gitlab.com › how to use gitlab
How to get the all project IDs (about 250 projects) within a given Group in GitLab by using API curl - How to Use GitLab - GitLab Forum
June 17, 2021 - 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...
🌐
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 - For people just getting started with APIs, the REST API is much easier to understand and use. So this is what I will be demoing in this tutorial. The GitLab API specification defines various endpoints based on the action we want to perform. Let’s do a simple request using Postman. 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
docs.gitlab.com › gitlab docs › extend › rest api › resources › projects › members
Projects members API | GitLab Docs
This means that if the requester is a member of a shared group or project, but not a member of an invited private group, then using this endpoint the requester can get all the shared group or project members, including the invited private group members. ... curl --header "PRIVATE-TOKEN: <your_access_token>" \ --url "https://gitlab.example.com/api/v4/projects/:id/members/all/:user_id"
🌐
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.com/users/sign_in.
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api › resources › groups
Groups API | GitLab Docs
The projects and shared_projects attributes in the response are deprecated and scheduled for removal in API v5. To get the details of all projects within a group, use either the list a group’s projects or the list a group’s shared projects endpoint. curl --header "PRIVATE-TOKEN: <your_access_token>" \ --url "https://gitlab.example.com/api/v4/groups/4"
🌐
GitLab
docs.gitlab.com › gitlab docs › extend › rest api
REST API | GitLab Docs
API requests can use parameters sent as query strings or as a payload body. GET requests usually send a query string, while PUT or POST requests usually send the payload body: ... curl --request POST \ --url "https://gitlab.example.com/api/v4/projects?name=<example-name>&description=<examp...