How to run a GitHub trending
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
Get a free API key
Create a free Captapi account (100 credits, no card) and generate an API key from the dashboard.
- 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
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?since=daily" \
-H "Authorization: Bearer capt_live_..."
# or: -H "x-api-key: capt_live_..."What the response looks like
{
"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 (credits charged, cache hit/miss) is returned in the X-Captapi-Credits and X-Captapi-Cache response headers.
Request parameters
| Name | Type | Required | Description |
|---|---|---|---|
| since | string | No | Trending window: daily (default), weekly, or monthly — matches github.com/trending?since=. |
| language | string | No | Optional programming-language slug (e.g. python, typescript) → /trending/{language}. |
| limit | integer | No | Max items to return (default 25, max 100). Flat 2 credits per call. |
| 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. |
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.
Ready to run a GitHub trending?
Start free with 100 credits — no credit card required.
Get your free API key