GitHub
GET /v1/github/repository

GitHub Repository API

GitHub repo — stars, real watchers (subscribers), openIssuesAndPrs, license, parent when fork (1 credit).

1 credit per request
TL;DR
GitHub repo — stars, real watchers (subscribers), openIssuesAndPrs, license, parent when fork (1 credit). The GitHub Repository API (GitHub) is a single authenticated GET request to /v1/github/repository that responds with clean JSON and costs 1 credit. 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 Repository API?

Pass a repository URL or owner/name and get GitHub REST /repos/{owner}/{repo} as camelCase JSON: description, stars, forks, watchers (subscribers_count — people notified of activity; not the legacy watchers_count star alias), openIssuesAndPrs (GitHub's open_issues_count = open issues + open PRs), primary programming language, license (SPDX; NOASSERTION → null with licenseName kept), topics, parent when isFork, size, visibility, hasIssues/hasDiscussions, ownerType (User|Organization), and timestamps. Flat 1 credit. For the curated trending page (stars gained today/this week/month), use github/trending-repositories.

What you get

  • Repository fields as clean structured JSON
  • IDs, URLs, and titles where the platform exposes them
  • Engagement or popularity signals when available
  • Stable IDs for joining with other endpoints

Try it

Open in Playground

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

Sign in to run live
curl "https://api.captapi.com/v1/github/repository?repo=torvalds%2Flinux" \
  -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": {
    "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": 241852,
    "forks": 63487,
    "watchers": 8345,
    "openIssuesAndPrs": 3,
    "defaultBranch": "master",
    "licenseName": "Other",
    "isFork": false,
    "isArchived": false,
    "size": 6228144,
    "visibility": "public",
    "hasIssues": false,
    "hasDiscussions": false,
    "pushedAt": "2026-07-18T04:53:39Z",
    "createdAt": "2011-09-04T22:48:12Z",
    "updatedAt": "2026-07-18T18:40:38Z"
  }
}

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

  • platformAlways "github" on this endpoint.
  • typeAlways "repository" on each repo object.
  • 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 account kind: "User" or "Organization".
  • ownerAvatarOwner avatar URL.
  • languagePrimary programming language (e.g. "C", "Python") — not a spoken-language code.
  • starsstargazers_count — total stars.
  • forksFork count.
  • watcherssubscribers_count — people watching for notifications. Omitted on list payloads that lack the field. Never GitHub's legacy watchers_count (that equals stars).
  • openIssuesAndPrsGitHub open_issues_count — open issues plus open pull requests. Use github/pull-requests for PRs alone.
  • defaultBranchDefault branch name.
  • licenseNameHuman-readable license label from GitHub (e.g. Other, MIT License).
  • isForkWhether the repository is a fork.
  • isArchivedWhether the repository is archived.
  • sizeRepository size in kilobytes (GitHub's size field).
  • visibilityRepository visibility (usually "public" on this surface).
  • hasIssuesWhether the issues feature is enabled on the repo.
  • hasDiscussionsWhether GitHub Discussions is enabled.
  • pushedAtLast push date (ISO 8601).
  • createdAtCreation date (ISO 8601).
  • updatedAtLast update date (ISO 8601).

Parameters

NameTypeRequiredDescription
repostringYesRepository URL or owner/name, e.g. torvalds/linux or https://github.com/torvalds/linux.
cachebooleanNoSet 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 1 credit. Pass cache=true for a free 24h cache hit; default is always fresh.

Using an AI agent? This endpoint is the MCP tool github_repository via @captapi/mcp. Set it up →

How it works

  1. 1. Sign up — get 100 free credits, no card required.
  2. 2. Create a key from your dashboard.
  3. 3. Send one request to /v1/github/repository and parse the JSON response.

Use cases

Repo enrichment

Resolve owner/name to stars, real watchers (subscribers), license, and parent when forked.

Issue vs PR load

Read openIssuesAndPrs (issues+PRs); use github/pull-requests when you need PRs alone.

License hygiene

Prefer license (SPDX); when null, check licenseName — NOASSERTION is not passed through.

Frequently asked questions

What does the GitHub Repository API do?+

The GitHub Repository API lets you fetch full metadata and key stats from a public GitHub GitHub resource using one GET request to /v1/github/repository. It returns clean JSON — no OAuth or infrastructure setup required.

How many credits does the GitHub Repository API cost?+

Each successful call costs 1 credit. 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.

Is watchers the same as stars?+

No. watchers is GitHub's subscribers_count (notification watchers). GitHub's REST watchers_count field is a deprecated alias of stargazers and is never returned here.

Why is openIssuesAndPrs not just open issues?+

GitHub's open_issues_count includes open pull requests. Use /github/pull-requests when you need PRs alone.

Is the GitHub Repository 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 Repository API?

Sign up, grab your key, and make your first call in 60 seconds.