curl --request GET \
--url 'https://api.coderabbit.ai/v1/metrics/reviews?start_date=2026-01-01&end_date=2026-01-20' \
--header 'x-coderabbitai-api-key: <api-key>'import requests
url = 'https://api.coderabbit.ai/v1/metrics/reviews'
headers = {'x-coderabbitai-api-key': '<api-key>'}
params = {'start_date': '2026-01-01', 'end_date': '2026-01-20'}
response = requests.get(url, headers=headers, params=params)
print(response.text)const options = {method: 'GET', headers: {'x-coderabbitai-api-key': '<api-key>'}};
fetch('https://api.coderabbit.ai/v1/metrics/reviews?start_date=2026-01-01&end_date=2026-01-20', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.coderabbit.ai/v1/metrics/reviews?start_date=2026-01-01&end_date=2026-01-20',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'x-coderabbitai-api-key: <api-key>'
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo 'cURL Error #:' . $err;
} else {
echo $response;
}
?>package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.coderabbit.ai/v1/metrics/reviews?start_date=2026-01-01&end_date=2026-01-20"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-coderabbitai-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.coderabbit.ai/v1/metrics/reviews?start_date=2026-01-01&end_date=2026-01-20")
.header("x-coderabbitai-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coderabbit.ai/v1/metrics/reviews?start_date=2026-01-01&end_date=2026-01-20")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-coderabbitai-api-key"] = "<api-key>"
response = http.request(request)
puts response.read_body{
"data": [
{
"pr_url": "https://github.com/org/repo/pull/123",
"organization_id": "132028505",
"organization_name": "my-org",
"repository_id": "672319970",
"repository_name": "my-repo",
"author_id": "14079159",
"author_username": "john123",
"created_at": "2025-01-15T10:00:00Z",
"ready_for_review_at": "2025-01-15T10:15:00Z",
"first_human_review_at": "2025-01-15T10:00:00Z",
"last_commit_at": "2025-01-15T10:00:00Z",
"merged_at": "2025-01-16T14:30:00Z",
"status": "merged",
"review_iterations": 3,
"estimated_complexity": 3,
"estimated_review_minutes": 45,
"coderabbit_comments": {
"total": {
"posted": 8,
"accepted": 5
},
"severity": {
"critical": {
"posted": 2,
"accepted": 1
},
"major": {
"posted": 3,
"accepted": 2
},
"minor": {
"posted": 2,
"accepted": 1
},
"trivial": {
"posted": 1,
"accepted": 1
},
"info": {
"posted": 0,
"accepted": 0
}
},
"category": {
"SECURITY_AND_PRIVACY": {
"posted": 2,
"accepted": 1
},
"PERFORMANCE_AND_SCALABILITY": {
"posted": 1,
"accepted": 1
},
"FUNCTIONAL_CORRECTNESS": {
"posted": 2,
"accepted": 1
},
"MAINTAINABILITY_AND_CODE_QUALITY": {
"posted": 2,
"accepted": 1
},
"DATA_INTEGRITY_AND_INTEGRATION": {
"posted": 1,
"accepted": 1
},
"STABILITY_AND_AVAILABILITY": {
"posted": 0,
"accepted": 0
}
}
}
}
],
"next_cursor": "2025-01-16T10:30:00Z"
}{
"errors": [
{
"code": "INVALID_PARAMETER",
"message": "start_date: start_date is required"
}
]
}{
"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>"
}
]
}Metrics Data
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?start_date=2026-01-01&end_date=2026-01-20' \
--header 'x-coderabbitai-api-key: <api-key>'import requests
url = 'https://api.coderabbit.ai/v1/metrics/reviews'
headers = {'x-coderabbitai-api-key': '<api-key>'}
params = {'start_date': '2026-01-01', 'end_date': '2026-01-20'}
response = requests.get(url, headers=headers, params=params)
print(response.text)const options = {method: 'GET', headers: {'x-coderabbitai-api-key': '<api-key>'}};
fetch('https://api.coderabbit.ai/v1/metrics/reviews?start_date=2026-01-01&end_date=2026-01-20', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.coderabbit.ai/v1/metrics/reviews?start_date=2026-01-01&end_date=2026-01-20',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'x-coderabbitai-api-key: <api-key>'
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo 'cURL Error #:' . $err;
} else {
echo $response;
}
?>package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.coderabbit.ai/v1/metrics/reviews?start_date=2026-01-01&end_date=2026-01-20"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-coderabbitai-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.coderabbit.ai/v1/metrics/reviews?start_date=2026-01-01&end_date=2026-01-20")
.header("x-coderabbitai-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coderabbit.ai/v1/metrics/reviews?start_date=2026-01-01&end_date=2026-01-20")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-coderabbitai-api-key"] = "<api-key>"
response = http.request(request)
puts response.read_body{
"data": [
{
"pr_url": "https://github.com/org/repo/pull/123",
"organization_id": "132028505",
"organization_name": "my-org",
"repository_id": "672319970",
"repository_name": "my-repo",
"author_id": "14079159",
"author_username": "john123",
"created_at": "2025-01-15T10:00:00Z",
"ready_for_review_at": "2025-01-15T10:15:00Z",
"first_human_review_at": "2025-01-15T10:00:00Z",
"last_commit_at": "2025-01-15T10:00:00Z",
"merged_at": "2025-01-16T14:30:00Z",
"status": "merged",
"review_iterations": 3,
"estimated_complexity": 3,
"estimated_review_minutes": 45,
"coderabbit_comments": {
"total": {
"posted": 8,
"accepted": 5
},
"severity": {
"critical": {
"posted": 2,
"accepted": 1
},
"major": {
"posted": 3,
"accepted": 2
},
"minor": {
"posted": 2,
"accepted": 1
},
"trivial": {
"posted": 1,
"accepted": 1
},
"info": {
"posted": 0,
"accepted": 0
}
},
"category": {
"SECURITY_AND_PRIVACY": {
"posted": 2,
"accepted": 1
},
"PERFORMANCE_AND_SCALABILITY": {
"posted": 1,
"accepted": 1
},
"FUNCTIONAL_CORRECTNESS": {
"posted": 2,
"accepted": 1
},
"MAINTAINABILITY_AND_CODE_QUALITY": {
"posted": 2,
"accepted": 1
},
"DATA_INTEGRITY_AND_INTEGRATION": {
"posted": 1,
"accepted": 1
},
"STABILITY_AND_AVAILABILITY": {
"posted": 0,
"accepted": 0
}
}
}
}
],
"next_cursor": "2025-01-16T10:30:00Z"
}{
"errors": [
{
"code": "INVALID_PARAMETER",
"message": "start_date: start_date is required"
}
]
}{
"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>"
}
]
}Authorizations
API key for authentication. You can create an API key from the CodeRabbit dashboard.
Headers
Your CodeRabbit API key
Query Parameters
Workspace-scoped API tokens only. When provided, scopes metrics to that single git-provider organization within the token's workspace; when omitted, aggregates every organization in the workspace. Ignored for organization and self-hosted keys.
Start date in ISO 8601 format (YYYY-MM-DD)
End date in ISO 8601 format (YYYY-MM-DD)
Filter finalized pull requests by status
merged, closed, all Filter by organization Git provider IDs (comma-separated, max 10). Self-hosted instances only.
Filter by repository Git provider IDs (comma-separated, max 10).
Filter by author Git provider IDs (comma-separated, max 10).
Response format
json, csv Maximum records to return
1 <= x <= 1000Pagination cursor for fetching next page of results
Was this page helpful?