Duplications and Code Coverage API Response

Is there any way to get the author in the API response of Duplications or Code Coverage?
The APIs I used were:

  • For Code Coverage:
  1. https://sonarcloud.io/api/measures/component?component={project_key}&metricKeys=coverage
  2. https://sonarcloud.io/api/measures/component_tree?component={project_key}&metricKeys=coverage&ps=500
  • For Duplications
  1. https://sonarcloud.io/api/measures/component?component={project_key}&metricKeys=duplicated_lines,duplicated_blocks,duplicated_files,duplicated_lines_density
  2. https://sonarcloud.io/api/measures/component_tree?component={project_key}&author=true&metricKeys=duplicated_lines,duplicated_blocks,duplicated_files,duplicated_lines_density&ps=500

Thanks in advance

Hello @OmarAbdelzaher

Welcome to the community!

You can use the following endpoint to find the author data:

Thank you Martin for your reply. I tried this API, and it gets the information on a specific file level, while what I need is on the project level, like the APIs I mentioned above, they take project_key as a param.

What kind of author information are you looking for? As an example for duplications, you could get the authors of the source code that is duplicated.

For example, I tried to get the code smells of a project, using this API https://sonarcloud.io/api/issues/search?componentKeys={project_key}&types=CODE_SMELL&ps=500
It returned the code smells response including the author’s email. The same I want to do with duplications and code coverage. What I aim for is to get the authors’ progress across multiple projects in my organization.

Thank you for clarifying! I’ll add this feedback internally so that we can better understand the traction. Currently, this is not something we are looking at adding to the roadmap in the short term.

1 Like

Thank you for your efforts, Martin. I hope to get back to me as soon as the author returns in the above APIs.