Discrepancy between Project Count from Sonar Web API and Database Query

sonarqube version:

The number of projects obtained through the web API is 1341, while the count obtained by querying the database table is 910. Why is there a discrepancy?

Hey there.

GET api/projects/search when used without ?qualifiers=TRK returns projects, applications, and portfolios, not only projects (don’t ask why).

Do you have applications/portfolios on your instance?

Thank you for your response.

After appending “?qualifiers=TRK” to the API call, I noticed that it returned 1342 results. However, I must clarify that I do not have any applications or portfolios on my instance. It seems there might be a discrepancy in the returned data or a misunderstanding of the query parameters. Could you please provide further clarification or guidance on how to accurately retrieve only projects?

Thank you for your assistance

I recently created a new project, and while I can query it successfully both through the web interface and the web API, I noticed that the data does not appear in the ‘projects’ table in the database. Despite this, the project is functioning as expected within the system.