Code Review Metrics API: Pull PR Data, Approvability, and Engineering Productivity
The Macroscope API lets you pull code review statistics, Approvability verdicts, Check Run Agent performance, engineering productivity metrics, and billing data into your scripts, dashboards, and coding agents.
The Macroscope API gives you programmatic access to code review statistics, Approvability verdicts, Check Run Agent performance, engineering productivity metrics, and billing data. Pull this data into a dashboard, a weekly report script, a data pipeline, or hand it to a coding agent.
This guide covers what the Macroscope API returns, how to get a key, authentication, and practical recipes for using code review metrics in your workflows.
Does Macroscope have an API?
Yes. Workspace admins can create an API key under Settings, and the API returns JSON for workspace data including code review statistics, Approvability runs, commits, contributor statistics, and billing. The base URL is https://api.macroscope.com/api/v1, and all endpoints are scoped to a workspace.
The API was announced in November 2026. See the launch post for the overview and the API docs for the full endpoint reference.
What can you pull from the Macroscope API?
The API returns code review performance, Approvability data, engineering productivity statistics, commits, and billing.
| Category | What it returns |
|---|---|
| Code review statistics | PRs reviewed, comments posted, addressed rate, 10-week trend |
| Code review comments | Posted inline and issue comments with current feedback |
| Approvability statistics | Verdict counts (APPROVED, WOULD_APPROVE, NOT_APPROVED, SKIPPED), approval rate, trend of up to 120 periods |
| Approvability runs | Individual runs with verdicts, eligibility and correctness reasoning, and PR context |
| Contributor statistics | Per-contributor effort, commits, PRs, and score |
| Team statistics | Per-team effort, commits, and score |
| Coding time statistics | Weekly coding time and commit trend |
| Sprint reports | Effort and commits by area, compared to last sprint |
| Commits | Recorded commits with available summaries, attribution, and estimates |
| Check Run Agent billing | Credit usage grouped by repository and check-run agent |
| Billing | Credit balance, usage this period, daily usage, spend limits |
API calls do not run agents. Read keys read workspace data; Write and Admin keys can also change settings and, at Admin, manage digest, log export, teams, and delegated admins.
How do you get an API key?
Workspace admins create a key under Settings, API. The workspace needs an active subscription.
- Go to Settings, then API.
- Select Create API key.
- Enter a Name and choose when the key expires. The default is 90 days, and the maximum is one year.
- Under Access level, choose Read, Write, or Admin.
- Copy the key and save it securely before closing the dialog. The key is shown only once.
What is the difference between Read, Write and Admin API keys?
Read keys read supported workspace data. Write keys can also change settings. Admin keys can read detailed billing and manage workspace administration.
| Access level | What the key can do |
|---|---|
| Read | Read supported workspace data, including repository settings and defaults, except detailed billing. |
| Write | Read workspace data, change settings that require Write on a tracked repository, change the workspace's Custom Agent Instructions and Product Overview, manage digest subscriptions. |
| Admin | Everything with Write, plus detailed billing reads, Admin-level repository settings, repository defaults, workspace settings, teams, log export, and delegated admins. |
Most integrations that pull metrics need only a Read key. If you need billing detail (balance, daily usage, check-run agent summaries), use an Admin key.
How do you authenticate?
Send the key as a bearer token in the Authorization header with each request.
curl https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/$MACROSCOPE_WORKSPACE_ID \
-H "Authorization: Bearer $MACROSCOPE_API_KEY"
Set MACROSCOPE_WORKSPACE_ID to your GitHub organization's numeric ID. Find it with gh api orgs/YOUR_ORG --jq .id.
All endpoint paths are scoped to a workspace:
/workspaces/{workspaceType}/{workspaceId}
| Parameter | Value |
|---|---|
workspaceType | GITHUB_ORGANIZATION or GITHUB_USER |
workspaceId | The numeric GitHub ID of the org or user, as a string |
What endpoints return code review data?
Two endpoints cover code review performance: code-review-statistics and code-review-comments.
Query code review statistics
Returns PRs reviewed, comments posted, addressed rate, and a 10-week trend.
curl "https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/$MACROSCOPE_WORKSPACE_ID/code-review-statistics?startTime=2026-11-01T00:00:00Z&endTime=2026-11-30T00:00:00Z" \
-H "Authorization: Bearer $MACROSCOPE_API_KEY"
The startTime and endTime parameters are required (RFC 3339 format). The endTime is inclusive.
List code review comments
Returns posted inline and issue comments with current feedback (thumbs up or down from developers).
curl "https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/$MACROSCOPE_WORKSPACE_ID/code-review-comments" \
-H "Authorization: Bearer $MACROSCOPE_API_KEY"
This endpoint is paginated. Set pageSize (1 to 200, default 50), then pass nextPageToken as pageToken until it is absent.
How do you get Approvability data from the Macroscope API?
Two endpoints return Approvability data: approvability-statistics for aggregate metrics and approval rates, and approvability-runs for individual verdicts with reasoning.
Query Approvability statistics
Returns verdict counts (APPROVED, WOULD_APPROVE, NOT_APPROVED, SKIPPED), approval rate, and a trend of up to 120 periods.
curl "https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/$MACROSCOPE_WORKSPACE_ID/approvability-statistics?startTime=2026-11-01T00:00:00Z&endTime=2026-11-30T00:00:00Z" \
-H "Authorization: Bearer $MACROSCOPE_API_KEY"
The startTime and endTime parameters are required (RFC 3339 format). The endTime is exclusive.
List Approvability runs
Returns individual Approvability runs with verdicts, eligibility reasoning, correctness reasoning, and PR context. This endpoint is paginated and defaults to the last 90 days.
curl "https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/$MACROSCOPE_WORKSPACE_ID/approvability-runs" \
-H "Authorization: Bearer $MACROSCOPE_API_KEY"
Each run includes the verdict (APPROVED, WOULD_APPROVE, NOT_APPROVED, or SKIPPED), eligibility and correctness reasoning, and metadata about the PR.
What engineering productivity metrics can you pull from an API?
The Macroscope API returns contributor statistics, team statistics, coding time statistics, sprint reports, and commits.
| Endpoint | What it returns |
|---|---|
/contributorStatistics | Per-contributor effort, commits, PRs, score |
/teamStatistics | Per-team effort, commits, score |
/codingTimeStatistics | Weekly coding time and commit trend |
/workspaceReport | Sprint report: effort and commits by area, vs. last sprint |
/commits | Recorded commits with summaries, attribution, estimates |
These endpoints give you the data behind the Macroscope dashboard in machine-readable form.
Can coding agents use the Macroscope API?
Yes. AI assistants can use the same operations through the Macroscope MCP server. This lets a coding agent pull context about recent PRs, code review quality, or team productivity without leaving its workflow.
For more on MCP integration, see the MCP documentation.
Recipe: Weekly code review quality report
Pull code review statistics and comments into a weekly report.
# Get this week's code review statistics
curl "https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/$MACROSCOPE_WORKSPACE_ID/code-review-statistics?startTime=2026-11-24T00:00:00Z&endTime=2026-11-30T00:00:00Z" \
-H "Authorization: Bearer $MACROSCOPE_API_KEY" \
-o review-stats.json
# Get comments with feedback (defaults to last 90 days)
curl "https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/$MACROSCOPE_WORKSPACE_ID/code-review-comments" \
-H "Authorization: Bearer $MACROSCOPE_API_KEY" \
-o review-comments.json
Parse the JSON to calculate addressed rate, thumbs-up ratio, and trend vs. last week.
Recipe: Approvability approval-rate trend into a dashboard
Pull Approvability statistics with a time series to populate a dashboard chart.
curl "https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/$MACROSCOPE_WORKSPACE_ID/approvability-statistics?startTime=2026-09-01T00:00:00Z&endTime=2026-11-30T00:00:00Z" \
-H "Authorization: Bearer $MACROSCOPE_API_KEY" \
-o approvability-trend.json
The response includes a trend array with up to 120 periods you can chart directly.
Recipe: Feeding PR context to a coding agent
A coding agent can query the API for context about a PR before acting on it.
# Get recent commits
curl "https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/$MACROSCOPE_WORKSPACE_ID/commits?pageSize=20" \
-H "Authorization: Bearer $MACROSCOPE_API_KEY"
The agent can use this to understand what changed recently, check if a file was modified in recent commits, or get commit summaries.
Recipe: Check Run Agent performance tracking
Pull credit usage grouped by repository and check-run agent to track which agents are running and what they cost.
curl "https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/$MACROSCOPE_WORKSPACE_ID/billing/checkRunAgentSummaries" \
-H "Authorization: Bearer $MACROSCOPE_API_KEY"
This requires an Admin key.
How does the Macroscope API compare to GitHub's API?
GitHub's API returns pull request data, review comments, and check runs. The Macroscope API returns Macroscope's analysis of that data: bug detection results, Approvability verdicts, addressed rates, and productivity metrics.
GitHub's REST and GraphQL APIs give you raw PR data. Macroscope's API gives you the insights Macroscope has computed from that data. If you need to know what PRs exist, use GitHub's API. If you need to know what bugs Macroscope found, what Approvability decided, or how your team's code review quality is trending, use Macroscope's API.
For automating actions on GitHub PRs themselves (labels, assignments, comments), see GitHub pull request review API automation.
Pagination and rate limits
Paginated endpoints return up to 200 items per page. Rate limits apply per key and per workspace.
For paginated endpoints (code-review-comments, approvability-runs, commits, billing endpoints), set pageSize (1 to 200, default 50), then pass nextPageToken as pageToken until it is absent.
Rate limit headers (RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset) are returned with responses. If you hit a 429, retry after Retry-After seconds.

Frequently Asked Questions
Can Macroscope pull PR metrics?
Yes. The Macroscope API returns code review statistics (PRs reviewed, comments posted, addressed rate), Approvability verdicts, commits, contributor statistics, and more. Create an API key under Settings, API, and query the endpoints documented at docs.macroscope.com/api.
Does Macroscope have an API?
Yes. The Macroscope REST API launched in November 2026. Workspace admins create keys under Settings, API. The API returns JSON for workspace data including code review statistics, Approvability runs, commits, and billing. See the API docs.
How do I get Approvability data from the Macroscope API?
Query /approvability-statistics for aggregate metrics (verdict counts, approval rate, trend) or /approvability-runs for individual verdicts with reasoning. Both endpoints require dates and return JSON. See the API docs for parameters.
What's the difference between Read, Write and Admin API keys?
Read keys read supported workspace data except detailed billing. Write keys can also change repository settings and manage digest subscriptions. Admin keys add detailed billing reads, repository defaults, and workspace administration. Most metric-pulling use cases need only Read.
What engineering productivity metrics can I pull from an API?
The Macroscope API returns contributor statistics (effort, commits, PRs, score), team statistics, coding time statistics, sprint reports, and commits with summaries. These are the same metrics shown in the Macroscope dashboard, in machine-readable form.
Does the Macroscope API run agents?
No. API calls do not run agents. Read keys read workspace data; Write and Admin keys can also change settings. To run the Macroscope agent from an HTTP request, use Webhooks.
How do I authenticate to the Macroscope API?
Send the API key as a bearer token in the Authorization header: Authorization: Bearer $MACROSCOPE_API_KEY. All endpoints are scoped to a workspace: /workspaces/{workspaceType}/{workspaceId}.
Can I use the Macroscope API from a coding agent?
Yes. AI assistants can use the same operations through the Macroscope MCP server.
How does Macroscope's API compare to GitHub's API?
GitHub's API returns raw PR data. Macroscope's API returns Macroscope's analysis: bug detection results, Approvability verdicts, addressed rates, and productivity metrics. Use GitHub's API for PR operations; use Macroscope's API for review quality metrics.
What is the rate limit on the Macroscope API?
Rate limits apply per key and per workspace. Rate limit headers are returned with responses. If you hit a 429, retry after the Retry-After seconds.
Can I pull Check Run Agent data from the API?
Yes. The /billing/checkRunAgentSummaries endpoint returns credit usage grouped by repository and check-run agent. This requires an Admin key. For more on Check Run Agents, see Check Run Agents.
Where are the full API docs?
At docs.macroscope.com/api. The docs cover authentication, every endpoint, parameters, response formats, pagination, and error handling.
