cURL
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": "<string>",
"author_id": "<string>",
"author_username": "<string>",
"organization_id": "<string>",
"organization_name": "<string>",
"repository_id": "<string>",
"repository_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"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",
"review_iterations": 1,
"estimated_complexity": 123,
"estimated_review_minutes": 123,
"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": {
"security_and_privacy": {
"posted": 123,
"accepted": 123
},
"performance_and_scalability": {
"posted": 123,
"accepted": 123
},
"functional_correctness": {
"posted": 123,
"accepted": 123
},
"maintainability_and_code_quality": {
"posted": 123,
"accepted": 123
},
"data_integrity_and_integration": {
"posted": 123,
"accepted": 123
},
"stability_and_availability": {
"posted": 123,
"accepted": 123
}
}
}
}
],
"next_cursor": "<string>"
}{
"errors": [
{
"code": "INVALID_PARAMETER",
"message": "start_date: start_date is required"
}
]
}{
"message": "Invalid or missing API key",
"code": "UNAUTHORIZED"
}{
"message": "API access requires an Enterprise plan subscription",
"code": "FORBIDDEN"
}{
"message": "Response exceeds maximum size of 16MB. Please use a smaller date range or add filters.",
"code": "RESPONSE_TOO_LARGE"
}{
"message": "Rate limit exceeded. Please retry after 60 seconds.",
"code": "RATE_LIMITED"
}Metrics Data
Access CodeRabbit metrics data programmatically via REST API.
GET
/
v1
/
metrics
/
reviews
cURL
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": "<string>",
"author_id": "<string>",
"author_username": "<string>",
"organization_id": "<string>",
"organization_name": "<string>",
"repository_id": "<string>",
"repository_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"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",
"review_iterations": 1,
"estimated_complexity": 123,
"estimated_review_minutes": 123,
"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": {
"security_and_privacy": {
"posted": 123,
"accepted": 123
},
"performance_and_scalability": {
"posted": 123,
"accepted": 123
},
"functional_correctness": {
"posted": 123,
"accepted": 123
},
"maintainability_and_code_quality": {
"posted": 123,
"accepted": 123
},
"data_integrity_and_integration": {
"posted": 123,
"accepted": 123
},
"stability_and_availability": {
"posted": 123,
"accepted": 123
}
}
}
}
],
"next_cursor": "<string>"
}{
"errors": [
{
"code": "INVALID_PARAMETER",
"message": "start_date: start_date is required"
}
]
}{
"message": "Invalid or missing API key",
"code": "UNAUTHORIZED"
}{
"message": "API access requires an Enterprise plan subscription",
"code": "FORBIDDEN"
}{
"message": "Response exceeds maximum size of 16MB. Please use a smaller date range or add filters.",
"code": "RESPONSE_TOO_LARGE"
}{
"message": "Rate limit exceeded. Please retry after 60 seconds.",
"code": "RATE_LIMITED"
}
Returns metrics for finalized pull requests reviewed by CodeRabbit, including complexity scores, review times, review iterations, and comment breakdowns by severity and category.
Pull request status
Use the optionalstatus parameter to select finalized pull requests:
merged(default): Pull requests that were mergedclosed: Pull requests that were closed without mergingall: Both merged and closed pull requests
status:mergedorclosedreview_iterations: The number of CodeRabbit review events recorded for the pull request
curl --request GET \
--url 'https://api.coderabbit.ai/v1/metrics/reviews?start_date=2026-01-01&end_date=2026-01-20&status=all&limit=50' \
--header 'x-coderabbitai-api-key: <api-key>'
CSV format
When usingformat=csv, the API returns a flat CSV structure with one row per pull request. The nested coderabbit_comments object is flattened into individual columns (e.g., total_coderabbit_comments_posted, critical_comments_accepted). The status and review_iterations columns appear immediately after merged_at.
For descriptions of the remaining CSV columns, see Data Export - Exported fields.Authorizations
API key for authentication. You can create an API key from the CodeRabbit dashboard.
Headers
Your CodeRabbit API key
Query Parameters
Start date in ISO 8601 format (YYYY-MM-DD)
End date in ISO 8601 format (YYYY-MM-DD)
Filter finalized pull requests by status
Available options:
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
Available options:
json, csv Maximum records to return
Pagination cursor for fetching next page of results
Was this page helpful?
⌘I