curl --request GET \
--url https://api.coderabbit.ai/v1/metrics/review-comments \
--header 'x-coderabbitai-api-key: <api-key>'import requests
url = "https://api.coderabbit.ai/v1/metrics/review-comments"
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/review-comments', 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": "<string>",
"repository_id": "<string>",
"author_id": "<string>",
"merged_at": "2023-11-07T05:31:56Z",
"coderabbit_comments": [
{
"url": "<string>",
"severity": "critical",
"category": "data_integrity_and_integration",
"accepted": true
}
]
}
],
"next_cursor": "<string>"
}{
"errors": [
{
"code": "RATE_LIMIT_EXCEEDED",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "METRICS_PREPARING",
"message": "<string>"
}
]
}Get review comment metrics for merged pull requests
Returns JSON with one entry per merged pull request that has stored CodeRabbit review comment metrics. The inclusive UTC date window selects pull requests by merge date, regardless of when comments were posted. Pull requests without stored comments are excluded before pagination. Pagination is in write order rather than by merge date, so a pull request written after your cursor already passed its merge date (a backfill, or a reopen/reclose) still appears on a later page instead of being silently skipped. Each nested comment entry represents a stored finding; a comment URL may occur more than once when the posted comment contains multiple findings. Comment text is not returned. Unknown query parameters, including format and status, are rejected. Available on the Enterprise plan. Self-hosted CodeRabbit deployments can use this API when configured to send metrics to CodeRabbit Cloud. Requests include all organizations authorized by the API token unless narrowed by an organization selector. 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/review-comments \
--header 'x-coderabbitai-api-key: <api-key>'import requests
url = "https://api.coderabbit.ai/v1/metrics/review-comments"
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/review-comments', 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": "<string>",
"repository_id": "<string>",
"author_id": "<string>",
"merged_at": "2023-11-07T05:31:56Z",
"coderabbit_comments": [
{
"url": "<string>",
"severity": "critical",
"category": "data_integrity_and_integration",
"accepted": true
}
]
}
],
"next_cursor": "<string>"
}{
"errors": [
{
"code": "RATE_LIMIT_EXCEEDED",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "METRICS_PREPARING",
"message": "<string>"
}
]
}- CLI Tool
- MCP Server
coderabbit api request "/metrics/review-comments?start_date=$START_DATE&end_date=$END_DATE"
Authorizations
See Authentication for the key types and where to create a key.
Query Parameters
Workspace-scoped API tokens only. Supply this provider organization ID or org_name, never both, to select one organization in the workspace. When both selectors are omitted, includes all organizations authorized by the workspace token. This org_id parameter is ignored for organization-scoped and Git-provider instance-scoped keys.
Comma-separated provider organization IDs for self-hosted Git provider instance-scoped API keys. Maximum 10 input values. When omitted, includes all authorized organizations in the instance. The filter cannot expand the scope authorized by the API token. Not supported for organization-scoped or workspace-scoped API keys.
"184456712,103539130"
Was this page helpful?