# GitHub Contributions Calendar

Returns the public contributions calendar for an account: one entry per calendar day with a date and an activity level from 0 to 4. GitHub publishes levels and not per-day counts, so no count field exists in this response and none is invented. Pass to for a historical year; the default window is the trailing year.

- **Documentation:** [https://scrappa.co/docs/github-api/github_user_contributions](https://scrappa.co/docs/github-api/github_user_contributions)
- **API group:** GitHub API
- **Endpoint:** `GET https://scrappa.co/api/github/user/contributions`

## 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 |
| --- | --- | --- | --- |
| `username` | string | Yes | GitHub account login, e.g. torvalds. |
| `to` | string | No | Last calendar day to include, YYYY-MM-DD. Use it to read a historical year. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/github/user/contributions?username=torvalds&to=2025-12-31"
```

## Example response

```json
{
    "search_parameters": {
        "engine": "github_user_contributions",
        "username": "torvalds",
        "to": "2025-12-31"
    },
    "login": "torvalds",
    "days": [
        {
            "date": "2025-01-01",
            "level": 1
        },
        {
            "date": "2025-01-02",
            "level": 0
        }
    ],
    "day_count": 365,
    "first_date": "2025-01-01",
    "last_date": "2025-12-31"
}
```

## 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)
