KBAISE/ for lovable
Library
Docs

Get workspace analytics

about 15 minShippingchecked 7d agoOfficial page
The short version

You can fetch overall website traffic numbers across your entire workspace, even for projects you already deleted. The data comes back as daily or hourly counts for the time period you choose.

Workspace administrators on a Business plan or higher who want to track aggregate visitor traffic across all their apps.

Do this, in order

  1. 1

    Create an API key in your Lovable workspace settings with the workspaces:read permission.

    This endpoint requires an API key specifically authorized to read workspace-level information.

  2. 2

    Send a GET request to https://api.lovable.dev/v1/workspaces/{workspace_id}/analytics with starts_at and ends_at timestamps in UTC format.

    Both start and end dates are required query parameters to define the time window for the report.

  3. 3

    Optionally specify granularity as 'hourly' or 'daily' (default is daily).

    Choosing granularity controls how your analytics points are grouped over the selected period.

Paste this into your project

Create an analytics dashboard component that fetches workspace traffic data from 'https://api.lovable.dev/v1/workspaces/' + workspaceId + '/analytics'. Allow the user to select a start date, end date, and granularity (hourly or daily). Display the returned traffic time series in a clean line chart.

Words decoded

Time series
A sequence of data points recorded at regular time intervals, such as daily or hourly visit counts.
Granularity
The size of each time bucket (for example, breaking data down hour by hour versus day by day).
RFC 3339 timestamp
A standard format for writing full dates and times, looking like 2026-07-01T00:00:00Z.
Scope
A specific permission attached to an API key determining what actions it is allowed to perform.

Where people get stuck

  • You must be on a Business plan or higher, or requests will fail with a payment required (402) error.
  • Do not exceed a 31-day date window if you request hourly granularity.
  • Do not exceed a 365-day total range regardless of granularity.
  • Ensure your API key includes the workspaces:read scope, as a project-level read key will not work.

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.