An API that connects multiple Microsoft services, enabling data access and automation across platforms
Microsoft Graph does not provide a SharePoint page-level analytics endpoint; use the Graph site-usage report for site totals, or retrieve SharePoint audit events through the Office 365 Management Activity API when individual-page activity is required.
What Microsoft Graph supports
The closest endpoint is:
GET https://graph.microsoft.com/v1.0/reports/getSharePointSiteUsageDetail(period='D30')
Authorization: Bearer {token}
Supported periods are D7, D30, D90, and D180. The endpoint requires Reports.Read.All and returns a 302 Found redirect to a short-lived CSV download URL. Its output includes Site ID, Site URL, Page View Count, and Visited Page Count, but no page URL or page identifier; therefore, the counts cannot be broken down by individual page.^1^
Graph also provides:
GET https://graph.microsoft.com/v1.0/reports/getSharePointSiteUsagePages(period='D30')
Authorization: Bearer {token}
That report returns the number of pages viewed across all sites, rather than analytics for a specified page.^2^
The /sites/{site-id}/pages API manages page content and metadata; it is not an analytics API. Graph’s documented SharePoint resource scope centers on sites, lists, list items, and drives.^3^
Alternative for individual-page events
For programmatic page-level reporting, use the Office 365 Management Activity API:
- Create a tenant subscription for
Audit.SharePoint. - Poll the subscription for available content blobs.
- Download each blob.
- Filter the returned audit records locally by operation and the page’s object identifier or URL.
- Aggregate records into the required page-view metrics.
The API exposes tenant-level content blobs rather than supporting server-side queries for a particular site, page, or event. New subscriptions can take up to 12 hours to produce their first blobs, and events are not guaranteed to arrive in chronological order.^4^ ^5^
Relevant audit operations include:
-
PagePrefetched— content was prefetched and does not definitively indicate that the user navigated to the page. -
PageViewedExtended— continued viewing of a page for an extended period. - Page-view signaling events, which should be used instead of treating every prefetch as a completed view.^6^
The activity schema provides common fields such as creation time, operation, user, workload, and object ID, and identifies Page as a SharePoint item type.^7^
Built-in analytics without an API
For an individual published page, open the page and select Analytics at the top. Page owners and site members can view viewers, views, average time spent, and traffic over 7-, 30-, or 90-day periods. Where the applicable Viva licensing requirements are met, the report can also be exported to Excel or PowerPoint.^8^
References
- reportRoot: getSharePointSiteUsageDetail
- reportRoot: getSharePointSiteUsagePages
- Working with SharePoint sites in Microsoft Graph
- Office 365 Management Activity API reference
- Office 365 Management Activity API FAQs and troubleshooting
- Audit log activities
- Office 365 Management Activity API schema
- [News](https://support.microsoft.com/sharepoint/sites-pages/view-usage-data-for-sharepoint-pages-and-news#export-report-data-and-charts)