GitHub · Guide

How to run a GitHub trending

TL;DR
To run a GitHub trending, sign up for a free Captapi key, then send one GET request to /v1/github/trending-repositories with your input. You get clean JSON back in seconds for 2 credits per call — no OAuth, scraping or platform SDKs. github.com/trending — repos ranked by starsGained (daily|weekly|monthly), not all-time stars (2 credits).

How to run a GitHub trending (step by step)

  1. 1

    Get a free API key

    Create a free Captapi account (100 credits, no card) and generate an API key from the dashboard.

  2. 2

    Call the GitHub Trending Repositories API

    Send an authenticated GET request to /v1/github/trending-repositories with your input. No OAuth, no scraping setup.

  3. 3

    Read the JSON response

    Parse the clean JSON response. Pass cache=true for a free 24h cache hit; default is always fresh.

Code example

curl "https://api.captapi.com/v1/github/trending-repositories" \
  -H "Authorization: Bearer capt_live_..."
# or: -H "x-api-key: capt_live_..."

What the response looks like

{
  "success": true,
  "data": {
    "since": "daily",
    "language": null,
    "totalReturned": 2,
    "repositories": [
      {
        "platform": "github",
        "type": "repository",
        "rank": 1,
        "name": "ai-job-search",
        "fullName": "MadsLorentzen/ai-job-search",
        "url": "https://github.com/MadsLorentzen/ai-job-search",
        "description": "The job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.",
        "owner": "MadsLorentzen",
        "ownerUrl": "https://github.com/MadsLorentzen",
        "language": "Python",
        "stars": 55655,
        "forks": 17820,
        "starsGained": 3860,
        "since": "daily"
      },
      {
        "platform": "github",
        "type": "repository",
        "rank": 2,
        "name": "opencode",
        "fullName": "anomalyco/opencode",
        "url": "https://github.com/anomalyco/opencode",
        "description": "The open source coding agent.",
        "owner": "anomalyco",
        "ownerUrl": "https://github.com/anomalyco",
        "language": "TypeScript",
        "stars": 217288,
        "forks": 29062,
        "starsGained": 1310,
        "since": "daily"
      }
    ]
  }
}

Billing metadata (credits charged, cache hit/miss) is returned in the X-Captapi-Credits and X-Captapi-Cache response headers.

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

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. 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 access, 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 reads github.com/trending and ranks by starsGained in the since window. source is native.

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. Selected profile endpoints also accept cacheMaxAge=1d|3d|7d|14d|30d. Use it for analytics, monitoring, and content automation.

Ready to run a GitHub trending?

Start free with 100 credits — no credit card required.

Get your free API key