curl --request GET \
--url 'https://api.lovable.dev/v1/workspaces/workspace-id/analytics?ends_at=2026-07-08T00:00:00Z&starts_at=2026-07-01T00:00:00Z' \
--header 'Lovable-API-Key: lov_your-api-key' \
--header 'Lovable-Version: 2026-09-11'{
"time_series": {
"bounce_rate": {
"data": [
{
"timestamp": "2026-01-15T00:00:00Z",
"value": 1280
}
],
"label": "visitors",
"total": 1280
},
"pageviews": {
"data": [
{
"timestamp": "2026-01-15T00:00:00Z",
"value": 1280
}
],
"label": "visitors",
"total": 1280
},
"pageviews_per_visit": {
"data": [
{
"timestamp": "2026-01-15T00:00:00Z",
"value": 1280
}
],
"label": "visitors",
"total": 1280
},
"session_duration": {
"data": [
{
"timestamp": "2026-01-15T00:00:00Z",
"value": 1280
}
],
"label": "visitors",
"total": 1280
},
"visitors": {
"data": [
{
"timestamp": "2026-01-15T00:00:00Z",
"value": 1280
}
],
"label": "visitors",
"total": 1280
}
}
}{
"detail": "validation failed",
"errors": [
{
"location": "body.members",
"message": "expected array length >= 1"
}
],
"props": null,
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"status": 400,
"title": "Bad Request",
"type": "invalid_request"
}{
"detail": null,
"errors": null,
"props": null,
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"status": 401,
"title": "Authorization header required",
"type": "unauthorized"
}{
"detail": null,
"errors": null,
"props": null,
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"status": 402,
"title": "You need to upgrade your plan to access this feature",
"type": "payment_required"
}{
"detail": null,
"errors": null,
"props": null,
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"status": 403,
"title": "You don't have the permissions to perform this action",
"type": "forbidden"
}{
"detail": null,
"errors": null,
"props": null,
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"status": 404,
"title": "Not Found",
"type": "workspace_not_found"
}{
"detail": null,
"errors": null,
"props": null,
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"status": 406,
"title": "This endpoint produces application/json. Send a matching Accept header, */*, or omit the header.",
"type": "not_acceptable"
}{
"detail": null,
"errors": null,
"props": null,
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"status": 429,
"title": "Too Many Requests",
"type": "rate_limited"
}{
"detail": null,
"errors": null,
"props": null,
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"status": 503,
"title": "Request timed out",
"type": "request_timeout"
}{
"detail": "validation failed",
"errors": [
{
"location": "body.workspace_id",
"message": "expected string"
}
],
"props": {
"finding_refs": [
"supabase/finding-1"
]
},
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"status": 429,
"title": "Too Many Requests",
"type": "rate_limited"
}Get workspace analytics
Plan: Business or higher
Scope: workspaces:read
Returns website traffic time series for the workspace, including historical traffic from projects that have since been deleted. The response covers the requested date range without pagination. Date ranges are limited to 365 days, or 31 days with hourly granularity.
curl --request GET \
--url 'https://api.lovable.dev/v1/workspaces/workspace-id/analytics?ends_at=2026-07-08T00:00:00Z&starts_at=2026-07-01T00:00:00Z' \
--header 'Lovable-API-Key: lov_your-api-key' \
--header 'Lovable-Version: 2026-09-11'{
"time_series": {
"bounce_rate": {
"data": [
{
"timestamp": "2026-01-15T00:00:00Z",
"value": 1280
}
],
"label": "visitors",
"total": 1280
},
"pageviews": {
"data": [
{
"timestamp": "2026-01-15T00:00:00Z",
"value": 1280
}
],
"label": "visitors",
"total": 1280
},
"pageviews_per_visit": {
"data": [
{
"timestamp": "2026-01-15T00:00:00Z",
"value": 1280
}
],
"label": "visitors",
"total": 1280
},
"session_duration": {
"data": [
{
"timestamp": "2026-01-15T00:00:00Z",
"value": 1280
}
],
"label": "visitors",
"total": 1280
},
"visitors": {
"data": [
{
"timestamp": "2026-01-15T00:00:00Z",
"value": 1280
}
],
"label": "visitors",
"total": 1280
}
}
}{
"detail": "validation failed",
"errors": [
{
"location": "body.members",
"message": "expected array length >= 1"
}
],
"props": null,
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"status": 400,
"title": "Bad Request",
"type": "invalid_request"
}{
"detail": null,
"errors": null,
"props": null,
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"status": 401,
"title": "Authorization header required",
"type": "unauthorized"
}{
"detail": null,
"errors": null,
"props": null,
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"status": 402,
"title": "You need to upgrade your plan to access this feature",
"type": "payment_required"
}{
"detail": null,
"errors": null,
"props": null,
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"status": 403,
"title": "You don't have the permissions to perform this action",
"type": "forbidden"
}{
"detail": null,
"errors": null,
"props": null,
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"status": 404,
"title": "Not Found",
"type": "workspace_not_found"
}{
"detail": null,
"errors": null,
"props": null,
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"status": 406,
"title": "This endpoint produces application/json. Send a matching Accept header, */*, or omit the header.",
"type": "not_acceptable"
}{
"detail": null,
"errors": null,
"props": null,
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"status": 429,
"title": "Too Many Requests",
"type": "rate_limited"
}{
"detail": null,
"errors": null,
"props": null,
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"status": 503,
"title": "Request timed out",
"type": "request_timeout"
}{
"detail": "validation failed",
"errors": [
{
"location": "body.workspace_id",
"message": "expected string"
}
],
"props": {
"finding_refs": [
"supabase/finding-1"
]
},
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"status": 429,
"title": "Too Many Requests",
"type": "rate_limited"
}Authorizations
Lovable API key. Send its value in the Lovable-API-Key header.
Headers
Stable API version to serve, as a YYYY-MM-DD date. Omit for the oldest supported stable version, currently 2026-09-11.
Comma-separated beta revision strings to enable on top of the stable version.
Path Parameters
Workspace ID.
Query Parameters
Start of the time range as an RFC 3339 timestamp, such as 2026-07-01T00:00:00Z. Any offset is accepted and converted to UTC before the range is applied.
"2026-07-01T00:00:00Z"
End of the time range as an RFC 3339 timestamp, such as 2026-07-08T00:00:00Z. Any offset is accepted and converted to UTC before the range is applied.
"2026-07-08T00:00:00Z"
Time-bucket size: hourly or daily. Defaults to daily when omitted; any other value returns 400. Daily buckets cover complete UTC calendar dates from the UTC date of starts_at through the UTC date of ends_at; hourly buckets use the supplied instants inclusively and support at most 31 days.
hourly, daily Response
OK
Website traffic metrics for the workspace, including historical traffic from projects that have since been deleted.
Show child attributes
Show child attributes
Was this page helpful?