GitHub
GET /v1/github/trending-repositories

GitHub Trending Repositories API

github.com/trending — repos ranked by starsGained (daily|weekly|monthly), not all-time stars (2 credits).

2 credits per request
TL;DR
github.com/trending — repos ranked by starsGained (daily|weekly|monthly), not all-time stars (2 credits). The GitHub Trending Repositories API (GitHub) is a single authenticated GET request to /v1/github/trending-repositories that responds with clean JSON and costs 2 credits. 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 Trending Repositories API?

Scrapes the public github.com/trending page (source: "github.com/trending") — repositories ranked by stars gained in a window, not REST /search/repositories sorted by all-time stars. Pass since=daily|weekly|monthly (default daily) and optional language slug (e.g. python → /trending/python). Each row: rank, fullName, url, description, language (programming language), stars, forks, starsGained, since. Flat 2 credits. The HTML page usually lists ~25 repos; there is no cursor (unlike Search API's 1000-result cap). This is not a substitute for github/repository detail fields (license, watchers/subscribers, parent, …).

What you get

  • Real github.com/trending (not all-time star search)
  • since=daily|weekly|monthly + starsGained
  • source field discloses the HTML page

Platform limits

Honest ceilings from the upstream platform surface — not Captapi bugs. Unexpected truncation here is usually the platform, not us.

  • Page usually has ≤25 rows — no cursor / no Search API 1000 cap.
  • Not the same 23-field detail object as github/repository.

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/trending-repositories?since=daily" \
  -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": {
    "source": "github.com/trending",
    "since": "daily",
    "totalReturned": 2,
    "repositories": [
      {
        "platform": "github",
        "type": "repository",
        "rank": 1,
        "name": "computer",
        "fullName": "cloudflare/computer",
        "url": "https://github.com/cloudflare/computer",
        "description": "Remote browser infrastructure",
        "owner": "cloudflare",
        "ownerUrl": "https://github.com/cloudflare",
        "language": "TypeScript",
        "stars": 2514,
        "forks": 120,
        "starsGained": 796,
        "since": "daily"
      },
      {
        "platform": "github",
        "type": "repository",
        "rank": 2,
        "name": "hot-repo",
        "fullName": "example/hot-repo",
        "url": "https://github.com/example/hot-repo",
        "description": "Trending sample",
        "owner": "example",
        "ownerUrl": "https://github.com/example",
        "language": "Python",
        "stars": 1200,
        "forks": 80,
        "starsGained": 327,
        "since": "daily"
      }
    ]
  }
}

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

  • sourceAlways "github.com/trending" — HTML trending page, not REST star search.
  • sinceTrending window echoed from the request: daily | weekly | monthly.
  • totalReturnedNumber of items returned in this response.

Repositories

Each item in repositories contains:

  • platformPlatform identifier for this response (matches the endpoint's platform).
  • typeContent type of the item.
  • rank1-based position on the trending page.
  • 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.
  • languageProgramming-language filter slug echoed from the request (null when browsing all languages).
  • starsTotal star count shown on the trending card.
  • forksTotal fork count shown on the trending card.
  • starsGainedStars gained in the since window — the metric that ranks github.com/trending.
  • sinceTrending window echoed from the request: daily | weekly | monthly.

Parameters

NameTypeRequiredDescription
sincestringNoTrending window: daily (default), weekly, or monthly — matches github.com/trending?since=.
languagestringNoOptional programming-language slug (e.g. python, typescript) → /trending/{language}.
limitintegerNoMax items to return (default 25, max 100). Flat 2 credits per call.
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 2 credits. Pass cache=true for a free 24h cache hit; default is always fresh.

Using an AI agent? This endpoint is the MCP tool github_trending_repositories 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/trending-repositories and parse the JSON response.

Use cases

Momentum discovery

Find repos gaining stars today/this week/month via starsGained — not all-time star charts.

Language radar

Pass language=python (or typescript, …) to scope /trending/{language}.

Detail fan-out

Chain fullName into github/repository for license, watchers/subscribers, and parent.

Frequently asked questions

What does the GitHub Trending Repositories API do?+

The GitHub Trending Repositories API lets you search and return matching results from a public GitHub query using one GET request to /v1/github/trending-repositories. It returns clean JSON — no OAuth or infrastructure setup required.

How many credits does the GitHub Trending Repositories API cost?+

Each successful call costs 2 credits. 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 this the same as sorting /search/repositories by stars?+

No. That returns all-time most-starred repos (public-apis, free-programming-books, …). This endpoint scrapes github.com/trending and ranks by starsGained in the since window. source is always "github.com/trending".

Why is there no cursor?+

GitHub's trending HTML page is a single short list (usually ≤25). There is no Search API pagination here and no 1000-result Search cap either.

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

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