Sonar 7.6 rest api issue

SONAR QUBE 7.6 community edition
Trying to fetch data from web API or REST api
I have used /api/components

Like my server URL for example:

The result is - unknown URL.

I tried the same in old SONAR 4.0 it works fine.

Is it any changes in SONAR 7.6. Please share the steps using web API in Sonar 7.6 to retrieve any information.

I’m looking for the value of “Tech Debt” of specific project.


for Web api documentation.
There is:


Thanks for replying Gilbert!

I will go through the documentation that you have shared.

I’m a new bee to SONAR web API.

will you please give one example, so that i can follow the same for my other needs.

I will have to Fetch “Tech debt” data from one of the project named “A”.

How do i search and get it in web browser or a file locally?

Basically i’m looking for syntax and one example.
please help.


I think you’re looking for this: (SonaQube URL)/api/measures/component?component=(project key)&metricKeys=sqale_index


 "component": {
   "id": "5eab015a-1f76-4ba4-bd89-bf547132d673",
   "key": "org.sonarsource.javascript:javascript",
   "name": "SonarJS",
   "description": "SonarQube JavaScript Analyzer",
   "qualifier": "TRK",
   "measures": [
       "metric": "sqale_index",
       "value": "3901",
       "bestValue": false

The "value": "3901" is measured in minutes. You can compare with:

3901 minutes = ~65h = ~8 days


the Sonarqube Web api documentation has parameters and response examples.
Just try and use Firefox or Chrome to see the JSON response in your browser.
@Scott already mentioned the right api call for your specific question.
Some more details, i.e. with a projectkey =
To see the measures in Sonarqube Web UI, use

that will show you something like that

Maintainability means technical debt.

To get the same measures via Web api, use [https://sonar/api/measures/component?,sqale_index,sqale_debt_ratio]

The JSON Respons will look like that


Thanks a lot scott !! This is exactly what we are looking for.

But seems the below calculation is wrong.
3901 minutes = ~65h = ~8 days

3901 minutes = ~65h = 2.7 days ???

Will you please clarify if the value retrieved for “sqale_index” is in MINUTES ? or something else ?

Thanks a ton Gilbert. This is exactly what I’m looking for.

8-hour work day :wink:

1 Like

LOL :smiley: . Thanks for clarifying. Never thought about this :wink: