Skip to main content

GitHub Users and Repositories API Reference

Base URL: https://api.github.com

All endpoints return JSON. Include the header Accept: application/vnd.github+json in every request.


1. Get a user​

Retrieve public profile information for a GitHub user.

Request​

Method: GET URL: https://api.github.com/users/{username}

Headers​

HeaderValueRequired
Acceptapplication/vnd.github+jsonYes

Path parameters​

ParameterTypeRequiredDescription
usernamestringYesThe handle of the GitHub user (e.g., marvelken).

Example request​

curl -H "Accept: application/vnd.github+json" \
https://api.github.com/users/marvelken

Example response​

Status: 200 OK

{
"login": "marvelken",
"id": 85273989,
"avatar_url": "https://avatars.githubusercontent.com/u/85273989?v=4",
"html_url": "https://github.com/marvelken",
"type": "User",
"name": "Marvel Ken-Anele",
"company": "Marvel ken",
"bio": "Getting Better with this syntax each day.",
"location": null,
"public_repos": 57,
"followers": 1,
"following": 1,
"created_at": "2021-06-03T05:20:39Z",
"updated_at": "2026-04-29T21:11:47Z"
}

Response fields​

FieldTypeDescription
loginstringThe user's GitHub username.
idintegerUnique numeric identifier for the user.
avatar_urlstringURL to the user's profile image.
html_urlstringLink to the user's public GitHub profile page.
typestringAccount type. Usually "User" or "Organization".
namestringThe user's display name (can be null).
companystringCompany listed on the user's profile (can be null).
biostringShort biography from the user's profile (can be null).
locationstringLocation listed on profile (can be null).
public_reposintegerNumber of public repositories.
followersintegerNumber of users following this account.
followingintegerNumber of users this account follows.
created_atstringISO 8601 timestamp of when the account was created.
updated_atstringISO 8601 timestamp of the last profile update.

Error codes​

StatusDescription
200Success. User data returned.
404User not found. The username does not exist.

2. Get a repository​

Retrieve detailed information about a public GitHub repository.

Request​

Method: GET URL: https://api.github.com/repos/{owner}/{repo}

Headers​

HeaderValueRequired
Acceptapplication/vnd.github+jsonYes

Path parameters​

ParameterTypeRequiredDescription
ownerstringYesThe username or organization that owns the repo (e.g., facebook).
repostringYesThe repository name (e.g., react).

Example request​

curl -H "Accept: application/vnd.github+json" \
https://api.github.com/repos/facebook/react

Example response​

Status: 200 OK

{
"id": 10270250,
"name": "react",
"full_name": "facebook/react",
"html_url": "https://github.com/facebook/react",
"description": "The library for web and native user interfaces.",
"fork": false,
"homepage": "https://react.dev",
"language": "JavaScript",
"stargazers_count": 245043,
"watchers_count": 245043,
"forks_count": 51045,
"open_issues_count": 1301,
"default_branch": "main",
"license": { "key": "mit", "name": "MIT License", "spdx_id": "MIT" },
"topics": ["declarative", "frontend", "javascript", "library", "react", "ui"],
"created_at": "2013-05-24T16:15:54Z",
"updated_at": "2026-05-15T18:45:19Z"
}

Response fields​

FieldTypeDescription
idintegerUnique numeric identifier for the repository.
namestringRepository name.
full_namestringFull slug in owner/repo format.
html_urlstringLink to the repository on github.com.
descriptionstringShort description of the repository (can be null).
forkbooleanWhether this repo is a fork of another.
homepagestringProject homepage URL (can be null).
languagestringPrimary programming language (can be null).
stargazers_countintegerNumber of stars.
watchers_countintegerNumber of watchers.
forks_countintegerNumber of forks.
open_issues_countintegerNumber of open issues and pull requests combined.
default_branchstringName of the default branch (usually main or master).
licenseobjectLicense information. Contains spdx_id and name.
topicsarrayList of topic tags applied to the repository.
created_atstringISO 8601 timestamp of repository creation.
updated_atstringISO 8601 timestamp of the last push or update.

Error codes​

StatusDescription
200Success. Repository data returned.
404Repository not found. Either the owner or repo name is incorrect, or the repo is private.

3. List repository issues​

Retrieve a list of issues for a given repository. Returns open issues by default. Supports filtering and pagination through query parameters.

Request​

Method: GET URL: https://api.github.com/repos/{owner}/{repo}/issues

Headers​

HeaderValueRequired
Acceptapplication/vnd.github+jsonYes

Path parameters​

ParameterTypeRequiredDescription
ownerstringYesThe username or organization that owns the repo.
repostringYesThe repository name.

Query parameters​

ParameterTypeRequiredDefaultDescription
statestringNoopenFilter by issue state. Options: open, closed, all.
labelsstringNo—Comma-separated list of label names to filter by.
sortstringNocreatedSort results by: created, updated, comments.
directionstringNodescSort direction: asc or desc.
per_pageintegerNo30Number of results per page (max 100).
pageintegerNo1Page number for pagination.

Example request​

curl -H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/facebook/react/issues?state=open&per_page=3"

Example response​

Status: 200 OK

[
{
"id": 4450231280,
"number": 36477,
"title": "[react-compiler] Fix GeneratedSource Symbol leaking...",
"state": "open",
"html_url": "https://github.com/facebook/react/pull/36477",
"user": { "login": "MD-Mushfiqur123", "id": 206438734 },
"labels": [{ "name": "CLA Signed", "color": "e7e7e7" }],
"created_at": "2026-05-15T00:10:46Z",
"updated_at": "2026-05-15T00:10:52Z",
"comments": 0
}
]

Response fields (per issue object)​

FieldTypeDescription
idintegerUnique numeric identifier for the issue.
numberintegerIssue number within the repository.
titlestringTitle of the issue.
statestringCurrent state: open or closed.
html_urlstringLink to the issue on github.com.
userobjectAuthor of the issue. Contains login and id.
labelsarrayList of labels applied. Each label has name and color.
created_atstringISO 8601 timestamp of when the issue was opened.
updated_atstringISO 8601 timestamp of the last update.
commentsintegerNumber of comments on the issue.

Error codes​

StatusDescription
200Success. Array of issue objects returned.
404Repository not found. Either the owner or repo name is incorrect.
422Invalid query parameter value (e.g., state=banana instead of open/closed/all).

Authentication note​

All three endpoints above work without authentication for public data. However, unauthenticated requests are rate-limited to 60 requests per hour. To increase this to 5,000 requests per hour, include a personal access token:

curl -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer YOUR_TOKEN" \
https://api.github.com/users/marvelken

Generate a token at github.com/settings/tokens.