# GitHub Search Repositories

Searches public repositories with the GitHub search syntax (for example language:go stars:>1000). Returns the total match count, an incomplete_results flag and one page of full repository objects with the same fields as the repository endpoint. GitHub serves only the first 1,000 results, so page times per_page above 1000 answers 422. Costs 1 credit per successful request.

- **Documentation:** [https://scrappa.co/docs/github-api/github_search_repositories](https://scrappa.co/docs/github-api/github_search_repositories)
- **API group:** GitHub API
- **Endpoint:** `GET https://scrappa.co/api/github/search/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 |
| --- | --- | --- | --- |
| `q` | string | Yes | Search query. Supports qualifiers such as language:go, stars:>1000, topic:cli or user:laravel. |
| `sort` | string | No | stars, forks, help-wanted-issues or updated. Defaults to best match. |
| `order` | string | No | asc or desc. Defaults to desc. |
| `page` | integer | No | 1-based page. Defaults to 1. |
| `per_page` | integer | No | Results per page, 1-100. Defaults to 30. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/github/search/repositories?q=laravel&sort=stars&per_page=10"
```

## Example response

```json
{
    "search_parameters": {
        "engine": "github_search_repositories",
        "q": "laravel",
        "sort": "stars",
        "per_page": 10
    },
    "total_count": 933161,
    "incomplete_results": false,
    "page": 1,
    "per_page": 10,
    "has_more": true,
    "repositories": [
        {
            "id": 1863329,
            "name": "laravel",
            "full_name": "laravel/laravel",
            "html_url": "https://github.com/laravel/laravel",
            "description": "Laravel is a web application framework with expressive, elegant syntax. We\u2019ve already laid the foundation for your next ",
            "fork": false,
            "created_at": "2011-06-08T03:06:08Z",
            "updated_at": "2026-11-04T01:21:00Z",
            "pushed_at": "2026-10-30T13:45:03Z",
            "homepage": "https://laravel.com",
            "size": 11048,
            "stargazers_count": 85214,
            "watchers_count": 85214,
            "language": "Blade",
            "forks_count": 26239,
            "open_issues_count": 31,
            "license": null,
            "topics": [
                "framework",
                "laravel",
                "php"
            ],
            "default_branch": "13.x",
            "score": 1,
            "owner": {
                "login": "laravel",
                "type": "Organization"
            }
        }
    ],
    "result_count": 10
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A parameter failed validation. |
| 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)
