# Get a repository's languages

> The languages a repository's default branch is written in, by bytes, largest first: each with its name, color, bytes and percent.

<div class="g1t-endpoint"><span class="g1t-method" data-method="get">GET</span><code>/repos/{owner}/{name}/languages</code></div>

Programming and markup languages count; data (JSON, YAML) and prose (Markdown) do not, nor do vendored, generated and documentation files, unless the repository's .gitattributes says otherwise (linguist-vendored, linguist-generated, linguist-documentation, linguist-language, linguist-detectable). Worked out in the background for the default branch's head and kept by commit: commit says which commit the answer is for, and pending is true while the first is worked out (ask again in a few seconds). partial is true when the repository was too large to read in full.

While `pending` is true, `languages` is empty: the default branch is being read for the first time. When `commit` is not `head`, the answer is for an older commit while the newer one is read.

- **Authentication:** Optional. Public data can be read without a token; send one to see what is private.
- **MCP tool:** [`repository`](/reference/mcp/#repository) with `action` `languages`, and the same inputs
- **Scope:** An access token needs [`repo:read`](/guides/authentication/#scopes).

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `owner` | string | Yes | The workspace that owns the repository. |
| `name` | string | Yes | The repository's name. |

## Example request

```sh
curl https://api.g1t.sh/repos/flagon-io/hello/languages \
  -H "Authorization: Bearer $G1T_TOKEN"
```

## Example response

A successful request answers `200` with:

```json
{
  "head": "9f3c2a1b7e5d4c3b2a19f8e7d6c5b4a39281706f",
  "commit": "9f3c2a1b7e5d4c3b2a19f8e7d6c5b4a39281706f",
  "computed_at": "2026-10-07T09:14:03.000Z",
  "pending": false,
  "partial": false,
  "languages": [
    {
      "name": "Rust",
      "color": "#dea584",
      "bytes": 184213,
      "percent": 71.4
    },
    {
      "name": "TypeScript",
      "color": "#3178c6",
      "bytes": 61022,
      "percent": 23.7
    },
    {
      "name": "Shell",
      "color": "#89e051",
      "bytes": 12650,
      "percent": 4.9
    }
  ]
}
```

## Errors

A failed request answers with one of these statuses and a body like `{"error": {"code": "not_found", "message": "Repository not found."}}`. See [errors](/reference/api/#errors).

| Status | Code | When |
| --- | --- | --- |
| 401 | `unauthenticated` | A token is required, or the one sent is not valid. |
| 403 | `forbidden` | The token is valid but not allowed to do this, such as a member-only change or an agent token outside its repository. |
| 404 | `not_found` | It does not exist, or you cannot see it. |
| 422 | `invalid` | The input is not valid. `message` says which field and why. |
