GITHUB API

GitHub Contributions API

Get a GitHub user's contribution graph for a date range of up to one year: the contribution count for each day plus totals for commits, issues, pull requests, reviews and new repositories.

Endpoint
POST /github/get-contributions
Price
1 credit per request
SDK
client.github.getContributions()
MCP tool
github_get_contributions
Terminal
curl -X POST "https://api.bridgly.app/github/get-contributions" \
-H "Authorization: Bearer $BRIDGLY_KEY" \
-H "Content-Type: application/json" \
-d '{
"username": "torvalds"
}'
[ REQUEST AND RESPONSE ]

What does the GitHub Contributions API return?

GitHub contributions API: get any user’s contribution graph with daily counts, plus total commits, issues, pull requests and reviews for a date range. Every response has the same envelope: the result in data, plus timeMs and the creditsCost of the call.

Request body

usernamestringrequired
GitHub username (login), or the profile link, e.g. "torvalds" or "https://github.com/torvalds".
fromstring
ISO-8601 start of the contribution window (inclusive), e.g. "2025-01-01T00:00:00Z". Defaults to one year ago. Must be within one year of `to`.
tostring
ISO-8601 end of the contribution window (inclusive), e.g. "2025-12-31T00:00:00Z". Defaults to now.

Example response

200 OK · application/json
{
"timeMs": 1840,
"creditsCost": 1,
"data": {
"username": "string",
"from": "string",
"to": "string",
"totalContributions": 0,
"totalCommitContributions": 0,
"totalIssueContributions": 0,
"totalPullRequestContributions": 0,
"totalPullRequestReviewContributions": 0,
"totalRepositoryContributions": 0,
"restrictedContributionsCount": 0,
"days": [
{
"date": "string",
"count": 0,
"weekday": 0,
"color": "string"
}
]
}
}
[ USE CASES ]

What can you build with the GitHub Contributions API?

Render a contribution graph

Draw the familiar green calendar in your own site or app.

Measure activity

Compare how active developers or teams are over a year.

Build streak trackers

Count consecutive days with contributions and notify on breaks.

[ FAQ ]

GitHub Contributions API questions

How do I get a GitHub user’s contribution graph?

Send the username, and optionally from and to dates up to one year apart; the default is the last year. You get the contribution count for each day plus totals for commits, issues, pull requests, reviews and new repositories.

How do I count a developer’s commits in a year?

Set from and to to the start and end of the year and read the commit total in the response.

Can I build a contribution heatmap or streak tracker?

Yes. The daily counts are what the green squares on a GitHub profile show, so you can draw your own heatmap or work out streaks from them.

How do I use the GitHub Contributions API?

Send a POST request to https://api.bridgly.app/github/get-contributions with username in the JSON body and your API key in the Authorization header. In the TypeScript SDK, call client.github.getContributions(). AI agents connected to Bridgly over MCP can call the github_get_contributions tool.

How much does the GitHub Contributions API cost?

Costs 1 credit per request. Credits cost $2.00 per 1,000 on pay-as-you-go and as low as $1.00 per 1,000 at volume. New accounts on a business email start with 100 free credits, and failed requests are never charged.

Try the GitHub Contributions API

100 free credits on business email, no card. Your first call takes a minute.

APIMCPSDKCLI
free credits

On business email signup. No credit card required.

Start free with 100 credits