---
title: "GitHub Trending Repositories API"
method: GET
path: "/v1/github/trending-repositories"
tags: ["GitHub"]
---

# GitHub Trending Repositories API

`GET /v1/github/trending-repositories`

## Request

- Base URL: `https://api.captapi.com`
- URL: `https://api.captapi.com/v1/github/trending-repositories`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

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

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, …).

Docs: https://captapi.com/apis/github-trending-repositories

## Query parameters

- `since` string
- `language` string
- `limit` integer
- `cache` boolean

## Response `200`

Success. The data object for this endpoint.

- object
  - `success` unknown, required
  - `data` object, required
    - `since` string: Trending window echoed from the request: daily | weekly | monthly.
    - `totalReturned` integer: Number of items returned in this response.
    - `repositories` object[]
      - `platform` string: Platform identifier for this response (matches the endpoint's platform).
      - `type` string: Content type of the item.
      - `rank` integer: 1-based position on the trending page.
      - `name` string: Name of this repositories item.
      - `fullName` string: Full display name.
      - `url` string: Canonical URL of the item.
      - `description` string: Description of this repositories item.
      - `owner` string: Owner of the repository.
      - `ownerUrl` string: Owner url URL.
      - `language` string: Programming-language filter slug echoed from the request (null when browsing all languages).
      - `stars` integer: Total star count shown on the trending card.
      - `forks` integer: Total fork count shown on the trending card.
      - `starsGained` integer: Stars gained in the since window — the metric that ranks github.com/trending.
      - `since` string: Trending window echoed from the request: daily | weekly | monthly.
    - `source` unknown

## Other responses

- `400`: Bad request: wrong platform URL, unknown endpoint, or an invalid parameter value. Not billed.
- `401`: Missing, invalid or revoked API key. Not billed.
- `402`: Not enough credits for this request. Not billed.
- `404`: The resource does not exist or is not public. Not billed.
- `422`: A required parameter is missing or has the wrong type. Not billed.
- `429`: Rate limit reached. Wait for Retry-After seconds. Not billed.
- `502`: The platform could not be reached or returned nothing usable. Retryable, not billed. 503 and 504 use the same envelope.

---

[API](https://skmtc.dev/captapi/apis/captapi-api.md) · [All operations](https://skmtc.dev/captapi/apis/captapi-api/llms.txt) · [OpenAPI document](https://skmtc.dev/captapi/apis/captapi-api/revisions/c9b9ac5ff1bd?raw)
