# How to Query GitHub Copilot Usage Metrics via GitHub API

Relying on subjective developer surveys fails to measure actual adoption. This guide explains how to query GitHub Copilot usage metrics via GitHub API, download daily telemetry reports, and parse the raw Newline-Delimited JSON (NDJSON) payload. Learn how to centralize these metrics into shared workspaces for custom reporting and analysis.

Source: https://fast.io/resources/how-to-query-github-copilot-usage-metrics-via-github-api/
Last reviewed: 2026-08-20

## Understanding GitHub Copilot metrics and data boundaries

Relying on developers to self-report how much they use AI coding assistants produces highly subjective data that fails to measure actual adoption. When administrators need to evaluate the return on investment for high-cost tool seats, they must bypass surveys and query raw metrics directly via the GitHub API.

GitHub Copilot usage data helps managers identify feature adoption rates, completions acceptance ratios, and chat engagement across different teams. The GitHub Copilot usage metrics REST API provides programmatic access to these statistics. This API returns data aggregated at the enterprise and organization level. This means you can monitor high-level activity without accessing individual code repositories or violating developer privacy.

For organizations using GitHub Enterprise Cloud, the REST API returns historical daily usage data for up to 1 year. This rolling window allows you to analyze long-term trends, such as adoption progress before and after team training sessions. However, the data is not real-time. GitHub applies a daily processing lag, meaning the metrics for a given day are usually available in early 2026. Furthermore, if a developer disables IDE telemetry settings, their activity is excluded from the reports.

Historically, administrators queried these metrics through a direct JSON API. However, GitHub sunsetted the legacy endpoint in early 2026. Attempts to query the legacy path now return a not found error. The updated API replaces direct JSON responses with download links to Newline-Delimited JSON (NDJSON) reports. This change is designed to handle larger datasets efficiently without hitting API response limits. Understanding this report-based workflow is the first step to building automated telemetry pipelines.

## How to query GitHub Copilot usage metrics via GitHub API endpoints

Retrieving usage data under the new system requires a two-step query process. Instead of fetching the metrics in a single API call, your integration queries GitHub to request a signed download link. GitHub returns a temporary URL that points to a cloud storage bucket containing the NDJSON file. Your script must then download the file from that URL and parse it line-by-line.

The REST API provides distinct endpoints for organization and enterprise levels. For organizations, the primary daily metrics endpoint is `GET /orgs/{org}/copilot/metrics/reports/organization-1-day`. For enterprises, the corresponding path is `GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day`. Both endpoints require a `day` query parameter formatted as `YYYY-MM-DD` to specify the reporting date.

If you want to view a rolling summary, you can request the 28-day report. The endpoint for organization-level summary reports is `GET /orgs/{org}/copilot/metrics/reports/organization-28-day/latest`. The enterprise path is `GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest`. The 28-day reports provide a pre-aggregated view of developer activity over the preceding four weeks.

Accessing these endpoints requires configuring specific permissions and authentication headers. You must include the `Accept: application/vnd.github+json` header on all requests. You must also include the `X-GitHub-Api-Version` header set to `2022-11-28`. To authorize the request, you can use a classic Personal Access Token with the `read:org` scope for organization queries or the `read:enterprise` scope for enterprise queries. Alternatively, you can use a fine-grained personal access token with the read-only Organization Copilot metrics or Enterprise Copilot metrics permission. The requesting user must hold an administrative role in the target organization or enterprise, such as Organization Owner, Billing Manager, or Enterprise Admin.

## Executing requests and parsing NDJSON payloads

To fetch the download link for a daily report, you can use a standard curl command. The following shell command sends a request to the organization report endpoint for a specific day:

```bash
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer YOUR_GITHUB_PAT" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  "https://api.github.com/orgs/acme-corp/copilot/metrics/reports/organization-1-day?day=2026-08-18"
```

GitHub processes the request and returns a JSON payload containing the download links. The following block shows the structure of the API response:

```json
{
  "download_links": [
    "https://github-production-user-asset-6210df.s3.amazonaws.com/copilot-reports/acme-corp-org-1-day-2026-08-18.ndjson?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Signature=vj7yPn9alv%2FZE%3D&Expires=1787123456"
  ],
  "report_day": "2026-08-18"
}
```

The signed link returned in the array is temporary and usually expires after a short period. Your application must download the file before the signature expires. The downloaded file is in NDJSON format, where each line represents a separate, valid JSON object.

A single line of the downloaded NDJSON report contains detailed telemetry metrics. The following example shows a parsed daily record, including feature-level breakdowns by language, editor, and model:

```json
{
  "day": "2026-08-18",
  "enterprise_id": 987654,
  "organization_id": 123456,
  "organization_name": "acme-corp",
  "total_active_users": 150,
  "total_suggestions_count": 12500,
  "total_acceptances_count": 3125,
  "total_lines_suggested": 85000,
  "total_lines_accepted": 19200,
  "total_chat_turns": 450,
  "total_chat_acceptances": 180,
  "breakdown": [
    {
      "language": "typescript",
      "editor": "vscode",
      "model": "claude-3.5-sonnet",
      "feature": "completions",
      "suggestions_count": 4500,
      "acceptances_count": 1200,
      "lines_suggested": 30000,
      "lines_accepted": 7500
    },
    {
      "language": "python",
      "editor": "pycharm",
      "model": "gpt-4o",
      "feature": "completions",
      "suggestions_count": 3500,
      "acceptances_count": 875,
      "lines_suggested": 25000,
      "lines_accepted": 5500
    },
    {
      "language": "typescript",
      "editor": "vscode",
      "model": "claude-3.5-sonnet",
      "feature": "chat",
      "chat_turns": 300,
      "chat_acceptances": 130
    }
  ]
}
```

To calculate the completions acceptance rate, divide the total acceptances by the total suggestions. For instance, in our sample data, dividing the TypeScript acceptances by the suggestions yields the TypeScript adoption ratio, while doing the same for Python yields the Python adoption ratio. Likewise, the line utilization rate is computed by dividing the accepted lines of code by the suggested lines.

You can automate this download and parsing flow using a script. The following Python script retrieves the signed URL, downloads the NDJSON file, parses the JSON objects line-by-line, and prints the aggregated acceptance rates:

```python
import json
import requests

GITHUB_TOKEN = "YOUR_GITHUB_PAT"
ORG_NAME = "acme-corp"
REPORT_DATE = "2026-08-18"

url = f"https://api.github.com/orgs/{ORG_NAME}/copilot/metrics/reports/organization-1-day"
headers = {
    "Accept": "application/vnd.github+json",
    "Authorization": f"Bearer {GITHUB_TOKEN}",
    "X-GitHub-Api-Version": "2022-11-28"
}
params = {"day": REPORT_DATE}

response = requests.get(url, headers=headers, params=params)
response.raise_for_status()
data = response.json()

download_url = data["download_links"][0]
report_response = requests.get(download_url, stream=True)
report_response.raise_for_status()

for line in report_response.iter_lines():
    if line:
        record = json.loads(line)
        day = record["day"]
        active = record["total_active_users"]
        suggestions = record["total_suggestions_count"]
        acceptances = record["total_acceptances_count"]
        lines_suggested = record["total_lines_suggested"]
        lines_accepted = record["total_lines_accepted"]
        
        acc_rate = (acceptances / suggestions) * 100 if suggestions > 0 else 0
        line_util = (lines_accepted / lines_suggested) * 100 if lines_suggested > 0 else 0
        
        print(f"Date: {day}")
        print(f"Active Users: {active}")
        print(f"Completions Acceptance Rate: {acc_rate:.2f}%")
        print(f"Line Utilization: {line_util:.2f}%")
```

## How to map team metrics by joining reports

While organization-wide statistics show broad trends, they do not help identify which specific teams are lagging in adoption. The API does not pre-aggregate usage metrics by team. Instead, you must download the user-teams report and join it with the per-user usage report.

To aggregate metrics by team, you query the user-teams mapping endpoint: `GET /orgs/{org}/copilot/metrics/reports/user-teams-1-day`. This endpoint returns a download link to an NDJSON file containing the user IDs and the team memberships associated with them. The following block shows a sample object from this report:

```json
{
  "day": "2026-08-18",
  "user_id": 445566,
  "user_login": "dev-user-01",
  "teams": ["frontend-team", "engineering-core"]
}
```

Next, download the user-level usage report from the endpoint: `GET /orgs/{org}/copilot/metrics/reports/users-1-day`. This file contains the activity metrics for each user. A single line looks like the following object:

```json
{
  "day": "2026-08-18",
  "user_id": 445566,
  "suggestions_count": 85,
  "acceptances_count": 22,
  "lines_suggested": 450,
  "lines_accepted": 120
}
```

To aggregate these metrics by team, write a script to join the two reports on the `user_id` and `day` fields. For each user, retrieve their team list from the user-teams report. Then, attribute their suggestions and acceptances to those teams. This join recipe allows you to calculate the acceptance rates for the frontend team versus the backend team, helping you locate where developer enablement or training is most needed.

Because user-level files can contain thousands of lines for large organizations, parsing them locally on every developer machine is inefficient. Many engineering teams automate this process by running the join script in a container and saving the output files.

## Why store and query telemetry in intelligent workspaces

Once you have parsed the raw NDJSON reports into structured CSV or JSON files, you need a shared place to store and analyze them. Storing these reports in local folders restricts access, while uploading them to raw object storage like Amazon S3 requires setting up separate databases and search indexes just to make them readable. This manual setup increases complexity and introduces synchronization lag.

An intelligent workspace provides a more efficient solution by indexing files automatically on arrival. By uploading the parsed metrics to a [Fastio workspace](/product/workspaces/), teams can search, share, and query their telemetry data without managing database infrastructure. Fast.io combines exact full-text matching with semantic retrieval in its hybrid search engine. This allows managers to search for specific dates or metrics using natural language.

To turn these reports into structured, queryable databases, Fast.io includes [Metadata Views](/product/document-data-extraction/). Instead of writing custom database schemas, you upload your CSV or JSON metrics files, and the system suggests columns with field types such as Text, Integer, Decimal, Boolean, URL, JSON, and Date & Time. You can describe the fields you want extracted in plain English, and the AI matches the files in the workspace and populates a filterable spreadsheet. If you need to track a new metric, such as monthly active seats, you can add a column without reprocessing existing files. This structured data grid is accessible to both human administrators and AI coding agents.

For developers who want to access these metrics programmatically, Fast.io provides a remote Model Context Protocol (MCP) server. The server exposes a consolidated MCP toolset over a Streamable HTTP transport at `https://mcp.fast.io/mcp` (or legacy Server-Sent Events at `https://mcp.fast.io/sse`). AI agents can connect to this endpoint to read, query, and edit files. When an agent needs key-based authentication, configure it to send requests to `https://mcp.fast.io/mcp/key`, passing the organization API key via the Authorization Bearer header. The following example shows how to configure this connection in a standard MCP settings file:

```json
{
  "mcpServers": {
    "fastio-telemetry": {
      "url": "https://mcp.fast.io/mcp/key",
      "headers": {
        "Authorization": "Bearer fastio_sec_key_your_actual_token"
      }
    }
  }
}
```

Once connected, the agent can query the Metadata View to retrieve usage trends. For example, a monthly analysis agent can fetch the average acceptance rate for the previous month and write an executive summary directly into a note. Because Fast.io Notes supports Google-Docs-style co-editing with live multiplayer cursors, human managers and AI agents can collaborate on these summaries in real time. These notes are automatically indexed for AI grounding, making them immediately searchable. If a script or agent makes an error during an update, the per-file version history allows you to view the changes and restore a previous version. This maintains a complete audit trail without requiring complex file mirroring.

## Security and privacy governance for telemetry data

Telemetry reports contain sensitive information, including user logins and team memberships. Protecting this data is critical for compliance and developer trust. While Fast.io runs on cloud infrastructure partners, including Google Cloud Platform and Cloudflare, that are certified to industry-leading security standards, the platform itself enforces security through built-in access controls.

First, granular permissions allow you to restrict access at the organization, workspace, folder, or file level. You can scope your telemetry folder so that only organization owners and billing managers can read it. AI agents that connect via the MCP server are restricted by these same permissions, ensuring they cannot read files outside their designated workspace.

Second, Fast.io maintains an append-only audit log. This log acts as an immutable record of every user and agent action, including file reads, writes, and sharing changes. This provides a clear chain of custody, helping administrators verify who accessed the usage metrics and when. If you share a summary report with external stakeholders, you can use branded shares with access controls that support password protection and expiration dates. This prevents unauthorized sharing and ensures that access is automatically revoked when a project ends.

To start managing your team's metrics, you can create a free account and set up a workspace. Every organization starts with a 14-day free trial, which requires a credit card. Subscription plans are designed to scale:

* **Starter plan:** $29/month ($24/month billed annually) for individual developers, offering 1 TB of storage and 300,000 monthly credits
* **Business plan:** $99/month ($83/month billed annually) for teams up to 20 seats, offering 10 TB of storage and 1,200,000 monthly credits
* **Growth plan:** $299/month ($249/month billed annually) for larger teams up to 50 seats, offering 50 TB of storage and 4,500,000 monthly credits

This credit-based pricing model ensures that you pay only for the storage and compute resources your team consumes.

## Frequently asked questions

### How do I see GitHub Copilot usage?

You can view Copilot usage by navigating to your enterprise or organization page on GitHub.com, selecting the Insights tab, and clicking Copilot usage in the left sidebar. Alternatively, you can query the REST API to retrieve downloadable daily telemetry reports.

### What permissions are needed to read Copilot metrics?

You must be an organization owner, billing manager, or enterprise administrator to access Copilot usage metrics. Alternatively, a custom role with the View Organization Copilot Metrics permission can query these endpoints. If authenticating via a personal access token, the token must hold the read:org or read:enterprise scope, or the specific fine-grained read permission for Copilot metrics.

### Does GitHub Copilot have a usage reporting API?

Yes, GitHub provides REST API endpoints under the copilot/metrics/reports path. These endpoints return JSON payloads containing temporary, signed download links. You can use these links to download raw telemetry data in NDJSON format, which includes daily active users, code suggestions, and acceptances.

## About Fast.io

Fast.io provides shared workspaces where people and AI agents work on the same files, with built-in semantic search and citation-backed chat over what they hold. Agents reach it through a remote MCP server at https://mcp.fast.io/mcp, a REST API at https://api.fast.io/current/, and a command line client published on npm as @vividengine/fastio-cli.
