# GitHub Trending Repositories

Returns the repositories GitHub is currently trending: owner, name, url, description, language and language colour, total stars, forks, stars gained in the chosen period, the accounts that built it, and the authors behind the period growth. stars and stars_this_period are separate fields because they are different numbers and must not be conflated.

- **Documentation:** [https://scrappa.co/docs/github-api/github_trending_repositories](https://scrappa.co/docs/github-api/github_trending_repositories)
- **API group:** GitHub API
- **Endpoint:** `GET https://scrappa.co/api/github/trending/repositories`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `language` | string | No | Filter by programming language, e.g. python or go. Omit for the all-language trending page. |
| `since` | string | No | Trending window: daily, weekly or monthly. Defaults to daily. |
| `spoken_language_code` | string | No | Filter by the language developers speak, e.g. en. Omit for no filter. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/github/trending/repositories?language=python&since=weekly"
```

## Example response

```json
{
    "search_parameters": {
        "engine": "github_trending_repositories",
        "language": "python",
        "since": "weekly"
    },
    "language": "python",
    "since": "weekly",
    "repositories": [
        {
            "full_name": "example/project",
            "name": "project",
            "owner": "example",
            "language": "Python",
            "stars": 12000,
            "forks": 400,
            "stars_this_period": 320,
            "period": "weekly",
            "built_by": [
                "octocat"
            ]
        }
    ],
    "result_count": 1
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A parameter failed validation. |
| 404 | Not Found | GitHub has no public resource at that address. For a repository this also covers a private or renamed repository, which is indistinguishable anonymously. |
| 503 | GitHub Upstream Unavailable | The upstream service is temporarily unavailable. Please retry shortly. |
| 500 | Parser Drift | GitHub returned a response shape this parser does not recognise. The incident has been reported; retrying will return the same result. |
| 406 | Not Acceptable Upstream | GitHub has no JSON representation for this route, or rejected the request headers. Never charged. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
