API endpoint for line coverage


Just wondering if anyone knows which endpoint gives me access to line coverage percentage? I’ve tried a few different ones but line coverage is never returned.


Hi @Matt1 ,

Thank you for your patience. The endpoint you have to use is https://sonarcloud.io/web_api/api/measures/component and use the parameter metricKeys with value new_coverage (or coverage for overall code) to get the coverage percentage.

Hope this helps you.
Best regards,