I want to be able to extract, for example, only technical debt numbers from my sonar instance for all the projects that I have, and display them on the page.
Does Sonar provide an api that I can use and achieve this?
SonarQube allows you to get comprehensive data using its web API. An example of your project:
Use the api/measuresWeb API (see documentation options ). Example for postgresql project :
api/measures
Get component id:
https://nemo.sonarqube.org/api/components/show?key=postgresql
:
https://nemo.sonarqube.org/api/measures/component?componentId=6d75286c-42bb-4377-a0a1-bfe88169cffb&metricKeys=sqale_debt_ratio&additionalFields=metrics,periods
api/resources -API:
api/resources
http://sonarqube_url/api/resources?resource=your_resource&metrics=metric_key
api/metrics/search ( ), . .
api/metrics/search