Skip to content

GitHub API

by github.com

OAuthHTTPSCORSDevelopment
Open documentation ↗

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
Spec updated
2023-02-15

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://api.github.com/" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"
JavaScript
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);
Python
import requests

response = requests.request(
    "GET",
    "https://api.github.com/",
    headers={
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/GitHub API Root
GET/appGet the authenticated app
POST/app-manifests/{code}/conversionsCreate a GitHub App from a manifest
GET/app/hook/configGet a webhook configuration for an app
PATCH/app/hook/configUpdate a webhook configuration for an app
GET/app/hook/deliveriesList deliveries for an app webhook
GET/app/hook/deliveries/{delivery_id}Get a delivery for an app webhook
POST/app/hook/deliveries/{delivery_id}/attemptsRedeliver a delivery for an app webhook
GET/app/installationsList 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_tokensCreate an installation access token for an app
PUT/app/installations/{installation_id}/suspendedSuspend an app installation
DELETE/app/installations/{installation_id}/suspendedUnsuspend an app installation
DELETE/applications/{client_id}/grantDelete an app authorization
POST/applications/{client_id}/tokenCheck a token
PATCH/applications/{client_id}/tokenReset a token
DELETE/applications/{client_id}/tokenDelete an app token
POST/applications/{client_id}/token/scopedCreate a scoped access token
GET/apps/{app_slug}Get an app
GET/codes_of_conductGet all codes of conduct
GET/codes_of_conduct/{key}Get a code of conduct
GET/emojisGet emojis
GET/enterprises/{enterprise}/dependabot/alertsList Dependabot alerts for an enterprise
GET/enterprises/{enterprise}/secret-scanning/alertsList secret scanning alerts for an enterprise
GET/eventsList public events
GET/feedsGet feeds
GET/gistsList gists for the authenticated user
POST/gistsCreate a gist
GET/gists/publicList public gists
GET/gists/starredList 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}/commentsList gist comments
POST/gists/{gist_id}/commentsCreate 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}/commitsList gist commits
GET/gists/{gist_id}/forksList gist forks
POST/gists/{gist_id}/forksFork a gist
GET/gists/{gist_id}/starCheck if a gist is starred
PUT/gists/{gist_id}/starStar a gist
DELETE/gists/{gist_id}/starUnstar a gist
GET/gists/{gist_id}/{sha}Get a gist revision
GET/gitignore/templatesGet all gitignore templates
GET/gitignore/templates/{name}Get a gitignore template
GET/installation/repositoriesList repositories accessible to the app installation
DELETE/installation/tokenRevoke an installation access token
GET/issuesList issues assigned to the authenticated user
GET/licensesGet all commonly used licenses
GET/licenses/{license}Get a license
POST/markdownRender a Markdown document
POST/markdown/rawRender a Markdown document in raw mode
GET/marketplace_listing/accounts/{account_id}Get a subscription plan for an account
GET/marketplace_listing/plansList plans
GET/marketplace_listing/plans/{plan_id}/accountsList accounts for a plan
GET/marketplace_listing/stubbed/accounts/{account_id}Get a subscription plan for an account (stubbed)
GET/marketplace_listing/stubbed/plansList plans (stubbed)
GET/marketplace_listing/stubbed/plans/{plan_id}/accountsList accounts for a plan (stubbed)
GET/metaGet GitHub meta information
GET/networks/{owner}/{repo}/eventsList public events for a network of repositories
GET/notificationsList notifications for the authenticated user
PUT/notificationsMark 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}/subscriptionGet a thread subscription for the authenticated user
PUT/notifications/threads/{thread_id}/subscriptionSet a thread subscription
DELETE/notifications/threads/{thread_id}/subscriptionDelete a thread subscription
GET/octocatGet Octocat
GET/organizationsList organizations
GET/orgs/{org}Get an organization
PATCH/orgs/{org}Update an organization
GET/orgs/{org}/actions/cache/usageGet GitHub Actions cache usage for an organization
GET/orgs/{org}/actions/cache/usage-by-repositoryList repositories with GitHub Actions cache usage for an organization
GET/orgs/{org}/actions/oidc/customization/subGet the customization template for an OIDC subject claim for an organization
PUT/orgs/{org}/actions/oidc/customization/subSet the customization template for an OIDC subject claim for an organization
GET/orgs/{org}/actions/permissionsGet GitHub Actions permissions for an organization
PUT/orgs/{org}/actions/permissionsSet GitHub Actions permissions for an organization
GET/orgs/{org}/actions/permissions/repositoriesList selected repositories enabled for GitHub Actions in an organization
PUT/orgs/{org}/actions/permissions/repositoriesSet 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-actionsGet allowed actions and reusable workflows for an organization
PUT/orgs/{org}/actions/permissions/selected-actionsSet allowed actions and reusable workflows for an organization
GET/orgs/{org}/actions/permissions/workflowGet default workflow permissions for an organization
PUT/orgs/{org}/actions/permissions/workflowSet default workflow permissions for an organization
GET/orgs/{org}/actions/required_workflowsList required workflows
POST/orgs/{org}/actions/required_workflowsCreate 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}/repositoriesList selected repositories for a required workflow
PUT/orgs/{org}/actions/required_workflows/{required_workflow_id}/repositoriesSets 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/runnersList self-hosted runners for an organization
GET/orgs/{org}/actions/runners/downloadsList runner applications for an organization
POST/orgs/{org}/actions/runners/registration-tokenCreate 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.

Compare alternatives →

Listed from public-apis (MIT), public-apis database (MIT), APIs.guru (CC0).