> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bridgly.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch a GitHub user's contribution calendar and totals



## OpenAPI

````yaml /openapi.json post /github/get-contributions
openapi: 3.1.0
info:
  title: Bridgly API
  description: >-
    Web scraping API for LinkedIn, X (Twitter) and Reddit. Authenticated
    endpoints accept a Bridgly API key (`bgly_…`) via `Authorization: Bearer
    <token>`.
  version: 1.0.0
servers:
  - url: https://api.bridgly.app
    description: Production
security: []
tags:
  - name: LinkedIn
    description: Scrape LinkedIn profiles, companies, posts, and search.
  - name: Reddit
    description: Scrape Reddit posts, subreddits, users, and search.
  - name: X (Twitter)
    description: Scrape tweets and search X.
  - name: GitHub
    description: >-
      Fetch GitHub profiles, pinned repos, contributions, repositories, stars,
      and projects via GitHub's GraphQL API.
paths:
  /github/get-contributions:
    post:
      tags:
        - GitHub
      summary: Fetch a GitHub user's contribution calendar and totals
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                username:
                  type: string
                  description: GitHub username (login) without the "@", e.g. "torvalds".
                from:
                  description: >-
                    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`.
                  type: string
                to:
                  description: >-
                    ISO-8601 end of the contribution window (inclusive), e.g.
                    "2025-12-31T00:00:00Z". Defaults to now.
                  type: string
              required:
                - username
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  timeMs:
                    type: number
                    description: >-
                      Wall-clock time the request took to complete, in
                      milliseconds.
                  creditsCost:
                    type: number
                    description: Number of account credits this request consumed.
                  data:
                    type: object
                    properties:
                      username:
                        type: string
                        description: GitHub login the contributions belong to.
                      from:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: ISO-8601 start of the contribution window (inclusive).
                      to:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: ISO-8601 end of the contribution window (inclusive).
                      totalContributions:
                        anyOf:
                          - type: number
                          - type: 'null'
                        description: Total contributions in the calendar window.
                      totalCommitContributions:
                        anyOf:
                          - type: number
                          - type: 'null'
                        description: Commits contributed in the window.
                      totalIssueContributions:
                        anyOf:
                          - type: number
                          - type: 'null'
                        description: Issues opened in the window.
                      totalPullRequestContributions:
                        anyOf:
                          - type: number
                          - type: 'null'
                        description: Pull requests opened in the window.
                      totalPullRequestReviewContributions:
                        anyOf:
                          - type: number
                          - type: 'null'
                        description: Pull request reviews in the window.
                      totalRepositoryContributions:
                        anyOf:
                          - type: number
                          - type: 'null'
                        description: New repositories created in the window.
                      restrictedContributionsCount:
                        anyOf:
                          - type: number
                          - type: 'null'
                        description: >-
                          Private/anonymized contributions not otherwise
                          counted.
                      days:
                        type: array
                        items:
                          type: object
                          properties:
                            date:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: Calendar day, e.g. "2026-07-25".
                            count:
                              anyOf:
                                - type: number
                                - type: 'null'
                              description: Number of contributions on that day.
                            weekday:
                              anyOf:
                                - type: number
                                - type: 'null'
                              description: Day of week, 0 (Sunday) through 6 (Saturday).
                            color:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: >-
                                Hex color GitHub renders for that day, e.g.
                                "#216e39".
                          required:
                            - date
                            - count
                            - weekday
                            - color
                          additionalProperties: false
                        description: Flattened per-day contribution calendar.
                    required:
                      - username
                      - from
                      - to
                      - totalContributions
                      - totalCommitContributions
                      - totalIssueContributions
                      - totalPullRequestContributions
                      - totalPullRequestReviewContributions
                      - totalRepositoryContributions
                      - restrictedContributionsCount
                      - days
                    additionalProperties: false
                required:
                  - timeMs
                  - creditsCost
                  - data
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
        '402':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: typescript
          label: Bridgly SDK
          source: |-
            import { Bridgly } from 'bridgly';

            const client = new Bridgly({ apiKey: process.env.BRIDGLY_API_KEY });

            const res = await client.github.getContributions({
              username: "string",
            });
            if (res.type === 'success') console.log(res.data);
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A Bridgly API key (`bgly_…`). Metered endpoints deduct credits from the
        resolved account.

````