Skip to content

Performance

Beta

The Performance score and the five Web Vitals at the 75th percentile, over the period and by page and device, as the Performance page shows them. They come from real visits: the tracking script measures each page load.

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

Parameters

It takes the parameters every report takes, and none of its own.

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.
periodOptionaltoday, yesterday, 7d, 30d, 90d, 52w, or a range of days or hours. The last 30 days if left out. Periods
againstOptionalprevious, month, or year. Adds compared to the response.
timezoneOptionalA time zone name, such as America/New_York. The site’s own if left out.
channel … contentOptionalAny of the 14 filters, such as device=mobile. They combine. Filters
segment, cohortOptionalA saved segment’s or cohort’s ID.

Request

An example site, the last 30 days, read in its own time zone.

Your terminal
curl -G https://app.lyli.io/api/v1/sites/s_k3m9x2p7qa/performance \
  -H "Authorization: Bearer $LYLI_API_KEY" \
  -d period=30d \
  -d timezone=Europe/Stockholm

Response

200 OK · application/json
{
  "site": "s_k3m9x2p7qa",
  "period": {
    "key": "30d",
    "from": "2026-10-24",
    "to": "2026-11-22",
    "timezone": "Europe/Stockholm",
    "interval": "day"
  },
  "score": 93,
  "rating": "good",
  "loads": 1109,
  "vitals": {
    "lcp": { "p75": 2513, "rating": "needs_work", "samples": 1109 },
    "inp": { "p75": 187, "rating": "good", "samples": 776 },
    "cls": { "p75": 0.066, "rating": "good", "samples": 1109 },
    "fcp": { "p75": 1420, "rating": "good", "samples": 1109 },
    "ttfb": { "p75": 515, "rating": "good", "samples": 1109 }
  },
  "series": [
    { "date": "2026-10-24", "loads": 31, "score": 89 },
    { "date": "2026-10-25", "loads": 37, "score": 89 },
    // … 27 more days
    { "date": "2026-11-22", "loads": 28, "score": 95 }
  ],
  "pages": [
    { "page": "/pricing", "loads": 390, "score": 94,
      "lcp": 2417, "inp": 183, "cls": 0.066, "fcp": 1365, "ttfb": 516 },
    { "page": "/", "loads": 261, "score": 94,
      "lcp": 2386, "inp": 186, "cls": 0.067, "fcp": 1366, "ttfb": 520 }
    // … 3 more pages
  ],
  "devices": [
    { "device": "desktop", "loads": 583, "score": 97,
      "lcp": 2135, "inp": 143, "cls": 0.049, "fcp": 1172, "ttfb": 433 },
    { "device": "mobile", "loads": 444, "score": 82,
      "lcp": 3183, "inp": 272, "cls": 0.108, "fcp": 1843, "ttfb": 663 },
    { "device": "tablet", "loads": 82, "score": 97,
      "lcp": 2142, "inp": 154, "cls": 0.051, "fcp": 1195, "ttfb": 439 }
  ],
  "compared": null
}

An example site’s numbers. The series and pages are shortened here; the response has all of them.

FieldWhat it holds
periodThe period read: its first and last day in timezone, and the series’ step, interval, as in the Overview.
scoreThe Performance score, 0 to 100. null with fewer than 20 measured page loads.
ratinggood (90 and up), needs_work (50 to 89), or poor (below 50). null without a score.
loadsPage loads measured in the period.
vitals.*.p75The 75th percentile: 3 in 4 page loads were at least this fast. LCP, INP, FCP, and TTFB in milliseconds; CLS unitless, to three decimals. null with fewer than 20 samples.
vitals.*.ratinggood, needs_work, or poor, by the vital’s own thresholds. null without a p75.
vitals.*.samplesThe page loads that measured this vital.
seriesOne entry per step of the period, oldest first: its page loads and score. The score is null with fewer than 10 loads in the step.
pagesEach page with at least 20 measured loads, most loads first: its loads, its score, and each vital’s p75 (null with fewer than 20 samples).
devicesThe same for desktop, mobile, and tablet.
comparednull, or with against: the other period’s from, to, score, rating, loads, and vitals. Also null when that period starts before the site’s data does.

How it’s measured

Each vital is rated with web.dev’s thresholds. The score gives each vital’s p75 a score on a curve where its good threshold scores 90 and its poor one 50, then weights them as the table says. A vital with too few samples for a p75 (fewer than 20, or 10 in a step of series) drops out, and the others count for more.

VitalGood, poor, and its share of the score
lcpLargest Contentful Paint. Good at or below 2,500 ms, poor above 4,000 ms. 30%.
inpInteraction to Next Paint. Good at or below 200 ms, poor above 500 ms. 30%.
clsCumulative Layout Shift. Good at or below 0.1, poor above 0.25. 25%.
fcpFirst Contentful Paint. Good at or below 1,800 ms, poor above 3,000 ms. 10%.
ttfbTime to First Byte. Good at or below 800 ms, poor above 1,800 ms. 5%.
  • Each page load sends its vitals once, when the visitor leaves the page or switches away. On a single-page app, the whole load’s vitals, interactions and layout shifts after a route change included, count for the page the load started on; a route change gets no vitals of its own.
  • Samples differ by vital. INP needs a click, tap, or key press, and a browser that can’t measure a vital leaves it out.
  • Filters work as in every report. A page or hostname filter keeps the loads of matching pages.
  • Web Vitals never count toward your plan’s usage. What counts toward usage

Errors

StatusCodeWhen
400invalid_parameterA parameter it doesn’t take; a period, filter, or time zone we can’t parse; a segment or cohort the site doesn’t have; or against=month for a period over 5 weeks.
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.

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 Performance, then the Share menu’s Copy as API request: the page on your screen as a curl request, with its period, comparison, and filters as parameters. It reads your API key from the LYLI_API_KEY environment variable, so a copied request never contains a key.