GitHub API

Beginner's Pick Development / OAuth Intermediate HTTPS CORS
60 per window (55 remaining at test time)
94 A+
Measured Score 0 50 100 Speed 24/30 Consistency 20/20 Security 20/20 Browser access 15/15 Transparency 15/15 TESTED 2026-08-10

Overview

The GitHub REST API gives you programmatic access to nearly everything on GitHub — repositories, issues, pull requests, commits, users, organizations, GitHub Actions, and more. Unauthenticated requests are allowed for public data but are limited to 60 requests per hour; authenticating with a personal access token raises the limit to 5,000 per hour. It is one of the most widely documented and used APIs in the developer ecosystem.

Beginner Tip

Start with public endpoints that require no auth — like fetching repo info or listing releases. When you need more data or hit rate limits, create a Personal Access Token (PAT) at github.com > Settings > Developer settings > Personal access tokens. Pass it as Authorization: Bearer <token>. The API base URL is https://api.github.com.

Measurement Record

What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.

Request
GET https://api.github.com/repos/torvalds/linux
Result
HTTP 200 · application/json · 5,487 bytes · compressed
Response time
45 ms (median of 3) · fastest 44 ms
Transport
TLSv1.3 · TLS_AES_128_GCM_SHA256 · certificate issued by Sectigo Limited
Browser CORS
Allowed — Access-Control-Allow-Origin: *
Rate limit
60 per window (55 remaining at test time)
Served by
github.com
Recorded
2026-08-10

Available Data

The kind of data this API exposes, based on its documentation. We could not call the endpoint to confirm the exact field names.

Repository
Stars
Forks
star and fork counts
contributor data
issues and pull requests

Captured Response

Captured from a real request to https://api.github.com/repos/torvalds/linux on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.

JSON Response · Captured
{
  "id": 2325298,
  "node_id": "MDEwOlJlcG9zaXRvcnkyMzI1Mjk4",
  "name": "linux",
  "full_name": "torvalds/linux",
  "private": false,
  "owner": {
    "login": "torvalds",
    "id": 1024025,
    "node_id": "MDQ6VXNlcjEwMjQwMjU=",
    "avatar_url": "https://avatars.githubusercontent.com/u/1024025?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/torvalds",
    "html_url": "https://github.com/torvalds",
    "followers_url": "https://api.github.com/users/torvalds/followers",
    "following_url": "https://api.github.com/users/torvalds/following{/other_user}",
    "gists_url": "https://api.github.com/users/torvalds/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/torvalds/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/torvalds/subscriptions",
    "organizations_url": "https://api.github.com/users/torvalds/orgs",
    "repos_url": "https://api.github.com/users/torvalds/repos",
    "…": "(5 more fields)"
  },
  "html_url": "https://github.com/torvalds/linux",
  "description": "Linux kernel source tree",
  "fork": false,
  "url": "https://api.github.com/repos/torvalds/linux",
  "forks_url": "https://api.github.com/repos/torvalds/linux/forks",
  "keys_url": "https://api.github.com/repos/torvalds/linux/keys{/key_id}",
  "collaborators_url": "https://api.github.com/repos/torvalds/linux/collaborators{/collaborator}",
 
…

Field Reference

full_name Owner and repository name in "owner/repo" format, e.g., "torvalds/linux".
description Short description of the repository as set by the owner.

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
// Get repository information
const url = "https://api.github.com/repos/github/docs";

const response = await fetch(url, {
  headers: {
    "Accept": "application/vnd.github+json",
    "Authorization": "Bearer YOUR_PERSONAL_ACCESS_TOKEN"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();

console.log(`Repository: ${data.full_name}`);
console.log(`Stars: ${data.stargazers_count}`);
console.log(`Forks: ${data.forks_count}`);
console.log(`Description: ${data.description}`);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

How This API Fails

We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.

HTTP 404 Requesting a path that does not exist application/json
{
  "message": "Not Found",
  "documentation_url": "https://docs.github.com/rest",
  "status": "404"
}

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

403 Forbidden with rate limit message The 60 requests/hour unauthenticated limit has been exceeded
Add Authorization: Bearer <your-pat> to your requests to raise the limit to 5,000/hour — create a token at github.com > Settings > Developer settings.
404 Not Found for a known repo The repository is private and your token does not have repo scope, or the owner/repo path is misspelled
Check the capitalization of owner and repo name, and ensure your PAT has repo scope for private repositories.
Pagination stops early GitHub paginates results at 30 items by default and requires Link header navigation for subsequent pages
Add ?per_page=100 to your request and follow the next URL from the Link response header until it is absent.

Measured Score Breakdown

Live HTTP request to the API endpoint

Speed 24/30
Consistency 20/20
Security 20/20
Browser access 15/15
Transparency 15/15
Endpoint Response Time 45ms

Fully tested on Aug 10, 2026

Technical Specifications

Auth OAuth
HTTPS REQUIRED
CORS YES
Category Development
Difficulty Intermediate
Endpoint last called: 2026-08-10

Alternatives to GitHub

Technical alternatives for different use cases.

Atlassian ecosystem integration with Jira and Confluence

Better For

Teams already using Jira and Atlassian tools

Trade-off

Public repository hosting and community features

Full DevOps platform with built-in CI/CD

Better For

Integrated CI/CD pipelines without third-party tools

Trade-off

Open-source community size and discoverability

Recipes Using GitHub

Build something with this API. Each recipe includes step-by-step instructions and code outlines.

Similar APIs

View All →