---
title: "Fetch GitHub repo metadata, files, PRs, issues, or discussions"
method: POST
path: "/api/v1/github/get"
tags: ["GitHub"]
---

# Fetch GitHub repo metadata, files, PRs, issues, or discussions

`POST /api/v1/github/get`

## Request

- Base URL: `https://glim.sh`
- URL: `https://glim.sh/api/v1/github/get`
- Auth: one of:
  - none
  - API key in header `x-api-key`
  - HTTP bearer
  - API key in query parameter `apiKey`

Fetch GitHub data from a single ref (a github.com URL or owner/repo shorthand): repo metadata + README, files, tree, commits, branches, releases, PRs, issues, discussions, or topic repo listings - inferred from the ref.

## Request body

- object
  - `ref` string, required: GitHub URL or 'owner/repo' shorthand. A repo URL or owner/repo returns metadata + README; /pull/N -> PR (with comments + changed files), /issues/N -> issue, /discussions/N -> discussion (with threaded replies), /blob/<ref>/<path> -> file (raw.githubusercontent.com URLs work too), /tree/<ref>[/<path>] -> file tree (optionally scoped to a subdirectory), /commit/<sha> -> one commit with diff, /commits[/<ref>/<path>] -> history (optionally for one file), /branches, /releases (or /releases/tag/<tag> | /releases/latest -> one release), /topics/<name> -> top repos with that topic (by stars).
  - `page` integer: Page number for paginated results
  - `per_page` integer: Results per page

## Response `200`

GitHub data

- object: GithubGetResponse
  - `data` unknown, required
  - `kind` string, required: Resource kind resolved from the ref
  - `truncated` boolean: Whether the payload was clipped
  - `total_count` number: Total matching repos (topic refs only)
  - `notice` string: How the ref was resolved (e.g. the repository was renamed)
  - `path_missing` boolean: Tree refs only: the path is absent from this tree, as opposed to an empty tree

## Other responses

- `400`: Bad Request
- `402`: Payment Required
- `404`: Not Found
- `502`: Upstream Error

---

[API](https://skmtc.dev/glim/apis/glim-sh.md) · [All operations](https://skmtc.dev/glim/apis/glim-sh/llms.txt) · [OpenAPI document](https://skmtc.dev/glim/apis/glim-sh/revisions/0094e5226d73?raw)
