GitHub Repositories API
List a user's repos with sort/direction/type — opaque Link cursor (~0.4/repo).
GET request to /v1/github/repositories that responds with clean JSON and costs ~12 credits (0.4/result). Pass cache=true for a free 24h cache hit; default is always fresh. Start with 100 free credits — no credit card.What is the GitHub Repositories API?
List repositories from GitHub REST /users/{login}/repos. Pass sort=created|updated|pushed|full_name (default updated), direction=asc|desc, and type=owner|member|all — all echoed at the top level. Each row is the same camelCase repo card as github/repository minus watchers and parent (list payloads omit subscribers_count and parent — call github/repository for those). Opaque nextCursor from GitHub's Link header. ~0.4 credits/repo (default limit 30 → ~12). Pricing vs detail: single-repo lookup is flat 1 credit; this list is per-result for bulk. Trending is a separate HTML scrape at flat 2.
What you get
- Bulk list of repositories with metadata
- Dates, URLs, and engagement fields when available
- Configurable result limit
- Ideal for monitoring and content pipelines
Try it
Fill in the parameters below and copy a ready-to-run request, or open the live Playground to run it against your account (no API key paste).
Parameters
curl "https://api.captapi.com/v1/github/repositories?username=torvalds" \
-H "Authorization: Bearer capt_live_..."
# or: -H "x-api-key: capt_live_..."Edit the parameters and the code updates instantly. Switch languages and hit copy.
Example response
{
"success": true,
"data": {
"username": "torvalds",
"sort": "pushed",
"direction": "desc",
"type": "owner",
"totalReturned": 2,
"nextCursor": "eyJ2IjoxLCJrIjoicmVwb3MiLCJwIjoyfQ",
"hasMore": true,
"repositories": [
{
"platform": "github",
"type": "repository",
"name": "linux",
"fullName": "torvalds/linux",
"url": "https://github.com/torvalds/linux",
"description": "Linux kernel source tree",
"owner": "torvalds",
"ownerUrl": "https://github.com/torvalds",
"ownerType": "User",
"ownerAvatar": "https://avatars.githubusercontent.com/u/1024025?v=4",
"language": "C",
"stars": 239734,
"forks": 63487,
"openIssuesAndPrs": 3,
"defaultBranch": "master",
"licenseName": "Other",
"isFork": false,
"isArchived": false,
"pushedAt": "2026-07-18T04:53:39Z",
"createdAt": "2011-09-04T22:48:12Z",
"updatedAt": "2026-07-18T18:40:38Z"
},
{
"platform": "github",
"type": "repository",
"name": "libgit2",
"fullName": "torvalds/libgit2",
"url": "https://github.com/torvalds/libgit2",
"description": "A cross-platform, linkable library implementation of Git.",
"owner": "torvalds",
"ownerUrl": "https://github.com/torvalds",
"ownerType": "User",
"ownerAvatar": "https://avatars.githubusercontent.com/u/1024025?v=4",
"language": "C",
"stars": 370,
"forks": 28,
"openIssuesAndPrs": 1,
"defaultBranch": "main",
"homepage": "https://libgit2.org/",
"licenseName": "Other",
"isFork": true,
"isArchived": false,
"pushedAt": "2023-12-19T11:45:42Z",
"createdAt": "2022-07-30T03:30:56Z",
"updatedAt": "2026-07-18T17:03:41Z"
}
]
}
}Billing metadata is returned in response headers: X-Captapi-Credits (credits charged), X-Captapi-Cache (hit or miss), and X-Captapi-Source. Failed requests (4xx/5xx) are never charged. See the full list of error codes in the error reference.
Response structure
A successful call returns success, cached, creditsUsed, and a data object with the following fields:
Top-level fields
usernameAccount username / handle.sortEcho of sort=created|updated|pushed|full_name (default updated).directionEcho of direction=asc|desc (default desc).typeTop-level: affiliation filter owner|member|all. On each repo row: always "repository".totalReturnedNumber of items returned in this response.nextCursorOpaque Link-header cursor (not a bare page number).hasMoreWhether more results are available beyond this page. When true, pass nextCursor to fetch the next page.
Repositories
Each item in repositories contains:
platformPlatform identifier for this response (matches the endpoint's platform).typeTop-level: affiliation filter owner|member|all. On each repo row: always "repository".nameName of the item or account. On profile endpoints: deprecated alias of displayName (one release).fullNameFull display name.urlCanonical URL of the item.descriptionDescription text.ownerOwner of the repository.ownerUrlOwner url URL.ownerTypeOwner type. Example: "User".ownerAvatarOwner avatar URL.languagePrimary programming language (e.g. "C", "Python") — not a spoken-language code.starsStar count.forksFork count.openIssuesAndPrsGitHub open_issues_count — open issues plus open pull requests.defaultBranchDefault branch name.licenseNameHuman-readable license label from GitHub.isForkWhether the repository is a fork.isArchivedWhether the repository is archived.pushedAtLast push date (ISO 8601).createdAtCreation date (ISO 8601).updatedAtLast update date (ISO 8601).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| username | string | Yes | GitHub username or profile URL, e.g. torvalds. |
| sort | string | No | created | updated | pushed | full_name (default updated). Not stars — GitHub's user-repos API has no stars sort. Echoed as data.sort. |
| direction | string | No | asc or desc (default desc). Echoed as data.direction. |
| type | string | No | owner (default) | member | all — affiliation filter. Echoed as data.type. |
| limit | integer | No | Max items to return (default 30, max 100). Billed per result. |
| cursor | string | No | Opaque cursor from a previous nextCursor (GitHub Link page=). Not a bare page number. |
| cache | boolean | No | Set true to serve from the 24h response cache (0 credits on hit). Default false — always fetch fresh. Envelope includes cached + cachedAt on hits. |
Authentication: send your key as Authorization: Bearer capt_live_.... A typical call costs ~12 credits (0.4/result) — billed per result, so the exact amount scales with how many items you request. Pass cache=true for a free 24h cache hit; default is always fresh (metrics refresh within ~1 hour).
How it works
- 1. Sign up — get 100 free credits, no card required.
- 2. Create a key from your dashboard.
- 3. Send one request to
/v1/github/repositoriesand parse the JSON response.
Use cases
Recent activity
sort=pushed to list a developer's most recently pushed repos.
Owned vs member
type=owner|member|all to separate personal repos from org memberships.
Fork parent lookup
When isFork is true, call github/repository for parent — list payloads omit it.
Frequently asked questions
What does the GitHub Repositories API do?+
The GitHub Repositories API lets you list items in bulk with metadata from a public GitHub GitHub resource using one GET request to /v1/github/repositories. It returns clean JSON — no OAuth or infrastructure setup required.
How many credits does the GitHub Repositories API cost?+
At the default limit this endpoint costs 12 credits (0.4 per result). Billing scales with how many results you request. Pass cache=true to serve from the 24h cache (0 credits on hit); default is always fresh. Hits include cached + cachedAt. Selected profile endpoints also accept cacheMaxAge=1d|3d|7d|14d|30d. Failed or empty results are never charged.
Do I need a GitHub API key or OAuth?+
No. A single Captapi key works across every platform Captapi supports — YouTube, TikTok, Instagram, Facebook, Twitter/X, Reddit, Threads, Bluesky, Pinterest, LinkedIn, Rumble, Spotify, Kwai, and more. We handle proxies, rate limits, retries, and authentication for you.
Can I sort by stars?+
No — GitHub's /users/{u}/repos only supports sort=created|updated|pushed|full_name. Use sort=pushed for recently active repos. For star ranking, call api.github.com search (user:LOGIN sort:stars) or github/repository per repo.
Why is parent missing on forks?+
GitHub's list payload omits parent. isFork is still true. Call github/repository on the fork for parent (upstream fullName).
Is the GitHub Repositories API suitable for production use?+
Yes. It is a stable REST endpoint with predictable JSON and automatic retries. Pass cache=true to serve from the 24h cache (0 credits on hit); default is always fresh. Hits include cached + cachedAt. Selected profile endpoints also accept cacheMaxAge=1d|3d|7d|14d|30d. Use it for analytics, monitoring, and content automation.
More GitHub APIs
Ready to use the GitHub Repositories API?
Sign up, grab your key, and make your first call in 60 seconds.