KBAISE/ for lovable
Library
Docs

Get project realtime analytics

about 10 minShippingchecked 7d agoOfficial page
The short version

Check how many people are visiting your published project right now. It returns active visitors from the last 5 minutes and minute-by-minute visitor counts for the last 30 minutes.

Project owners on a Business plan or higher who want to display or track live visitor traffic on their published apps.

Do this, in order

  1. 1

    Create an API key with the projects:read scope in your workspace settings.

    The realtime analytics endpoint requires an authorized key with permission to view project information.

  2. 2

    Locate your project ID from your project settings or URL.

    The analytics web address requires your specific project ID to know which project to pull stats for.

  3. 3

    Send a GET request to https://api.lovable.dev/v1/projects/{project_id}/analytics/realtime using your API key in the Lovable-API-Key or Authorization header.

    This returns the count of active visitors in the last 5 minutes and minute-by-minute traffic from the past 30 minutes.

Paste this into your project

Build a live analytics dashboard component that fetches data from the Lovable API at GET https://api.lovable.dev/v1/projects/{project_id}/analytics/realtime. Provide fields to input the project ID and API key, display the total active visitors from the last 5 minutes in a prominent stat card, and render a minute-by-minute chart of visitor counts over the last 30 minutes. Display clear alerts if the request fails with authorization or plan-related errors.

Words decoded

API key
A secret passcode that lets external code securely talk to Lovable.
Scope
A specific permission tag attached to an API key that defines what actions it is allowed to perform.
Endpoint
A specific web address that receives requests and returns data.

Where people get stuck

  • Your workspace must be on a Business plan or higher, otherwise the API returns a 402 payment required error.
  • Your API key must have the projects:read scope or projects:write scope, or you will receive a 403 insufficient scope error.
  • API keys are tied to a single workspace, so requesting analytics for a project in another workspace will return a 404 not found 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.