Overview
Make use of GitHub repositories, code and user info programmatically
GitHub is a development API from github.com. Requests are authenticated with OAuth. It is served over HTTPS and allows browser requests (CORS). Its OpenAPI description documents 1043 endpoints.
At a glance
- Authentication
- OAuth
- HTTPS
- Yes
- CORS
- Yes
- Category
- Development
- Base URL
https://api.github.com- Version
- 1.1.4
- Endpoints
- 1043
- OpenAPI
- Specification ↗
- Spec updated
- 2023-02-15
Make a first request
Replace the placeholders; the documentation says exactly where credentials go.
curl -X GET "https://api.github.com/" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://api.github.com/", {
method: "GET",
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
const data = await response.json();
console.log(data);import requests
response = requests.request(
"GET",
"https://api.github.com/",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
timeout=30,
)
print(response.json())Endpoints
| Method | Path | What it does |
|---|---|---|
| GET | / | GitHub API Root |
| GET | /app | Get the authenticated app |
| POST | /app-manifests/{code}/conversions | Create a GitHub App from a manifest |
| GET | /app/hook/config | Get a webhook configuration for an app |
| PATCH | /app/hook/config | Update a webhook configuration for an app |
| GET | /app/hook/deliveries | List deliveries for an app webhook |
| GET | /app/hook/deliveries/{delivery_id} | Get a delivery for an app webhook |
| POST | /app/hook/deliveries/{delivery_id}/attempts | Redeliver a delivery for an app webhook |
| GET | /app/installations | List installations for the authenticated app |
| GET | /app/installations/{installation_id} | Get an installation for the authenticated app |
| DELETE | /app/installations/{installation_id} | Delete an installation for the authenticated app |
| POST | /app/installations/{installation_id}/access_tokens | Create an installation access token for an app |
| PUT | /app/installations/{installation_id}/suspended | Suspend an app installation |
| DELETE | /app/installations/{installation_id}/suspended | Unsuspend an app installation |
| DELETE | /applications/{client_id}/grant | Delete an app authorization |
| POST | /applications/{client_id}/token | Check a token |
| PATCH | /applications/{client_id}/token | Reset a token |
| DELETE | /applications/{client_id}/token | Delete an app token |
| POST | /applications/{client_id}/token/scoped | Create a scoped access token |
| GET | /apps/{app_slug} | Get an app |
| GET | /codes_of_conduct | Get all codes of conduct |
| GET | /codes_of_conduct/{key} | Get a code of conduct |
| GET | /emojis | Get emojis |
| GET | /enterprises/{enterprise}/dependabot/alerts | List Dependabot alerts for an enterprise |
| GET | /enterprises/{enterprise}/secret-scanning/alerts | List secret scanning alerts for an enterprise |
| GET | /events | List public events |
| GET | /feeds | Get feeds |
| GET | /gists | List gists for the authenticated user |
| POST | /gists | Create a gist |
| GET | /gists/public | List public gists |
| GET | /gists/starred | List starred gists |
| GET | /gists/{gist_id} | Get a gist |
| PATCH | /gists/{gist_id} | Update a gist |
| DELETE | /gists/{gist_id} | Delete a gist |
| GET | /gists/{gist_id}/comments | List gist comments |
| POST | /gists/{gist_id}/comments | Create a gist comment |
| GET | /gists/{gist_id}/comments/{comment_id} | Get a gist comment |
| PATCH | /gists/{gist_id}/comments/{comment_id} | Update a gist comment |
| DELETE | /gists/{gist_id}/comments/{comment_id} | Delete a gist comment |
| GET | /gists/{gist_id}/commits | List gist commits |
| GET | /gists/{gist_id}/forks | List gist forks |
| POST | /gists/{gist_id}/forks | Fork a gist |
| GET | /gists/{gist_id}/star | Check if a gist is starred |
| PUT | /gists/{gist_id}/star | Star a gist |
| DELETE | /gists/{gist_id}/star | Unstar a gist |
| GET | /gists/{gist_id}/{sha} | Get a gist revision |
| GET | /gitignore/templates | Get all gitignore templates |
| GET | /gitignore/templates/{name} | Get a gitignore template |
| GET | /installation/repositories | List repositories accessible to the app installation |
| DELETE | /installation/token | Revoke an installation access token |
| GET | /issues | List issues assigned to the authenticated user |
| GET | /licenses | Get all commonly used licenses |
| GET | /licenses/{license} | Get a license |
| POST | /markdown | Render a Markdown document |
| POST | /markdown/raw | Render a Markdown document in raw mode |
| GET | /marketplace_listing/accounts/{account_id} | Get a subscription plan for an account |
| GET | /marketplace_listing/plans | List plans |
| GET | /marketplace_listing/plans/{plan_id}/accounts | List accounts for a plan |
| GET | /marketplace_listing/stubbed/accounts/{account_id} | Get a subscription plan for an account (stubbed) |
| GET | /marketplace_listing/stubbed/plans | List plans (stubbed) |
| GET | /marketplace_listing/stubbed/plans/{plan_id}/accounts | List accounts for a plan (stubbed) |
| GET | /meta | Get GitHub meta information |
| GET | /networks/{owner}/{repo}/events | List public events for a network of repositories |
| GET | /notifications | List notifications for the authenticated user |
| PUT | /notifications | Mark notifications as read |
| GET | /notifications/threads/{thread_id} | Get a thread |
| PATCH | /notifications/threads/{thread_id} | Mark a thread as read |
| GET | /notifications/threads/{thread_id}/subscription | Get a thread subscription for the authenticated user |
| PUT | /notifications/threads/{thread_id}/subscription | Set a thread subscription |
| DELETE | /notifications/threads/{thread_id}/subscription | Delete a thread subscription |
| GET | /octocat | Get Octocat |
| GET | /organizations | List organizations |
| GET | /orgs/{org} | Get an organization |
| PATCH | /orgs/{org} | Update an organization |
| GET | /orgs/{org}/actions/cache/usage | Get GitHub Actions cache usage for an organization |
| GET | /orgs/{org}/actions/cache/usage-by-repository | List repositories with GitHub Actions cache usage for an organization |
| GET | /orgs/{org}/actions/oidc/customization/sub | Get the customization template for an OIDC subject claim for an organization |
| PUT | /orgs/{org}/actions/oidc/customization/sub | Set the customization template for an OIDC subject claim for an organization |
| GET | /orgs/{org}/actions/permissions | Get GitHub Actions permissions for an organization |
| PUT | /orgs/{org}/actions/permissions | Set GitHub Actions permissions for an organization |
| GET | /orgs/{org}/actions/permissions/repositories | List selected repositories enabled for GitHub Actions in an organization |
| PUT | /orgs/{org}/actions/permissions/repositories | Set selected repositories enabled for GitHub Actions in an organization |
| PUT | /orgs/{org}/actions/permissions/repositories/{repository_id} | Enable a selected repository for GitHub Actions in an organization |
| DELETE | /orgs/{org}/actions/permissions/repositories/{repository_id} | Disable a selected repository for GitHub Actions in an organization |
| GET | /orgs/{org}/actions/permissions/selected-actions | Get allowed actions and reusable workflows for an organization |
| PUT | /orgs/{org}/actions/permissions/selected-actions | Set allowed actions and reusable workflows for an organization |
| GET | /orgs/{org}/actions/permissions/workflow | Get default workflow permissions for an organization |
| PUT | /orgs/{org}/actions/permissions/workflow | Set default workflow permissions for an organization |
| GET | /orgs/{org}/actions/required_workflows | List required workflows |
| POST | /orgs/{org}/actions/required_workflows | Create a required workflow |
| GET | /orgs/{org}/actions/required_workflows/{required_workflow_id} | Get a required workflow |
| PATCH | /orgs/{org}/actions/required_workflows/{required_workflow_id} | Update a required workflow |
| DELETE | /orgs/{org}/actions/required_workflows/{required_workflow_id} | Delete a required workflow |
| GET | /orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories | List selected repositories for a required workflow |
| PUT | /orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories | Sets repositories for a required workflow |
| PUT | /orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories/{repository_id} | Add a repository to a required workflow |
| DELETE | /orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories/{repository_id} | Remove a selected repository from required workflow |
| GET | /orgs/{org}/actions/runners | List self-hosted runners for an organization |
| GET | /orgs/{org}/actions/runners/downloads | List runner applications for an organization |
| POST | /orgs/{org}/actions/runners/registration-token | Create a registration token for an organization |
Showing the first 100 of 1043 endpoints; the full list is in the documentation.
Questions
Does the GitHub API need an API key?
Yes. The GitHub API uses OAuth authentication; the documentation explains how to get credentials.
Can I call the GitHub API from the browser?
Yes. The GitHub API sends CORS headers, so a web page can call it directly with fetch().
Does the GitHub API support HTTPS?
Yes, the GitHub API is served over HTTPS.
How many endpoints does the GitHub API have?
Its OpenAPI description lists 1043 endpoints in version 1.1.4. The first 100 are shown on this page.
What are alternatives to the GitHub API?
Other Development APIs include Cloudflare, Azure DevOps, IPify, App Store Connect API, StackExchange.
Similar development APIs
Compare alternatives →Cloudflare
DevelopmentManage DNS, CDN, Workers and other services; documented with an official OpenAPI 3.0 spec
Azure DevOps
DevelopmentThe Azure DevOps basic components of a REST API request/response pair
IPify
DevelopmentA simple IP Address API
App Store Connect API
DevelopmentThe data structure that represents an app store connect api resource.
StackExchange
DevelopmentQ&A forum for developers
IPinfo
DevelopmentAnother simple IP Address API
Listed from public-apis (MIT), public-apis database (MIT), APIs.guru (CC0).