Find the project ID for the GitLab API

apigitlabgitlab-ci

I use GitLab on their servers. I would like to download my latest built artifacts (build via GitLab CI) via the API like this:

curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.com/api/v3/projects/1/builds/8/artifacts"

Where do I find this project ID? Or is this way of using the API not intended for hosted GitLab projects?

Best Answer

I just found out an even easier way to get the project id: just see the HTML content of the gitlab page hosting your project. There is an input with a field called project_id, e.g:

<input type="hidden" name="project_id" id="project_id" value="335" />
Related Topic