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.
Measurement Record
What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.
- Request
- GET https://sonarcloud.io/api/
- Result
- HTTP 200 · application/json · 209,730 bytes · compressed
- Response time
- 920 ms (median of 3) · fastest 531 ms
- Transport
- TLSv1.3 · TLS_AES_128_GCM_SHA256
- Browser CORS
- Allowed — Access-Control-Allow-Origin: *
- Recorded
- 2026-08-10
Fields Returned
Top-level fields present in the response we captured, with the type and value we actually received.
| Field | Type | Value received |
|---|---|---|
| webServices | array | [1 item] |
Captured Response
Captured from a real request to https://sonarcloud.io/api/ on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.
{
"webServices": [
{
"path": "api/authentication",
"description": "Handle authentication.",
"actions": [
{
"…": "(7 more fields)"
}
]
}
]
} Implementation Example
Calls a real endpoint of this API. Replace any placeholder credentials with your own key.
const url = "https://sonarcloud.io/api/measures/component?component=YOUR_PROJECT_KEY&metricKeys=coverage,bugs,code_smells";
// 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.
How This API Fails
We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.
{
"errors": [
{
"msg": "Unknown url : /api/apisscore-nonexistent-path"
}
]
} Common Errors & Troubleshooting
Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.
Measured Score Breakdown
Live HTTP request to the API endpoint
Fully tested on Aug 10, 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.
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.
DomainDb Info
⭐ Beginner's PickDomainsDB.info provides a searchable database of registered domain names, allowing you to find all domains containing specific keywords, phrases, or patterns across various TLDs.