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
curl -X POST "https://api.bridgly.app/github/get-contributions" \ -H "Authorization: Bearer $BRIDGLY_KEY" \ -H "Content-Type: application/json" \ -d '{ "username": "torvalds"}'import osimport requestsresponse = requests.post( "https://api.bridgly.app/github/get-contributions", headers={"Authorization": f"Bearer {os.environ['BRIDGLY_KEY']}"}, json={ "username": "torvalds", },)data = response.json()const response = await fetch("https://api.bridgly.app/github/get-contributions", { method: "POST", headers: { Authorization: `Bearer ${process.env.BRIDGLY_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "username": "torvalds" }),});const data = await response.json();import { Bridgly } from "@bridgly/sdk";const client = new Bridgly({ apiKey: "bgly_YOUR_KEY" });const res = await client.github.getContributions({ username: "torvalds"});if (res.type === "success") { console.log(res.data);}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
{ "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" } ] }}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.
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.
More GitHub endpoints
The same API key works on every endpoint. See all GitHub API endpoints.
- GitHub Repositories API→GitHub repositories API: list any user’s public repos with description, language, stars, forks and watchers, sorted by last push, update, name or stars.
- GitHub Starred Repos API→GitHub stars API: list the repositories any GitHub user has starred, with each repo’s owner, description, primary language and star and fork counts.
- GitHub Projects API→GitHub projects API: list any user’s public GitHub Projects boards as JSON, with each project’s title, description, link, open or closed state and dates.
- GitHub User Search API→Find GitHub developers and organizations by location, language, followers and join date. Get bios and repository counts with the GitHub User Search API.
Try the GitHub Contributions API
100 free credits on business email, no card. Your first call takes a minute.