Searching projects or components - what is the difference?

I have been using Sonar 8.9.10 (Enterprise edition) and there is one thing I do not fully understand: I am writing an external app that fetches metrics for all projects/components(?). I thought I needed api/projects/search, which requires admin permissions, but then I found out that using /api/components/search with TRK qualifier, I am getting pretty much the same results (I got 900 results when I searched for projects, and 899 when using the component search, each of which contains also “key” and “project”).

To fetch metrics, I anyway need the “key”, so I would like to confirm if using the component search and going through all the keys will be the right approach to fetch all data across projects.

Thank you

GET api/projects/search will return all projects, whether or not you have permission to browse them. This is why it requires the admin permissions.

GET api/components/search will be limited to the projects you have permission to see, and (with different qualifiers) can be used to get other component types, such as files.