GitHub Count API

The Count API from GitHub — 2 operation(s) for count.

Documentation

📖
Documentation
https://docs.github.com/en/rest/apps
📖
Documentation
https://docs.github.com/en/rest/codes-of-conduct/codes-of-conduct
📖
Documentation
https://docs.github.com/en/rest/emojis
📖
Documentation
https://docs.github.com/en/rest/gitignore
📖
Documentation
https://docs.github.com/en/rest/apps/installations
📖
Documentation
https://docs.github.com/en/rest/enterprise-admin
📖
Documentation
https://docs.github.com/en/rest/activity/events
📖
Documentation
https://docs.github.com/en/rest/orgs
📖
Documentation
https://docs.github.com/en/rest/rate-limit
📖
Documentation
https://docs.github.com/en/enterprise-cloud@latest/rest/scim
📖
Documentation
https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api
📖
Documentation
https://docs.github.com/en/rest/teams
📖
Documentation
https://docs.github.com/en/rest/meta/meta
📖
Documentation
https://docs.github.com/en/rest/actions
📖
Documentation
https://docs.github.com/en/rest/branches
📖
Documentation
https://docs.github.com/en/rest/code-scanning
📖
Documentation
https://docs.github.com/en/rest/collaborators
📖
Documentation
https://docs.github.com/en/rest/dependabot
📖
Documentation
https://docs.github.com/en/rest/webhooks
📖
Documentation
https://docs.github.com/en/rest/pulls
📖
Documentation
https://docs.github.com/en/rest/git/tags
📖
Documentation
https://docs.github.com/en/rest/repos/autolinks
📖
Documentation
https://docs.github.com/en/rest/collaborators/invitations

Specifications

Other Resources

OpenAPI Specification

github-count-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: 1.1.4
  title: github-repos-api Count API
  description: 'Use the REST API to create, manage and control the workflow of public and

    private GitHub repositories.'
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  termsOfService: https://docs.github.com/articles/github-terms-of-service
  contact:
    name: Support
    url: https://support.github.com/contact
servers:
- url: '{protocol}://{hostname}'
  variables:
    hostname:
      description: Self-hosted Enterprise Server hostname
      default: api.github.com
    protocol:
      description: Self-hosted Enterprise Server protocol
      default: https
tags:
- name: Count
paths:
  /repos/{owner}/{repo}/stats/participation:
    get:
      summary: GitHub Get the Weekly Commit Count
      description: 'Returns the total commit counts for the `owner` and total commit counts in `all`. `all` is everyone combined, including the `owner` in the last 52 weeks. If you''d like to get the commit counts for non-owners, you can subtract `owner` from `all`.


        The array order is oldest week (index 0) to most recent week.


        The most recent week is seven days ago at UTC midnight to today at UTC midnight.'
      tags:
      - Count
      operationId: getTheWeeklyCommitCount
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/metrics/statistics#get-the-weekly-commit-count
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: The array order is oldest week (index 0) to most recent week.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/participation-stats'
              examples:
                default:
                  $ref: '#/components/examples/participation-stats'
        '404':
          $ref: '#/components/responses/not_found'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: metrics
        subcategory: statistics
      x-api-evangelist-certified: '2025-07-16'
      x-api-naftiko-published: '2025-07-25'
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repos/{owner}/{repo}/stats/punch_card:
    get:
      summary: GitHub Get the Hourly Commit Count for Each Day
      description: 'Each array contains the day number, hour number, and number of commits:


        *   `0-6`: Sunday - Saturday

        *   `0-23`: Hour of day

        *   Number of commits


        For example, `[2, 14, 25]` indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits.'
      tags:
      - Count
      operationId: getTheHourlyCommitCountForEachDay
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: For example, `[2, 14, 25]` indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/code-frequency-stat'
              examples:
                default:
                  $ref: '#/components/examples/code-frequency-stat-items-2'
        '204':
          $ref: '#/components/responses/no_content'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: metrics
        subcategory: statistics
      x-api-evangelist-certified: '2025-07-16'
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  responses:
    no_content:
      description: header with no content is returned.
    not_found:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
  schemas:
    participation-stats:
      title: Participation Stats
      type: object
      properties:
        all:
          type: array
          items:
            type: integer
        owner:
          type: array
          items:
            type: integer
      required:
      - all
      - owner
    code-frequency-stat:
      title: Code Frequency Stat
      description: Code Frequency Stat
      type: array
      items:
        type: integer
    basic-error:
      title: Basic Error
      description: Basic Error
      type: object
      properties:
        message:
          type: string
          example: Example body text
        documentation_url:
          type: string
          example: https://api.github.com/repos/octocat/Hello-World
        url:
          type: string
          example: https://api.github.com/repos/octocat/Hello-World
        status:
          type: string
          example: open
  examples:
    code-frequency-stat-items-2:
      value:
      - - 0
        - 0
        - 5
      - - 0
        - 1
        - 43
      - - 0
        - 2
        - 21
    participation-stats:
      value:
        all:
        - 11
        - 21
        - 15
        - 2
        - 8
        - 1
        - 8
        - 23
        - 17
        - 21
        - 11
        - 10
        - 33
        - 91
        - 38
        - 34
        - 22
        - 23
        - 32
        - 3
        - 43
        - 87
        - 71
        - 18
        - 13
        - 5
        - 13
        - 16
        - 66
        - 27
        - 12
        - 45
        - 110
        - 117
        - 13
        - 8
        - 18
        - 9
        - 19
        - 26
        - 39
        - 12
        - 20
        - 31
        - 46
        - 91
        - 45
        - 10
        - 24
        - 9
        - 29
        - 7
        owner:
        - 3
        - 2
        - 3
        - 0
        - 2
        - 0
        - 5
        - 14
        - 7
        - 9
        - 1
        - 5
        - 0
        - 48
        - 19
        - 2
        - 0
        - 1
        - 10
        - 2
        - 23
        - 40
        - 35
        - 8
        - 8
        - 2
        - 10
        - 6
        - 30
        - 0
        - 2
        - 9
        - 53
        - 104
        - 3
        - 3
        - 10
        - 4
        - 7
        - 11
        - 21
        - 4
        - 4
        - 22
        - 26
        - 63
        - 11
        - 2
        - 14
        - 1
        - 10
        - 3
  parameters:
    owner:
      name: owner
      description: The account owner of the repository. The name is not case sensitive.
      in: path
      required: true
      schema:
        type: string
    repo:
      name: repo
      description: The name of the repository without the `.git` extension. The name is not case sensitive.
      in: path
      required: true
      schema:
        type: string
  securitySchemes:
    bearerHttpAuthentication:
      description: Bearer Token
      type: http
      scheme: Bearer
externalDocs:
  description: GitHub Enterprise Developer Docs
  url: https://docs.github.com/enterprise-server@3.9/rest/