GitHub API

⭐ Beginner's Pick Development / OAuth Intermediate HTTPS CORS
60 requests/hour (unauthenticated), 5,000 requests/hour (authenticated), 15,000 requests/hour (Enterprise Cloud)

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.

Available Data

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

Example Response

JSON Response
{
  "full_name": "octocat/Hello-World",
  "description": "My first repository on GitHub!",
  "stargazers_count": 1500,
  "forks_count": 320,
  "language": "JavaScript",
  "open_issues_count": 12,
  "created_at": "2011-01-26T19:01:12Z"
}

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.
stargazers_count Total number of users who have starred the repository.
forks_count Number of times this repository has been forked.
language Primary programming language detected in the repository.
open_issues_count Total number of open issues and pull requests combined.

Implementation Example

// 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.

Common Errors & Troubleshooting

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.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 5/20
🔒 Security 15/15
🛠 Developer XP 8/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth OAuth
HTTPS REQUIRED
CORS YES
Category Development
Difficulty Intermediate
Verified: 2026-04-07

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 →