Top user searched queries in Sharepoint via API

Sandi Andersen 1 Reputation point
2025-02-26T11:34:49.9833333+00:00

Is it possible to fetch top search terms for Sharepoint (query analytics) via an API? I've been back an forth between trying to use graph API and rest API: https://{company}.sharepoint.com/_api/search/query and https://graph.microsoft.com/v1.0 or beta/search/query but no luck.

Is there a way to get the same result as from M365 admin center - Search & intelligence - Query analytics via API?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,148 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rajat Vashistha-MSFT 1,070 Reputation points Microsoft Vendor
    2025-02-27T11:34:28.47+00:00

    Hi Sandi Andersen,

    Thanks for reaching out to Microsoft! 

    You're correct that the search/query endpoint will not provide the top search terms for SharePoint, as there is currently no capability to achieve the same results as the M365 Admin Center's Search & Intelligence - Query Analytics via API.

    Since this feature/functionality is presently not available, you can submit a feature request idea using support link, which will be monitored by Microsoft team and make the enhancements to Microsoft Graph APIs. I will also upvote for you.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.