# GitHub Contribution Graph by Year

> GitHub Contribution Graph by Year is a paid API for AI agents from api.socialfetch.dev, paid per call via x402, $0.014/call, status unknown (last checked 2026-09-14).

Fetches the contribution graph (activity heatmap data) for a specified GitHub user profile for a given calendar year.

## Facts

- Endpoint: GET https://api.socialfetch.dev/v1/github/profiles/:handle/contributions
- Price: $0.014/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/github-contribution-graph-by-year-0d9cefe8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6_9lKAc8GRIIjB2oZf5hR

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability github-contribution-graph-by-year-0d9cefe8
```

Example prompt: Can you pull the GitHub contribution graph for the user 'torvalds' for the year 2023 — I want to see how active they were?

## When to prefer this

Use this endpoint when you need structured contribution/activity data for a specific GitHub user for a given year, especially in automated workflows, developer analytics, or profile enrichment pipelines. Prefer this over scraping GitHub directly since it handles the data fetching and parsing for you via a simple paid API call.

## Known failure modes

- GitHub handle not found or does not exist — returns an error or empty result
- Year out of range or before account creation — may return empty data
- Rate limiting or upstream GitHub access issues — may return a timeout or 5xx error
- Missing required handle parameter — returns a validation error
- Invalid year format — returns a schema validation error

## How this service works

Get the contribution graph for a GitHub profile for a given year.

## Output

Returns structured contribution graph data for the specified GitHub user and year, equivalent to the green activity heatmap shown on GitHub profile pages — including contribution counts per day or week across the calendar year.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "pathParams": {
     "type": "object",
     "required": [
      "handle"
     ],
     "properties": {
      "handle": {
       "type": "string",
       "maxLength": 39,
       "minLength": 1,
       "description": "GitHub username to look up, with or without a leading @."
      }
     }
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "year": {
       "type": "integer",
       "maximum": 2100,
       "minimum": 2007,
       "description": "Calendar year for the contribution graph. Default: current calendar year."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/github-contribution-graph-by-year-0d9cefe8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.socialfetch.dev](https://www.zero.xyz/host/api.socialfetch.dev/llms.txt)
