> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrouter.net/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub

> Repositories, issues, pull requests, commits and code search on GitHub through its REST API.

![](https://mintcdn.com/webrouter/gPu3tCeozwRcDBjt/logo/data-apis/github.webp?fit=max\&auto=format\&n=gPu3tCeozwRcDBjt\&q=85\&s=6d0aff0477a0a6a6c84393f1eebc8d90)

[Web Catalog · Developer](https://docs.webrouter.net/data-apis.md?category=developer)

Key optional

Endpoints

9

Auth

Key in header

[Vendor docs](https://docs.github.com/en/rest) · [Pricing](https://github.com/pricing) · Serves `github.com`

## Setup

| Variable | | What it is |
| - | - | - |
| `GITHUB_TOKEN` | some calls | a GitHub personal access token (Settings > Developer settings > Personal access tokens), fine-grained with read access to the repositories you need. Optional for public data, needed for private repositories, code search and writes |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* Works without a token for public data, at 60 requests an hour per IP; a token raises that to 5,000 an hour. Search has its own per-minute limits.
* Paging: per\_page up to 100 (default 30) and page; the Link response header carries the next and last page URLs.
* Times are ISO 8601 UTC, YYYY-MM-DDTHH:MM:SSZ.
* Pull requests are issues too: comments on a PR conversation go through the issues endpoints, and issue numbers and PR numbers share one sequence.

## Endpoints

GET

Search repositories

Repositories matching keywords and qualifiers (language:, stars:, topic:, org:...).

[Open](#github-search-repositories)

GET

Search issues and pull requests

Issues and PRs across GitHub matching keywords and qualifiers (repo:, is:pr, is:open, author:, label:...).

[Open](#github-search-issues)

GET

Get a repository

Description, stars, forks, open issues, topics, license, default branch and dates.

[Open](#github-repos-get)

GET

Get a repository's README

The README of the default branch or a given ref.

[Open](#github-repos-readme)

GET

List a repository's issues

Issues and pull requests in a repository, filtered by state, labels, assignee and date.

[Open](#github-issues-list)

GET

Get an issue

One issue or pull request by number, with body, labels, state and counts.

[Open](#github-issues-get)

GET

List an issue's comments

Comments on an issue or pull request conversation, oldest first.

[Open](#github-issues-comments)

GET

Get a pull request

One PR with title, body, state, merge status, head and base, and diff stats.

[Open](#github-pulls-get)

GET

List a pull request's files

Files a PR changes, with status, additions, deletions and patch.

[Open](#github-pulls-files)

### Search repositories

GET

`/search/repositories`

`github.search.repositories`

Repositories matching keywords and qualifiers (language:, stars:, topic:, org:...).

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`q` required</td><td>string</td><td>query</td><td>Keywords and qualifiers. Example `web scraping language:python stars:>500`</td></tr>
    <tr><td>`sort`</td><td>string</td><td>query</td><td>Sort field; default best match. One of `stars`, `forks`, `help-wanted-issues`, `updated`</td></tr>
    <tr><td>`order`</td><td>string</td><td>query</td><td>desc (default) or asc; only with sort. One of `desc`, `asc`</td></tr>

    <tr>
      <td>
        `per_page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Results per page, at most 100; default 30.
      </td>
    </tr>

    <tr>
      <td>
        `page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page number, from 1.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.github.com/en/rest/search/search#search-repositories)

```python Python theme={null}
router.call_data_api("github.search.repositories", {'q': 'web scraping language:python stars:>500'})
```

```text MCP theme={null}
call_data_api(endpoint="github.search.repositories", params={"q": "web scraping language:python stars:>500"})
```

> [!NOTE]
>
> * Search allows 30 requests a minute authenticated, 10 without a token, and returns at most 1,000 results per query.

### Search issues and pull requests

GET

`/search/issues`

`github.search.issues`

Issues and PRs across GitHub matching keywords and qualifiers (repo:, is:pr, is:open, author:, label:...).

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`q` required</td><td>string</td><td>query</td><td>Keywords and qualifiers; include is:issue or is:pr. Example `repo:python/cpython is:issue is:open label:type-bug`</td></tr>
    <tr><td>`sort`</td><td>string</td><td>query</td><td>Sort field; default best match. One of `comments`, `reactions`, `reactions-+1`, `reactions--1`, `reactions-smile`, `reactions-thinking_face`, `reactions-heart`, `reactions-tada`, `interactions`, `created`, `updated`</td></tr>
    <tr><td>`order`</td><td>string</td><td>query</td><td>desc (default) or asc; only with sort. One of `desc`, `asc`</td></tr>

    <tr>
      <td>
        `advanced_search`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        true to use advanced issue search (AND/OR and parentheses).
      </td>
    </tr>

    <tr>
      <td>
        `per_page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Results per page, at most 100; default 30.
      </td>
    </tr>

    <tr>
      <td>
        `page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page number, from 1.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.github.com/en/rest/search/search#search-issues-and-pull-requests)

```python Python theme={null}
router.call_data_api("github.search.issues", {'q': 'repo:python/cpython is:issue is:open label:type-bug'})
```

```text MCP theme={null}
call_data_api(endpoint="github.search.issues", params={"q": "repo:python/cpython is:issue is:open label:type-bug"})
```

### Get a repository

GET

`/repos/{owner}/{repo}`

`github.repos.get`

Description, stars, forks, open issues, topics, license, default branch and dates.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`owner` required</td><td>string</td><td>path</td><td>Account that owns the repository (not case sensitive). Example `python`</td></tr>
    <tr><td>`repo` required</td><td>string</td><td>path</td><td>Repository name without .git (not case sensitive). Example `cpython`</td></tr>
  </tbody>
</table>

[Vendor docs](https://docs.github.com/en/rest/repos/repos#get-a-repository) · Same job: [Libraries.io](https://docs.webrouter.net/data-apis/libraries-io.md#libraries-io-repositories-get)

```python Python theme={null}
router.call_data_api("github.repos.get", {'owner': 'python', 'repo': 'cpython'})
```

```text MCP theme={null}
call_data_api(endpoint="github.repos.get", params={"owner": "python", "repo": "cpython"})
```

### Get a repository's README

GET

`/repos/{owner}/{repo}/readme`

`github.repos.readme`

The README of the default branch or a given ref.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`owner` required</td><td>string</td><td>path</td><td>Account that owns the repository (not case sensitive). Example `python`</td></tr>
    <tr><td>`repo` required</td><td>string</td><td>path</td><td>Repository name without .git (not case sensitive). Example `cpython`</td></tr>

    <tr>
      <td>
        `ref`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Commit, branch or tag; default the default branch.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.github.com/en/rest/repos/contents#get-a-repository-readme)

```python Python theme={null}
router.call_data_api("github.repos.readme", {'owner': 'python', 'repo': 'cpython'})
```

```text MCP theme={null}
call_data_api(endpoint="github.repos.readme", params={"owner": "python", "repo": "cpython"})
```

### List a repository's issues

GET

`/repos/{owner}/{repo}/issues`

`github.issues.list`

Issues and pull requests in a repository, filtered by state, labels, assignee and date.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`owner` required</td><td>string</td><td>path</td><td>Account that owns the repository (not case sensitive). Example `python`</td></tr>
    <tr><td>`repo` required</td><td>string</td><td>path</td><td>Repository name without .git (not case sensitive). Example `cpython`</td></tr>
    <tr><td>`state`</td><td>string</td><td>query</td><td>Default open. One of `open`, `closed`, `all`</td></tr>

    <tr>
      <td>
        `labels`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Comma-separated label names.
      </td>
    </tr>

    <tr>
      <td>
        `assignee`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        A login, 'none' or '\*'.
      </td>
    </tr>

    <tr>
      <td>
        `creator`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Login of the issue's author.
      </td>
    </tr>

    <tr>
      <td>
        `mentioned`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        A login mentioned in the issue.
      </td>
    </tr>

    <tr>
      <td>
        `milestone`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Milestone number, '\*' or 'none'.
      </td>
    </tr>

    <tr>
      <td>
        `type`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Issue type name, '\*' or 'none'.
      </td>
    </tr>

    <tr><td>`sort`</td><td>string</td><td>query</td><td>Default created. One of `created`, `updated`, `comments`</td></tr>
    <tr><td>`direction`</td><td>string</td><td>query</td><td>Default desc. One of `desc`, `asc`</td></tr>

    <tr>
      <td>
        `since`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Only issues updated after this time, YYYY-MM-DDTHH:MM:SSZ.
      </td>
    </tr>

    <tr>
      <td>
        `per_page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Results per page, at most 100; default 30.
      </td>
    </tr>

    <tr>
      <td>
        `page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page number, from 1.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.github.com/en/rest/issues/issues#list-repository-issues)

```python Python theme={null}
router.call_data_api("github.issues.list", {'owner': 'python', 'repo': 'cpython'})
```

```text MCP theme={null}
call_data_api(endpoint="github.issues.list", params={"owner": "python", "repo": "cpython"})
```

> [!NOTE]
>
> * Pull requests are returned too; they carry a 'pull\_request' key. Filter them out for issues only.

### Get an issue

GET

`/repos/{owner}/{repo}/issues/{issue_number}`

`github.issues.get`

One issue or pull request by number, with body, labels, state and counts.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`owner` required</td><td>string</td><td>path</td><td>Account that owns the repository (not case sensitive). Example `python`</td></tr>
    <tr><td>`repo` required</td><td>string</td><td>path</td><td>Repository name without .git (not case sensitive). Example `cpython`</td></tr>

    <tr>
      <td>
        `issue_number`

        required
      </td>

      <td>
        integer
      </td>

      <td>
        path
      </td>

      <td>
        The issue number.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.github.com/en/rest/issues/issues#get-an-issue)

> [!NOTE]
>
> * 301 means the issue was transferred, 410 that it was deleted.

### List an issue's comments

GET

`/repos/{owner}/{repo}/issues/{issue_number}/comments`

`github.issues.comments`

Comments on an issue or pull request conversation, oldest first.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`owner` required</td><td>string</td><td>path</td><td>Account that owns the repository (not case sensitive). Example `python`</td></tr>
    <tr><td>`repo` required</td><td>string</td><td>path</td><td>Repository name without .git (not case sensitive). Example `cpython`</td></tr>

    <tr>
      <td>
        `issue_number`

        required
      </td>

      <td>
        integer
      </td>

      <td>
        path
      </td>

      <td>
        The issue or PR number.
      </td>
    </tr>

    <tr>
      <td>
        `since`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Only comments updated after this time, YYYY-MM-DDTHH:MM:SSZ.
      </td>
    </tr>

    <tr>
      <td>
        `per_page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Results per page, at most 100; default 30.
      </td>
    </tr>

    <tr>
      <td>
        `page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page number, from 1.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.github.com/en/rest/issues/comments#list-issue-comments)

### Get a pull request

GET

`/repos/{owner}/{repo}/pulls/{pull_number}`

`github.pulls.get`

One PR with title, body, state, merge status, head and base, and diff stats.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`owner` required</td><td>string</td><td>path</td><td>Account that owns the repository (not case sensitive). Example `python`</td></tr>
    <tr><td>`repo` required</td><td>string</td><td>path</td><td>Repository name without .git (not case sensitive). Example `cpython`</td></tr>

    <tr>
      <td>
        `pull_number`

        required
      </td>

      <td>
        integer
      </td>

      <td>
        path
      </td>

      <td>
        The PR number.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.github.com/en/rest/pulls/pulls#get-a-pull-request)

### List a pull request's files

GET

`/repos/{owner}/{repo}/pulls/{pull_number}/files`

`github.pulls.files`

Files a PR changes, with status, additions, deletions and patch.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`owner` required</td><td>string</td><td>path</td><td>Account that owns the repository (not case sensitive). Example `python`</td></tr>
    <tr><td>`repo` required</td><td>string</td><td>path</td><td>Repository name without .git (not case sensitive). Example `cpython`</td></tr>

    <tr>
      <td>
        `pull_number`

        required
      </td>

      <td>
        integer
      </td>

      <td>
        path
      </td>

      <td>
        The PR number.
      </td>
    </tr>

    <tr>
      <td>
        `per_page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Results per page, at most 100; default 30.
      </td>
    </tr>

    <tr>
      <td>
        `page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page number, from 1.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://docs.github.com/en/rest/pulls/pulls#list-pull-requests-files)

> [!NOTE]
>
> * At most 3,000 files in total across pages.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.