curl --request GET \
--url https://api.coderabbit.ai/v1/metrics/reviews \
--header 'x-coderabbitai-api-key: <api-key>'import requests
url = "https://api.coderabbit.ai/v1/metrics/reviews"
headers = {"x-coderabbitai-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-coderabbitai-api-key': '<api-key>'}};
fetch('https://api.coderabbit.ai/v1/metrics/reviews', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
{
"pr_url": "https://github.com/org/repo/pull/123",
"organization_id": "184456712",
"organization_name": "<string>",
"repository_id": "<string>",
"author_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"coderabbit_comments": {
"total": {
"posted": 123,
"accepted": 123
},
"severity": {
"critical": {
"posted": 123,
"accepted": 123
},
"major": {
"posted": 123,
"accepted": 123
},
"minor": {
"posted": 123,
"accepted": 123
},
"trivial": {
"posted": 123,
"accepted": 123
},
"info": {
"posted": 123,
"accepted": 123
}
},
"category": {
"DATA_INTEGRITY_AND_INTEGRATION": {
"posted": 123,
"accepted": 123
},
"FUNCTIONAL_CORRECTNESS": {
"posted": 123,
"accepted": 123
},
"MAINTAINABILITY_AND_CODE_QUALITY": {
"posted": 123,
"accepted": 123
},
"PERFORMANCE_AND_SCALABILITY": {
"posted": 123,
"accepted": 123
},
"SECURITY_AND_PRIVACY": {
"posted": 123,
"accepted": 123
},
"STABILITY_AND_AVAILABILITY": {
"posted": 123,
"accepted": 123
}
}
},
"repository_name": "<string>",
"author_username": "<string>",
"ready_for_review_at": "2023-11-07T05:31:56Z",
"first_human_review_at": "2023-11-07T05:31:56Z",
"last_commit_at": "2023-11-07T05:31:56Z",
"merged_at": "2023-11-07T05:31:56Z",
"status": "closed",
"review_iterations": 1,
"estimated_complexity": 123,
"estimated_review_minutes": 123
}
],
"next_cursor": "<string>"
}{
"errors": [
{
"message": "start_date: start_date must be YYYY-MM-DD format"
}
]
}{
"errors": [
{
"message": "Invalid or inactive API key"
}
]
}{
"message": "Forbidden:: This API requires an Enterprise plan"
}{
"errors": [
{
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests. Please retry after 60 seconds."
}
]
}{
"errors": [
{
"message": "Internal server error"
}
]
}{
"errors": [
{
"code": "METRICS_PREPARING",
"message": "<string>"
}
]
}Get PR metrics for organization
Returns finalized pull request metrics with CodeRabbit review comments. Merged PRs use merge time and closed-unmerged PRs use close time for the requested range and cursor. Supports cursor-based pagination, paged in write order rather than by merge/close time, so a row written after your cursor already passed its merge or close date (a backfill, or a reopen/reclose) still appears on a later page instead of being silently skipped. Each page request consumes one token when admitted by the request rate limiter. Reviews, review comments, and MCP share the Metrics quota for the configured quota owner. With verified owner scope, coordinate calls across API keys for the same organization, workspace, or Git-provider instance; changing an organization selector does not add quota.
curl --request GET \
--url https://api.coderabbit.ai/v1/metrics/reviews \
--header 'x-coderabbitai-api-key: <api-key>'import requests
url = "https://api.coderabbit.ai/v1/metrics/reviews"
headers = {"x-coderabbitai-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-coderabbitai-api-key': '<api-key>'}};
fetch('https://api.coderabbit.ai/v1/metrics/reviews', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
{
"pr_url": "https://github.com/org/repo/pull/123",
"organization_id": "184456712",
"organization_name": "<string>",
"repository_id": "<string>",
"author_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"coderabbit_comments": {
"total": {
"posted": 123,
"accepted": 123
},
"severity": {
"critical": {
"posted": 123,
"accepted": 123
},
"major": {
"posted": 123,
"accepted": 123
},
"minor": {
"posted": 123,
"accepted": 123
},
"trivial": {
"posted": 123,
"accepted": 123
},
"info": {
"posted": 123,
"accepted": 123
}
},
"category": {
"DATA_INTEGRITY_AND_INTEGRATION": {
"posted": 123,
"accepted": 123
},
"FUNCTIONAL_CORRECTNESS": {
"posted": 123,
"accepted": 123
},
"MAINTAINABILITY_AND_CODE_QUALITY": {
"posted": 123,
"accepted": 123
},
"PERFORMANCE_AND_SCALABILITY": {
"posted": 123,
"accepted": 123
},
"SECURITY_AND_PRIVACY": {
"posted": 123,
"accepted": 123
},
"STABILITY_AND_AVAILABILITY": {
"posted": 123,
"accepted": 123
}
}
},
"repository_name": "<string>",
"author_username": "<string>",
"ready_for_review_at": "2023-11-07T05:31:56Z",
"first_human_review_at": "2023-11-07T05:31:56Z",
"last_commit_at": "2023-11-07T05:31:56Z",
"merged_at": "2023-11-07T05:31:56Z",
"status": "closed",
"review_iterations": 1,
"estimated_complexity": 123,
"estimated_review_minutes": 123
}
],
"next_cursor": "<string>"
}{
"errors": [
{
"message": "start_date: start_date must be YYYY-MM-DD format"
}
]
}{
"errors": [
{
"message": "Invalid or inactive API key"
}
]
}{
"message": "Forbidden:: This API requires an Enterprise plan"
}{
"errors": [
{
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests. Please retry after 60 seconds."
}
]
}{
"errors": [
{
"message": "Internal server error"
}
]
}{
"errors": [
{
"code": "METRICS_PREPARING",
"message": "<string>"
}
]
}- CLI Tool
- MCP Server
coderabbit api request "/metrics/reviews?start_date=$START_DATE&end_date=$END_DATE"
format=csv, the file has one row per pull request, and the nested coderabbit_comments object becomes flat columns such as total_coderabbit_comments_posted. A CSV response is a single page of up to limit rows, with no cursor. See Download review metrics as CSV.Authorizations
See Authentication for the key types and where to create a key.
Query Parameters
Workspace-scoped API tokens only. Supply this git-provider organization ID or org_name, never both, to scope metrics to one organization. When both selectors are omitted, aggregates every organization in the workspace. This org_id parameter is ignored for organization and self-hosted keys.
Was this page helpful?