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));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coderabbit.ai/v1/metrics/review-comments",
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/review-comments"
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/review-comments")
.header("x-coderabbitai-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coderabbit.ai/v1/metrics/review-comments")
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": "<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>"
}Review comment metrics
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. 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 in CodeRabbit Cloud. Each request must resolve to exactly one organization. Self-hosted CodeRabbit deployments are not supported.
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));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coderabbit.ai/v1/metrics/review-comments",
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/review-comments"
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/review-comments")
.header("x-coderabbitai-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coderabbit.ai/v1/metrics/review-comments")
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": "<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>"
}org_id to select one provider organization. If org_id does not match an active organization in the workspace, the request returns 404. If the workspace scope resolves to zero or multiple organizations, the request returns 403. Organization-scoped API keys ignore this parameter.Authorizations
API key for authentication. You can create an API key from the CodeRabbit dashboard.
Headers
API key for authentication
Query Parameters
Workspace-scoped API tokens only. Selects one provider organization in the token's workspace. The resolved scope must contain exactly one organization; a multi-organization scope returns 403. Ignored for organization-scoped and Git-provider instance-scoped keys.
Inclusive UTC merge date in YYYY-MM-DD format
"2026-09-01"
Inclusive UTC merge date in YYYY-MM-DD format; must not precede start_date
"2026-09-09"
Comma-separated provider repository IDs. Maximum 10.
"1027529638,987654321"
Comma-separated provider PR author IDs from stored PR metrics. Maximum 10.
"87397876,12345678"
Comma-separated provider organization IDs for self-hosted Git provider instances connected to CodeRabbit Cloud. Maximum 10 input values; the resolved scope must contain exactly one organization. Not supported for organizations without a self-hosted Git provider instance.
"184456712,103539130"
Maximum number of pull requests per page, not the number of nested comments
1 <= x <= 1000Opaque next_cursor from the previous response. Keep the same date window and filters when fetching subsequent pages.
Was this page helpful?