GitHub contribution calendar
Beta GET /v1/github/user/contributions
GET /v1/github/user/contributions
The public contribution graph for one year: the total and a count per day.
- Cost: 1 credit
- Status: Beta. Built and tested against recorded responses; the shape may still gain fields.
- Cache: Results are kept up to 30 days; send
max_age_daysto reuse them for free. - Timeout: A request still running after about 25 seconds answers
202with a job to poll (Batch and jobs).
Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
handle | string | one of | GitHub username. Also accepted as username, login. |
url | URL | one of | Profile URL (github.com/<user>). Accepted hosts: github.com. |
year | integer | no | Calendar year (2008 onward); default the current year. Range 2008 to 2100. Example 2025. |
Send at least one of handle, url. If you send several, the first listed is used and the rest are ignored.
Every request also accepts:
trim:truefor a smaller response withoutnullfields andextra.raw:trueto also get the platform's original object asraw.max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).
Example request#
Set your key in the environment first (see Authentication).
curl
curl -G "https://api.socialscrape.io/v1/github/user/contributions" \
-H "x-api-key: $SOCIALSCRAPE_API_KEY" \
--data-urlencode "handle=torvalds" \
--data-urlencode "year=2025"Python
import os
import requests
params = {
"handle": "torvalds",
"year": "2025",
}
res = requests.get(
"https://api.socialscrape.io/v1/github/user/contributions",
headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
params=params,
)
body = res.json()
if body["ok"]:
print(body["data"])
else:
print(body["error"]["code"], body["error"]["message"])TypeScript
const url = new URL("https://api.socialscrape.io/v1/github/user/contributions");
url.search = new URLSearchParams({
"handle": "torvalds",
"year": "2025"
}).toString();
const res = await fetch(url, {
headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();
if (body.ok) {
console.log(body.data);
} else {
console.error(body.error.code, body.error.message);
}n8n
{
"nodes": [
{
"name": "SocialScrape GitHub contribution calendar",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
0,
0
],
"parameters": {
"method": "GET",
"url": "https://api.socialscrape.io/v1/github/user/contributions",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "handle",
"value": "torvalds"
},
{
"name": "year",
"value": "2025"
}
]
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-api-key",
"value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
}
]
}
}
}
],
"connections": {}
}Example response#
This is a sample from a recorded response, lists and long text are shortened. Status 200.
{
"ok": true,
"credits_charged": 1,
"credits_remaining": 4999,
"cached": false,
"cached_at": null,
"request_id": "req_529d5fd94d1524174537336b",
"data": {
"object": "contributions",
"platform": "github",
"handle": "torvalds",
"total": 2925,
"days": [
{
"date": "2025-01-01",
"count": 1
},
{
"date": "2025-01-02",
"count": 2
},
{
"date": "2025-01-03",
"count": 11
}
],
"extra": {
"intensity_by_date": {
"2025-01-01": 1,
"2025-01-02": 1,
"2025-01-03": 2,
"2025-01-04": 1,
"2025-01-05": 1,
"2025-01-06": 1,
"2025-01-07": 1,
"2025-01-08": 1,
"2025-01-09": 1,
"2025-01-10": 2,
"2025-01-11": 1,
"2025-01-12": 1,
"2025-01-13": 1,
"2025-01-14": 1,
"2025-01-15": 0,
"2025-01-16": 1,
"2025-01-17": 1,
"2025-01-18": 1,
"2025-01-19": 1,
"2025-01-20": 3,
"2025-01-21": 4,
"2025-01-22": 3,
"2025-01-23": 2,
"2025-01-24": 3,
"2025-01-25": 2,
"2025-01-26": 1,
"2025-01-27": 2,
"2025-01-28": 2,
"2025-01-29": 2,
"2025-01-30": 2,
"2025-01-31": 2,
"2025-02-01": 1,
"2025-02-02": 1,
"2025-02-03": 1,
"2025-02-04": 1,
"2025-02-05": 1,
"2025-02-06": 1,
"2025-02-07": 1,
"2025-02-08": 2,
"2025-02-09": 1,
"2025-02-10": 1,
"2025-02-11": 1,
"2025-02-12": 1,
"2025-02-13": 1,
"2025-02-14": 2,
"2025-02-15": 1,
"2025-02-16": 2,
"2025-02-17": 1,
"2025-02-18": 1,
"2025-02-19": 1,
"2025-02-20": 1,
"2025-02-21": 1,
"2025-02-22": 1,
"2025-02-23": 1,
"2025-02-24": 1,
"2025-02-25": 1,
"2025-02-26": 1,
"2025-02-27": 1,
"2025-02-28": 2,
"2025-03-01": 1,
"2025-03-02": 1,
"2025-03-03": 1,
"2025-03-04": 1,
"2025-03-05": 1,
"2025-03-06": 2,
"2025-03-07": 2,
"2025-03-08": 1,
"2025-03-09": 1,
"2025-03-10": 1,
"2025-03-11": 1,
"2025-03-12": 1,
"2025-03-13": 1,
"2025-03-14": 2,
"2025-03-15": 1,
"2025-03-16": 1,
"2025-03-17": 1,
"2025-03-18": 1,
"2025-03-19": 1,
"2025-03-20": 1,
"2025-03-21": 1,
"2025-03-22": 1,
"2025-03-23": 0,
"2025-03-24": 4,
"2025-03-25": 4,
"2025-03-26": 2,
"2025-03-27": 3,
"2025-03-28": 2,
"2025-03-29": 2,
"2025-03-30": 1,
"2025-03-31": 2,
"2025-04-01": 2,
"2025-04-02": 3,
"2025-04-03": 2,
"2025-04-04": 2,
"2025-04-05": 1,
"2025-04-06": 2,
"2025-04-07": 0,
"2025-04-08": 1,
"2025-04-09": 1,
"2025-04-10": 2,
"2025-04-11": 1,
"2025-04-12": 1,
"2025-04-13": 1,
"2025-04-14": 1,
"2025-04-15": 1,
"2025-04-16": 1,
"2025-04-17": 2,
"2025-04-18": 2,
"2025-04-19": 1,
"2025-04-20": 1,
"2025-04-21": 1,
"2025-04-22": 1,
"2025-04-23": 1,
"2025-04-24": 1,
"2025-04-25": 2,
"2025-04-26": 2,
"2025-04-27": 1,
"2025-04-28": 1,
"2025-04-29": 1,
"2025-04-30": 1,
"2025-05-01": 1,
"2025-05-02": 2,
"2025-05-03": 1,
"2025-05-04": 1,
"2025-05-05": 1,
"2025-05-06": 1,
"2025-05-07": 1,
"2025-05-08": 1,
"2025-05-09": 1,
"2025-05-10": 1,
"2025-05-11": 2,
"2025-05-12": 1,
"2025-05-13": 1,
"2025-05-14": 1,
"2025-05-15": 1,
"2025-05-16": 2,
"2025-05-17": 1,
"2025-05-18": 1,
"2025-05-19": 0,
"2025-05-20": 1,
"2025-05-21": 1,
"2025-05-22": 1,
"2025-05-23": 1,
"2025-05-24": 1,
"2025-05-25": 1,
"2025-05-26": 4,
"2025-05-27": 4,
"2025-05-28": 3,
"2025-05-29": 2,
"2025-05-30": 2,
"2025-05-31": 2,
"2025-06-01": 1,
"2025-06-02": 2,
"2025-06-03": 2,
"2025-06-04": 1,
"2025-06-05": 1,
"2025-06-06": 3,
"2025-06-07": 1,
"2025-06-08": 2,
"2025-06-09": 1,
"2025-06-10": 1,
"2025-06-11": 1,
"2025-06-12": 1,
"2025-06-13": 2,
"2025-06-14": 1,
"2025-06-15": 1,
"2025-06-16": 1,
"2025-06-17": 1,
"2025-06-18": 1,
"2025-06-19": 1,
"2025-06-20": 1,
"2025-06-21": 1,
"2025-06-22": 1,
"2025-06-23": 1,
"2025-06-24": 1,
"2025-06-25": 1,
"2025-06-26": 1,
"2025-06-27": 2,
"2025-06-28": 1,
"2025-06-29": 1,
"2025-06-30": 1,
"2025-07-01": 1,
"2025-07-02": 1,
"2025-07-03": 1,
"2025-07-04": 2,
"2025-07-05": 1,
"2025-07-06": 2,
"2025-07-07": 1,
"2025-07-08": 1,
"2025-07-09": 1,
"2025-07-10": 1,
"2025-07-11": 1,
"2025-07-12": 1,
"2025-07-13": 1,
"2025-07-14": 1,
"2025-07-15": 1,
"2025-07-16": 1,
"2025-07-17": 1,
"2025-07-18": 2,
"2025-07-19": 1,
"2025-07-20": 2,
"2025-07-21": 1,
"2025-07-22": 1,
"2025-07-23": 1,
"2025-07-24": 1,
"2025-07-25": 1,
"2025-07-26": 1,
"2025-07-27": 1,
"2025-07-28": 4,
"2025-07-29": 4,
"2025-07-30": 2,
"2025-07-31": 4,
"2025-08-01": 2,
"2025-08-02": 1,
"2025-08-03": 1,
"2025-08-04": 1,
"2025-08-05": 1,
"2025-08-06": 1,
"2025-08-07": 1,
"2025-08-08": 1,
"2025-08-09": 2,
"2025-08-10": 1,
"2025-08-11": 1,
"2025-08-12": 1,
"2025-08-13": 1,
"2025-08-14": 1,
"2025-08-15": 2,
"2025-08-16": 1,
"2025-08-17": 1,
"2025-08-18": 1,
"2025-08-19": 1,
"2025-08-20": 1,
"2025-08-21": 2,
"2025-08-22": 2,
"2025-08-23": 1,
"2025-08-24": 1,
"2025-08-25": 1,
"2025-08-26": 0,
"2025-08-27": 1,
"2025-08-28": 2,
"2025-08-29": 1,
"2025-08-30": 1,
"2025-08-31": 1,
"2025-09-01": 0,
"2025-09-02": 1,
"2025-09-03": 1,
"2025-09-04": 1,
"2025-09-05": 2,
"2025-09-06": 1,
"2025-09-07": 1,
"2025-09-08": 1,
"2025-09-09": 1,
"2025-09-10": 1,
"2025-09-11": 1,
"2025-09-12": 1,
"2025-09-13": 1,
"2025-09-14": 1,
"2025-09-15": 1,
"2025-09-16": 1,
"2025-09-17": 2,
"2025-09-18": 1,
"2025-09-19": 2,
"2025-09-20": 1,
"2025-09-21": 1,
"2025-09-22": 1,
"2025-09-23": 1,
"2025-09-24": 1,
"2025-09-25": 1,
"2025-09-26": 2,
"2025-09-27": 1,
"2025-09-28": 1,
"2025-09-29": 4,
"2025-09-30": 4,
"2025-10-01": 4,
"2025-10-02": 2,
"2025-10-03": 4,
"2025-10-04": 3,
"2025-10-05": 2,
"2025-10-06": 2,
"2025-10-07": 2,
"2025-10-08": 1,
"2025-10-09": 1,
"2025-10-10": 2,
"2025-10-11": 2,
"2025-10-12": 1,
"2025-10-13": 0,
"2025-10-14": 1,
"2025-10-15": 1,
"2025-10-16": 1,
"2025-10-17": 1,
"2025-10-18": 2,
"2025-10-19": 1,
"2025-10-20": 1,
"2025-10-21": 1,
"2025-10-22": 1,
"2025-10-23": 1,
"2025-10-24": 2,
"2025-10-25": 1,
"2025-10-26": 2,
"2025-10-27": 1,
"2025-10-28": 1,
"2025-10-29": 0,
"2025-10-30": 1,
"2025-10-31": 2,
"2025-11-01": 1,
"2025-11-02": 1,
"2025-11-03": 0,
"2025-11-04": 1,
"2025-11-05": 1,
"2025-11-06": 1,
"2025-11-07": 1,
"2025-11-08": 1,
"2025-11-09": 1,
"2025-11-10": 1,
"2025-11-11": 1,
"2025-11-12": 1,
"2025-11-13": 1,
"2025-11-14": 2,
"2025-11-15": 1,
"2025-11-16": 1,
"2025-11-17": 1,
"2025-11-18": 1,
"2025-11-19": 1,
"2025-11-20": 1,
"2025-11-21": 1,
"2025-11-22": 1,
"2025-11-23": 1,
"2025-11-24": 1,
"2025-11-25": 1,
"2025-11-26": 1,
"2025-11-27": 1,
"2025-11-28": 2,
"2025-11-29": 1,
"2025-11-30": 1,
"2025-12-01": 3,
"2025-12-02": 4,
"2025-12-03": 4,
"2025-12-04": 4,
"2025-12-05": 4,
"2025-12-06": 3,
"2025-12-07": 1,
"2025-12-08": 1,
"2025-12-09": 2,
"2025-12-10": 2,
"2025-12-11": 1,
"2025-12-12": 1,
"2025-12-13": 2,
"2025-12-14": 1,
"2025-12-15": 0,
"2025-12-16": 1,
"2025-12-17": 1,
"2025-12-18": 0,
"2025-12-19": 1,
"2025-12-20": 2,
"2025-12-21": 1,
"2025-12-22": 1,
"2025-12-23": 1,
"2025-12-24": 1,
"2025-12-25": 1,
"2025-12-26": 2,
"2025-12-27": 1,
"2025-12-28": 2,
"2025-12-29": 1,
"2025-12-30": 1,
"2025-12-31": 1
},
"year": 2025
}
},
"cursor": null,
"has_more": null
}Response#
A Contributions object in data.
See Data models for every field. The envelope around data is described in Responses.
Errors#
Failures are free: credits_charged is 0. Branch on error.code, never on the message.
| Code | HTTP | Retry | Meaning |
|---|---|---|---|
invalid_params | 400 | no | A parameter is missing, unknown or has the wrong type. |
unsupported_url | 400 | no | The URL is not one this endpoint accepts (wrong platform or form). |
not_found | 404 | no | The platform says this profile, post or item does not exist. |
Every request can also fail with the account and platform errors listed on the Errors page.
Example error:
{
"ok": false,
"error": {
"code": "not_found",
"message": "The platform says this profile, post or item does not exist.",
"retryable": false
},
"credits_charged": 0,
"request_id": "req_0f8b47a070af626d548327d3"
}Related endpoints#
- GitHub user (
GET /v1/github/user) - GitHub user repositories (
GET /v1/github/user/repositories) - GitHub repository (
GET /v1/github/repository) - GitHub followers (
GET /v1/github/user/followers) - GitHub following (
GET /v1/github/user/following) - GitHub public activity (
GET /v1/github/user/activity) - GitHub pull requests by a user (
GET /v1/github/user/pull-requests) - GitHub trending repositories (
GET /v1/github/trending/repositories)