Skip to content

Realtime

Beta

Who’s on a site right now, as counts: how many are online, the last 30 minutes’ page views per minute, the pages being read, and where the last half hour’s visits came in. For a status board or an alert in your own code.

GET/api/v1/sites/{site}/realtime

Parameters

Only the site. Realtime always reads the last 30 minutes, so it takes no period, time zone, filters, segment, or cohort.

NameWhat it does
siteIn the path, requiredThe site’s ID, as in its address in the app: app.lyli.io/sites/<id>. /sites lists the ones your key can read.

Request

An example site, now.

Your terminal
curl https://app.lyli.io/api/v1/sites/s_k3m9x2p7qa/realtime \
  -H "Authorization: Bearer $LYLI_API_KEY"

Response

200 OK · application/json
{
  "site": "s_k3m9x2p7qa",
  "at": "2026-11-23T08:55:02.121Z",
  "online": 4,
  "views_per_minute": [
    0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 2,
    0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 3, 2, 1, 0
  ],
  "pages": [
    { "page": "/docs", "visitors": 2 },
    { "page": "/pricing", "visitors": 2 }
  ],
  "arrivals": {
    "visits": 9,
    "sources": [
      { "source": "google.com", "visits": 6 },
      { "source": "direct", "visits": 3 }
    ],
    "entry_pages": [
      { "page": "/", "visits": 5 },
      { "page": "/docs", "visits": 3 },
      { "page": "/blog/cookieless-analytics", "visits": 1 }
    ]
  }
}

An example site’s numbers, with nine visits in the half hour before.

FieldWhat it holds
atThe moment counted, in UTC.
onlineVisitors whose latest page view or custom event was in the last 5 minutes, each counted once.
views_per_minutePage views in each of the last 30 minutes, oldest first: 30 numbers, the last one the minute up to at.
pagesThe pages the visitors online are on, each visitor on their latest page view, most visitors first.
arrivals.visitsVisits that started in the last 30 minutes.
arrivals.sourcesThose visits by source, as the Sources list names them (direct for none), most visits first.
arrivals.entry_pagesThose visits by the page they came in on, most visits first.

What it never returns

Counts only, whatever the site’s Individual visits setting: never a visit, a visitor’s ID, a city, or a country. The Realtime page in the app can show places on its globe; the API doesn’t. Requests our bot filter leaves out aren’t stored, so they aren’t counted here either.

Asking often

Every answer is counted fresh, never cached, and every request counts toward the workspace’s 600 an hour, shared by all its keys. Asking once a minute uses 60 of them; asking every 6 seconds would use all 600. Rate limits

Errors

StatusCodeWhen
400invalid_parameterAny parameter: it takes none but the site in its path.
402workspace_pausedThe workspace is paused.
403site_not_allowedYour key doesn’t have access to this site.
404not_foundNo site with this ID in the workspace.

Sending timezone, for example:

400 Bad Request
{
  "error": {
    "code": "invalid_parameter",
    "message": "Unknown parameter: timezone."
  }
}

Every endpoint can also return 401 (missing, revoked, or expired key) and 429 (rate limit reached). All errors

Start from a report

In the app, open Realtime, then the Share menu’s Copy as API request: this request for the site, as curl. It reads your API key from the LYLI_API_KEY environment variable, so a copied request never contains a key.