Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
DescriptionGet a list of metrics

URL

/api/metrics

HTTP MethodGET
Response Formatsjson | xml

Security

None

 

Examples

Use CaseExample Request
Get all the metrics from the Sonar Nemo instance

GET http://nemo.sonarsource.org/api/metrics

Get the metric 'Lines of Code' (id = ncloc)

GET http://nemo.sonarsource.org/api/metrics/ncloc

...

Parameter

Description

Required

Default Value

Example Value

id

id or key of the metric

No. Get all metrics if not set

None

ncloc

format

Response format

.
Possible values

can be set through:

  • Parameter format: xml | json
  • Or the 'Accept' property in the HTTP header:
    • Accept:text/xml
    • Accept:application/json
If nothing is set, json is used.
NoNonejson