GitHub Contribution Card API
Generate a PNG contribution graph for a GitHub user with custom theme, month range, and width.
The CGI endpoint is /contrib/generate and responds with an image.
Endpoint
GET /contrib/generate?username=octocat&months=12&theme=light&width=1200&caption_year=1&caption_month=1&caption_day=0&download=0
Query string options
| Parameter | Type | Required | Notes |
|---|---|---|---|
username |
string | Yes | GitHub username. Letters, numbers, and hyphens only. |
months |
integer | No | How many months to include. API defaults to 12. |
theme |
string | No | Theme name. Defaults to light. |
width |
integer | No | Output width in pixels. Clamped by API to 100..4000. |
download |
0 or 1 |
No | 0 = inline image, 1 = attachment download. |
caption_year |
0 or 1 |
No | Draw year labels above the graph when a new year appears. |
caption_month |
0 or 1 |
No | Draw month labels above the graph when a new month starts. |
caption_day |
0 or 1 |
No | Draw weekday labels on the left side of the graph. |
Available themes: light, dark, classic, earth,
pastel,
neon, sunset, ocean, forest, amber,
dracula,
grayscale, github-dark (alias of dark), github-light (alias of light).
API tester
Generated request URL: