# GitHub API (ScrapeIO)

3 endpoints for public GitHub data. Same response format and field names as every other platform.

## Basics

- Base URL: `https://scrapeio.com`
- Auth: send your key in the `x-api-key` header. Get a key at https://scrapeio.com/login (100 free credits, no card).
- Every endpoint is a GET with query parameters and returns JSON:
  `{ "success": true, "cached": false, "credits_used": 1, "credits_remaining": 99, "data": { ... } }`
- Field names are the same on every platform (`handle`, `followers`, `plays`, `likes`, `comments`, `created_at`).
- Lists return `data.items`, `data.cursor` and `data.has_more`. Pass `cursor` back to get the next page.
- Each endpoint has one listed price. Cached repeats, failed calls, private and not-found answers cost 0.
- Limit: 300 requests a minute per key.

## Errors

| Status | Meaning | Charged |
| --- | --- | --- |
| 200 | Success | Yes, unless cached |
| 400 | A parameter is missing or wrong | No |
| 401 | The key is missing or invalid | No |
| 402 | Not enough credits | No |
| 403 | The account or post is private | No |
| 404 | Not found on the platform | No |
| 429 | More than 300 requests a minute | No |
| 502 | Every source is down; retry shortly | No |

### GET /v1/github/user/contributions

A user's contribution calendar: count per day and the yearly total. Price: 1 credit. MCP tool: `github_user_contributions`.

Send one of: `handle`, `url`.

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `handle` | string | no | GitHub username. |
| `url` | string | no | GitHub profile URL. Send this or handle. |
| `year` | string | no | Calendar year, e.g. 2025. Default: the last 12 months. |

```bash
curl "https://scrapeio.com/v1/github/user/contributions?handle=nike" -H "x-api-key: $SCRAPEIO_API_KEY"
```

### GET /v1/github/trending/repositories

GitHub's trending repositories, with stars gained in the period. Price: 1 credit. MCP tool: `github_trending_repositories`.

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `language` | string | no | Programming language, e.g. typescript. |
| `since` | string | no | daily, weekly or monthly. |
| `spoken_language_code` | string | no | Spoken language, e.g. en. |

```bash
curl "https://scrapeio.com/v1/github/trending/repositories" -H "x-api-key: $SCRAPEIO_API_KEY"
```

### GET /v1/github/trending/developers

GitHub's trending developers and their most popular repo. Price: 1 credit. MCP tool: `github_trending_developers`.

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `language` | string | no | Programming language, e.g. rust. |
| `since` | string | no | daily, weekly or monthly. |

```bash
curl "https://scrapeio.com/v1/github/trending/developers" -H "x-api-key: $SCRAPEIO_API_KEY"
```
