GitLab API

Get GitLab data as clean JSON with one key: 20 endpoints, 1 to 5 credits per call, the same response shape as every other platform.

What you get#

Onekey exposes GitLab as 20 endpoints behind one API key: 7 endpoints return one record (data is an object) and 13 endpoints return a list (data is an array). Every answer uses the same envelope (success, data, metadata, error), the cost is reported in metadata.credits_charged, and fields are mapped onto the unified schema so the code you write for GitLab also works for the rest of the developer platforms category.

Endpoints#

EndpointWhat it doesParametersCreditsStatus
branchesBranches of a GitLab.com project.project*5stable
commitOne commit of a GitLab.com project (sha or ref).project*, ref*1stable
commitsRecent commits of a GitLab.com project.project*5stable
contributorsTop contributors of a GitLab.com project.project*5stable
eventsRecent public activity events of a GitLab.com project.project*5stable
groupGitLab.com group metadata.group*1stable
group_projectsProjects of a GitLab.com group (most starred first).group*5stable
issueOne issue of a GitLab.com project.project*, iid*1stable
issuesRecent issues of a GitLab.com project.project*5stable
languagesLanguage breakdown (percent) of a GitLab.com project.project*1stable
merge_requestOne merge request of a GitLab.com project.project*, iid*1stable
merge_requestsRecent merge requests of a GitLab.com project.project*5stable
pipelinesRecent CI pipelines of a public GitLab.com project.project*5stable
projectGitLab.com project metadata.project*1stable
searchSearch public GitLab projects (most starred first).q*5stable
search_groupsSearch public GitLab.com groups.q*5stable
subgroupsSubgroups of a GitLab.com group.group*5stable
tagsTags of a GitLab.com project.project*5stable
topic_projectsPublic GitLab.com projects by topic (most starred first).topic*5stable
userGitLab.com public user profile.username*1stable

A * marks a required parameter. Each endpoint name links to its reference page with the full parameter table, caching window and a recorded response.

Make a request#

This calls gitlab.commit (1 credit, stable). Replace YOUR_API_KEY with your key; sign up, no card. 1,000 free credits cover the open-platform endpoints. Hard-to-reach platforms (X, TikTok, Instagram, Reddit, and others marked on their page) need a verified email and a purchased pack.

curl "https://api.onekey.dev/v1/gitlab/commit?project=gitlab-org%2Fgitlab&ref=master" \
  -H "x-api-key: YOUR_API_KEY"

Fields you get back#

These unified fields come back from GitLab, with the same names as on every other platform. The count is how many of its 20 mapped endpoints return the field; a field the source lacks is null, never missing. 15 platform-specific fields (ext.<name>) come on top, documented on each endpoint page.

FieldTypeEndpoints
author.usernamestring13
author.displayNamestring11
content.textstring11
content.createdAtISO 8601 date10
content.idstring10
content.titlestring9
author.urlURL8
content.urlURL8
engagement.likesinteger6
content.statestring5
content.updatedAtISO 8601 date5
author.idstring4
engagement.commentsinteger4
entity.namestring4
entity.updatedAtISO 8601 date4
entity.urlURL4
entity.createdAtISO 8601 date3
entity.descriptionstring3
entity.idstring3
entity.stats.forksinteger3
entity.stats.openIssuesinteger3
entity.stats.starsinteger3
entity.tagslist of strings3
package.defaultBranchstring3
author.avatarUrlURL2
author.createdAtISO 8601 date1
engagement.sharesinteger1

The full schema is in Unified schema.

Pricing#

GitLab calls cost 1 to 5 credits, flat per endpoint. Free when served from cache (0.2 credit for a cached response over 100 KB). Invalid, failed or not-found calls are not charged. See pricing for credit packs.