analytics

Get project analytics breakdowns

Changed on

Plan: Business or higher

Scope: projects:read

Returns the top pages, referring domains, device types, and visitor countries for a published project over a range of complete UTC calendar dates, up to 10 items each. Date ranges are limited to 365 days. Some projects retain analytics for 90 days; older days contribute no visitors.

get/v1/projects/{project_id}/analytics/breakdowns

Request

  • Base URL
    https://api.lovable.dev
  • Auth
    • API key in header Lovable-API-Key
    • or HTTP bearer

Path parameters

project_idstring required

Project ID.

Example:prj_01jw3k9m2xq8r5v0c7d4e6f2gh

Query parameters

starts_atstring date-time required

Start of the time range as an RFC 3339 timestamp, such as 2026-04-01T00:00:00Z. Any offset is accepted and converted to UTC; the range covers complete UTC calendar dates from the UTC date of starts_at through the UTC date of ends_at.

Example:2026-04-01T00:00:00Z
ends_atstring date-time required

End of the time range as an RFC 3339 timestamp, such as 2026-04-08T00:00:00Z. Any offset is accepted and converted to UTC; the range covers complete UTC calendar dates from the UTC date of starts_at through the UTC date of ends_at.

Example:2026-04-08T00:00:00Z

Headers

Lovable-Versionstring

Stable API version to serve, as a YYYY-MM-DD date. Omit for the oldest supported stable version, currently 2026-09-11.

Lovable-Betastring

Comma-separated beta revision strings to enable on top of the stable version.

Response

OK

Example response

{
  "countries": [
    {
      "label": "United States",
      "visitors": 540
    }
  ],
  "devices": [
    {
      "label": "Desktop",
      "visitors": 820
    }
  ],
  "pages": [
    {
      "label": "/pricing",
      "visitors": 1280
    }
  ],
  "sources": [
    {
      "label": "google.com",
      "visitors": 640
    }
  ]
}

Changes

    • breaking

      added the new required query request parameter ends_at

    • breaking

      added the new required query request parameter starts_at

    • warning

      deleted the query request parameter end_date

    • warning

      deleted the query request parameter start_date

    • info

      for the header request parameter Lovable-Version, the format was generalized from date to no format

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status