Skip to main content

contribution_calendar

Creates, updates, deletes, gets or lists a contribution_calendar resource.

Overview

Namecontribution_calendar
TypeResource
Idgithub.users.contribution_calendar

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
contribution_daysarrayDaily entries for the week: date, weekday (0 = Sunday), contribution_count, color.
first_daystring (date)The date of the first day (Sunday) of the week.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectusernamefrom, toA user's contribution calendar (the profile contribution graph), one row per week with the daily counts as a JSON array - expand with json_each. Defaults to the trailing year; pass from and to (ISO 8601 timestamps, at most one year apart) for another window. Backed by the GitHub GraphQL API (user.contributionsCollection.contributionCalendar).

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
usernamestringThe handle for the GitHub user account.
fromstring (date-time)Only contributions made at this time or later will be counted. ISO 8601, e.g. 2025-01-01T00:00:00Z.
tostring (date-time)Only contributions made before and up to this time will be counted. ISO 8601.

SELECT examples

A user's contribution calendar (the profile contribution graph), one row per week with the daily counts as a JSON array - expand with json_each. Defaults to the trailing year; pass from and to (ISO 8601 timestamps, at most one year apart) for another window. Backed by the GitHub GraphQL API (user.contributionsCollection.contributionCalendar).

SELECT
contribution_days,
first_day
FROM github.users.contribution_calendar
WHERE username = '{{ username }}' -- required
AND from = '{{ from }}'
AND to = '{{ to }}'
;