Skip to content
GitmoapAPIBeta
Codelanguages
GET/repositories/{repo_id}/languages

A repository's programming-language breakdown, as of a named commit

get_repo_languages
  • repo:read
    A token needs the repo:read scope: View repositories and metadataGranted by mcp_agent, mcp_agent_write, read_api, read_repository, write_api, write_repository.Every operation this scope unlocks
  • Single-resource

    x-gitmoap-isolation: {"kind":"single_or_self_scoped"}

Each language's bytes, files and share of the code, largest first, with the commit the figures describe and the vendored, generated, documentation and unclassified bytes left out. A repository not yet indexed answers an empty breakdown with no commit. Anyone who can read the repository's code may call it.

Parameters

Path
  • repo_idRepositoryId (string · uuid)Repository ID

Responses

200Language breakdown returnedapplication/json
  • excludedExcludedBytesWhat was left out, and why.
    • The ExcludedBytes schema
    • documentationinteger · int64Docs, licences, changelogs.
    • generatedinteger · int64Lock files, minified bundles, source maps.
    • unclassifiedinteger · int64Binaries, symlinks, submodules, data and prose languages, and anything the vocabulary could not settle.
    • vendoredinteger · int64Third-party code the repository carries but did not write.
  • itemsarray of LanguageSliceLanguages, by bytes descending then name ascending so ties are stable across reads.
    • The LanguageSlice schema
    • bytesinteger · int64Bytes attributed to this language. Authoritative; share is a convenience.
    • filesinteger · int64How many files contributed.
    • languagestringThe language's name, as the vocabulary spells it.
    • sharenumber · doublePercentage of total_bytes, to two places.
    • typestringprogramming or markup — the only two kinds that reach a breakdown.
    • colorstring or nulloptionalThe CSS colour upstream renders this language with, when it defines one.
  • total_bytesinteger · int64Total counted bytes — the denominator of every share.
  • total_filesinteger · int64Total counted files.
  • truncatedbooleanWhether the tree exceeded the index cap, so this describes part of the repository.
  • indexed_atstring or nulloptionalWhen that index was written.
  • indexed_shastring or nulloptionalThe commit this describes. null when the repository has never been indexed.
200 exampleSynthesized example
{
"excluded": {
"documentation": 72,
"generated": 29,
"unclassified": 72,
"vendored": 4
},
"items": [
{
"bytes": 1,
"files": 45,
"language": "language-e579",
"share": 35,
"type": "type-0e4c"
}
],
"total_bytes": 7,
"total_files": 7,
"truncated": false,
"indexed_at": "2026-10-14T17:22:36Z",
"indexed_sha": "fb0f85dcc5dd17b2375233b5e1f1d07a4f93534a"
}
400Bad request — a path parameter is not a well-formed value of its typeapplication/json
Error codes
  • BAD_REQUESTThe request is malformed: a parameter or a body field is not a well-formed value of its type
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
400 exampleSynthesized example
{
"error": {
"code": "code-8dfc",
"message": "Label every synthesized example"
}
}
401Unauthenticated — no credential, or an invalid oneapplication/json
Error codes
  • UNAUTHORIZEDNo credential was sent, or the one sent is invalid, expired or revoked
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
401 exampleSynthesized example
{
"error": {
"code": "code-a909",
"message": "Pin a page's payload to the build that rendered it"
}
}
403Forbiddenapplication/json
Error codes
  • FORBIDDENYou are signed in but may not do this here; reason names the permission or the rule that refused it
  • INSUFFICIENT_SCOPEThe access token lacks the scope this operation needs; required_scope names it
  • PERMISSION_REQUIREDYou need a permission you do not hold here; the message names it
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
403 exampleSynthesized example
{
"error": {
"code": "code-e7f4",
"message": "Pin a page's payload to the build that rendered it"
}
}
404Repository not foundapplication/json
Error codes
  • NOT_FOUNDThe resource does not exist — or exists and you cannot see it: a private resource you have no access to answers exactly as an absent one does
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
404 exampleSynthesized example
{
"error": {
"code": "code-e7c0",
"message": "Draw the region map from operation density"
}
}

CLI

gitmoap languages get-repo-languages

  • --repo-ididRepository ID (id or owner/repo path)

Used in these guides