GitHub Enterprise Server Statistics API

Server statistics

Operations 1

GET /enterprise-installation/{enterprise_or_org}/server-statistics Get GitHub Enterprise Server statistics #

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/github-enterprise:github-enterprise-server-statistics-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

github-enterprise-server-statistics-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Github Enterprise Server Statistics API
  version: 1.1.4
  contact:
    name: Support
    url: https://support.github.com/contact?tags=dotcom-rest-api
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  termsOfService: https://docs.github.com/articles/github-terms-of-service
  x-github-plan: ghec
  description: 'Operations tagged server-statistics across 2 of this provider''s published API definitions: github-enterprise-ghec-openapi.json, github-enterprise-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.github.com
tags:
- name: server-statistics
  description: Server statistics
paths:
  /enterprise-installation/{enterprise_or_org}/server-statistics:
    get:
      summary: Get GitHub Enterprise Server statistics
      description: 'Returns aggregate usage metrics for your GitHub Enterprise Server 3.5+ instance for a specified time period up to 365 days.


        To use this endpoint, your GitHub Enterprise Server instance must be connected to GitHub Enterprise Cloud using GitHub Connect. You must enable Server Statistics, and for the API request provide your enterprise account name or organization name connected to the GitHub Enterprise Server. For more information, see "Enabling Server Statistics for your enterprise" in the GitHub Enterprise Server documentation.


        OAuth app tokens and personal access tokens (classic) need:

        - the `read:enterprise` scope if you connected your GitHub Enterprise Server to an enterprise account and enabled Server Statistics

        - the `read:org` scope if you connected your GitHub Enterprise Server to an organization account and enabled Server Statistics


        > [!NOTE]

        > The "Enterprise administration" fine-grained permission is not available to callers. To use this API, you must use an OAuth app token or a personal access token (classic), or another supported fine-grained permission.'
      operationId: enterprise-admin/get-server-statistics
      tags:
      - server-statistics
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/admin-stats#get-github-enterprise-server-statistics
      parameters:
      - $ref: '#/components/parameters/enterprise-or-org'
      - name: date_start
        description: A cursor, as given in the [Link header](https://docs.github.com/enterprise-cloud@latest/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events after this cursor.
        in: query
        required: false
        schema:
          type: string
      - name: date_end
        description: A cursor, as given in the [Link header](https://docs.github.com/enterprise-cloud@latest/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events before this cursor.
        in: query
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/server-statistics'
              examples:
                default:
                  $ref: '#/components/examples/server-statistics'
      x-github:
        githubCloudOnly: true
        enabledForGitHubApps: false
        category: enterprise-admin
        subcategory: admin-stats
    servers:
    - url: https://api.github.com
components:
  schemas:
    server-statistics:
      title: Server Statistics Proxy Endpoint
      description: Response of S4 Proxy endpoint that provides GHES statistics
      type: array
      items:
        type: object
        properties:
          server_id:
            type: string
          collection_date:
            type: string
          schema_version:
            type: string
          ghes_version:
            type: string
          host_name:
            type: string
          github_connect:
            type: object
            properties:
              features_enabled:
                type: array
                items:
                  type: string
          ghe_stats:
            type: object
            properties:
              comments:
                type: object
                properties:
                  total_commit_comments:
                    type: integer
                  total_gist_comments:
                    type: integer
                  total_issue_comments:
                    type: integer
                  total_pull_request_comments:
                    type: integer
              gists:
                type: object
                properties:
                  total_gists:
                    type: integer
                  private_gists:
                    type: integer
                  public_gists:
                    type: integer
              hooks:
                type: object
                properties:
                  total_hooks:
                    type: integer
                  active_hooks:
                    type: integer
                  inactive_hooks:
                    type: integer
              issues:
                type: object
                properties:
                  total_issues:
                    type: integer
                  open_issues:
                    type: integer
                  closed_issues:
                    type: integer
              milestones:
                type: object
                properties:
                  total_milestones:
                    type: integer
                  open_milestones:
                    type: integer
                  closed_milestones:
                    type: integer
              orgs:
                type: object
                properties:
                  total_orgs:
                    type: integer
                  disabled_orgs:
                    type: integer
                  total_teams:
                    type: integer
                  total_team_members:
                    type: integer
              pages:
                type: object
                properties:
                  total_pages:
                    type: integer
              pulls:
                type: object
                properties:
                  total_pulls:
                    type: integer
                  merged_pulls:
                    type: integer
                  mergeable_pulls:
                    type: integer
                  unmergeable_pulls:
                    type: integer
              repos:
                type: object
                properties:
                  total_repos:
                    type: integer
                  root_repos:
                    type: integer
                  fork_repos:
                    type: integer
                  org_repos:
                    type: integer
                  total_pushes:
                    type: integer
                  total_wikis:
                    type: integer
              users:
                type: object
                properties:
                  total_users:
                    type: integer
                  admin_users:
                    type: integer
                  suspended_users:
                    type: integer
          dormant_users:
            type: object
            properties:
              total_dormant_users:
                type: integer
              dormancy_threshold:
                type: string
          actions_stats:
            $ref: '#/components/schemas/server-statistics-actions'
          packages_stats:
            $ref: '#/components/schemas/server-statistics-packages'
    server-statistics-actions:
      type: object
      description: Actions metrics that are included in the Server Statistics payload/export from GHES
      properties:
        number_of_repos_using_actions:
          description: The total number of repositories in a GHES installation that have Actions enabled
          type: integer
        percentage_of_repos_using_actions:
          description: The percentage of repositories in a GHES installation that have Actions enabled
          type: string
    server-statistics-packages:
      type: object
      description: Packages metrics that are included in the Server Statistics payload/export from GHES
      properties:
        registry_enabled:
          description: Whether GitHub Packages is enabled globally in a GHES installation
          type: boolean
        registry_v2_enabled:
          description: Whether a beta registry is enabled in a GHES installation
          type: boolean
        ecosystems:
          description: The details of the package ecosystems that are enabled in a GHES installation
          type: array
          items:
            type: object
            properties:
              name:
                description: The name of the package ecosystem
                type: string
                enum:
                - npm
                - maven
                - docker
                - nuget
                - rubygems
                - containers
              enabled:
                description: Shows if a package system is enabled, disabled, or read-only in a GHES installation
                type: string
                enum:
                - 'TRUE'
                - 'FALSE'
                - READONLY
              published_packages_count:
                description: The total number of published packages in a package ecosystem in a GHES installation
                type: integer
              private_packages_count:
                description: The total number of private packages in a package ecosystem in a GHES installation
                type: integer
              public_packages_count:
                description: The total number of public packages in a package ecosystem in a GHES installation
                type: integer
              internal_packages_count:
                description: The total number of internal packages in a package ecosystem in a GHES installation
                type: integer
              user_packages_count:
                description: The total number of user packages in a package ecosystem in a GHES installation
                type: integer
              organization_packages_count:
                description: The total number of organization packages in a package ecosystem in a GHES installation
                type: integer
              daily_download_count:
                description: The total number of packages in an ecosystem that have been downloaded in the 24 hours prior to `collection_date` for a GHES installation
                type: integer
              daily_update_count:
                description: The total number of packages in an ecosystem that have been updated in the 24 hours prior to `collection_date` for a GHES installation
                type: integer
              daily_delete_count:
                description: The total number of packages in an ecosystem that have been deleted in the 24 hours prior to `collection_date` for a GHES installation
                type: integer
              daily_create_count:
                description: The total number of packages in an ecosystem that have been created in the 24 hours prior to `collection_date` for a GHES installation
                type: integer
  examples:
    server-statistics:
      value:
      - server_id: ea6088f3-f095-4bf2-8d7f-c573819e8768
        collection_date: '2021-12-14T23:59:59Z'
        schema_version: '20230306'
        ghes_version: 3.9.0
        host_name: github.example.com
        github_connect:
          features_enabled:
          - license_usage_sync
          - content_analysis
          - content_analysis_notifications
        ghe_stats:
          comments:
            total_commit_comments: 1000
            total_gist_comments: 1000
            total_issue_comments: 0
            total_pull_request_comments: 0
          gists:
            total_gists: 100
            private_gists: 59
            public_gists: 41
          hooks:
            total_hooks: 2
            active_hooks: 1
            inactive_hooks: 1
          issues:
            total_issues: 3421
            open_issues: 1234
            closed_issues: 1222
          milestones:
            total_milestones: 50
            open_milestones: 20
            closed_milestones: 30
          orgs:
            total_orgs: 100
            disabled_orgs: 22
            total_teams: 299
            total_team_members: 400
          pages:
            total_pages: 10
          pulls:
            total_pulls: 1232
            merged_pulls: 223
            mergeable_pulls: 435
            unmergeable_pulls: 0
          repos:
            total_repos: 12
            root_repos: 1
            fork_repos: 2
            org_repos: 1
            total_pushes: 42
            total_wikis: 1
          users:
            total_users: 2000
            admin_users: 299
            suspended_users: 423
        dormant_users:
          total_dormant_users: 5
          dormancy_threshold: 90 days
        actions_stats:
          $ref: server-statistics-actions.yaml
        packages_stats:
          $ref: server-statistics-packages.yaml
        advisory_db_stats:
          $ref: server-statistics-advisory-db.yaml
  parameters:
    enterprise-or-org:
      name: enterprise_or_org
      description: The slug version of the enterprise name or the login of an organization.
      in: path
      required: true
      schema:
        type: string
externalDocs:
  description: GitHub Enterprise Cloud REST API
  url: https://docs.github.com/enterprise-cloud@latest/rest/
x-refined-from:
- github-enterprise-ghec-openapi.json
- github-enterprise-openapi.yml