Does some API supply to get method complexity for C#

Hi, I want to write a plugin to get method complexity for C# projects, does SonarQube scanner statistic the method complexity information? Does it provider SonarQube Rest API to get the method complexity (both cyclomatic complexity and cognitive complexity) for each file? Could anyone tell me which API to use or any other suggestion? Thanks very much.