Overview
SonarQube provides a REST API for its code quality and security analysis platform, letting you programmatically retrieve metrics, issues, and quality gate statuses for your projects. It supports OAuth authentication and integrates with CI/CD pipelines to automate code review workflows. Developers use it to build dashboards, enforce quality gates, and track technical debt over time.
Beginner Tip
You can explore the SonarCloud Web API interactively at sonarcloud.io/web_api without writing any code — a great way to understand available endpoints before integrating them into your pipeline.
Available Data
Example Response
{
"url": "https://example.com",
"safe": true,
"threat_level": "none",
"categories": [
"clean"
],
"scan_date": "2025-01-15T10:00:00Z"
} Field Reference
component.key The unique project key identifying the analyzed component component.measures Array of metric measurement objects for the requested metricKeys component.measures[].metric The metric key name (e.g., coverage, bugs, code_smells) component.measures[].value The current numeric value for the metric component.qualifier Type of component analyzed, such as TRK (project) or FIL (file) Implementation Example
const url = "https://sonarcloud.io/web_api";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
headers: {
"Authorization": "Bearer YOUR_API_KEY"
}
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
Common Errors & Troubleshooting
Matrix Score Breakdown
Partially tested on Apr 5, 2026
Technical Specifications
Related Tags
Similar APIs
View All →Bitbucket
The Bitbucket REST API (v2) provides programmatic access to Bitbucket Cloud repositories, pull requests, pipelines, and user accounts, enabling you to automate code review workflows and integrate Bitbucket into your CI/CD toolchain.
GitHub
⭐ Beginner's PickThe GitHub REST API gives you programmatic access to nearly everything on GitHub — repositories, issues, pull requests, commits, users, organizations, GitHub Actions, and more.
Gitlab
The GitLab REST API provides comprehensive programmatic control over GitLab projects, including repositories, merge requests, pipelines, issues, CI/CD variables, and user management.
Gitter
Gitter provides programmatic access to chat for developers via REST API.
Google Docs
The Google Docs API provides full programmatic control over Google Docs documents, including reading content, inserting text, applying styles, and managing document structure.