Get project analytics breakdowns
This endpoint lets you retrieve the top 10 pages, referral sources, devices, and visitor countries for any published project. You query it by specifying a date range of up to 365 days.
Project owners on a Business plan or higher who want to display traffic breakdown statistics inside custom dashboards or external tools.
Do this, in order
- 1
Create an API key with the 'projects:read' scope in your workspace settings.
The analytics breakdown endpoint requires read access to project data to verify permissions.
- 2
Locate the project ID for the published app you want traffic data for.
The project ID is required in the request path URL.
- 3
Send a GET request to 'https://api.lovable.dev/v1/projects/{project_id}/analytics/breakdowns' with 'starts_at' and 'ends_at' date-time query parameters.
This pulls up to 10 top records across pages, referrers, devices, and countries across the selected calendar dates.
Paste this into your project
Create an analytics breakdown view for our dashboard. Add an integration that calls 'GET https://api.lovable.dev/v1/projects/{project_id}/analytics/breakdowns' with a start date and end date selector. Display the results in four clean summary lists: Top Pages, Referring Domains, Device Types, and Visitor Countries, showing up to 10 entries each.Words decoded
- Breakdown
- A categorized list ranking your traffic, such as your top visited pages or most common visitor countries.
- Scope
- A permission setting assigned to an API key that restricts what actions it is allowed to perform.
- RFC 3339 timestamp
- A standardized date and time format, such as 2026-04-01T00:00:00Z.
Where people get stuck
- Setting a date range longer than 365 days will fail.
- Checking dates older than 90 days may show zero visitors if your project retains only 90 days of analytics history.
- Using an API key from a different workspace will return a 404 error instead of analytics data.
- Attempting to query this endpoint without a Business tier or higher workspace plan will result in a 402 payment required error.
The short version, steps, decoder and prompt on this page are written automatically from Lovable's own documentation and can lag or misread it. The official page is always the authority.