Reputation: 113
I would like to know if there is a way to get the languages (percentage per language) used in a project by using the API provided by GitLab. I checked their documentation but I didn't see anything about that or maybe I missed it.
I know that they use the Linguist library but I'm developping an application that's is not in Ruby and I'm looking for a way to integrate theses percentages.
Upvotes: 3
Views: 6041
Reputation: 3701
As of 10.8.x, Gitlab added a new API entrypoint, exposing languages used in a specific repository.
Usage is straight forward :
curl --header "PRIVATE-TOKEN: <__ACCESS_TOKEN__>" https://gitlab.mydomain.com/api/v4/projects/<ID>/languages
docs : https://docs.gitlab.com/ee/api/projects.html#languages
Hope this helps!
Upvotes: 12