Skip to main content
GET
/
web_vitals_current
Web Vitals Current
curl --request GET \
  --url https://api.example.com/web_vitals_current
{
  "metric_name": "<string>",
  "avg_value": 123,
  "p75": 123,
  "p90": 123,
  "p95": 123,
  "p99": 123,
  "measurements": 123,
  "score": 123,
  "status": "<string>",
  "units": "<string>",
  "description": "<string>",
  "thresholds": "<string>",
  "domain": "<string>",
  "tenant_id": "<string>"
}
Returns aggregated web vitals metrics over a specified time period with performance scores and status indicators. This endpoint provides a high-level overview of your site’s Core Web Vitals health.

Endpoint

GET https://api.tinybird.co/v0/pipes/web_vitals_current.json

Parameters

days
integer
default:"1"
Number of days to analyze. Defaults to 1 day (last 24 hours).
tenant_id
string
Filter results by tenant ID for multi-tenant applications.
domain
string
Filter results by domain name (e.g., “example.com”).

Web Vitals Metrics Tracked

This endpoint tracks all five Core Web Vitals metrics:

LCP (Largest Contentful Paint)

Measures loading performance - the time it takes for the largest content element to become visible.
  • Excellent: ≤2500ms
  • Good: ≤4000ms
  • Poor: >4000ms

TTFB (Time to First Byte)

Measures server response time - how quickly the server responds to a request.
  • Excellent: ≤500ms
  • Good: ≤1000ms
  • Poor: >1000ms

FCP (First Contentful Paint)

Measures time until first content - when the browser renders the first piece of content.
  • Excellent: ≤1800ms
  • Good: ≤3000ms
  • Poor: >3000ms

INP (Interaction to Next Paint)

Measures responsiveness - the time between user interaction and visual feedback.
  • Excellent: ≤200ms
  • Good: ≤500ms
  • Poor: >500ms

CLS (Cumulative Layout Shift)

Measures visual stability - how much unexpected layout shift occurs.
  • Excellent: ≤0.1
  • Good: ≤0.25
  • Poor: >0.25

Response Fields

metric_name
string
The name of the web vitals metric (LCP, TTFB, FCP, INP, or CLS).
avg_value
float
Average value of the metric over the specified time period. Units depend on the metric (ms for timing metrics, score for CLS).
p75
float
75th percentile value - 75% of measurements are below this value.
p90
float
90th percentile value - 90% of measurements are below this value.
p95
float
95th percentile value - 95% of measurements are below this value.
p99
float
99th percentile value - 99% of measurements are below this value.
measurements
integer
Total number of measurements collected for this metric.
score
integer
Performance score from 0-100. Higher is better.
  • 100 = Excellent
  • 75 = Good
  • 25 = Poor
status
string
Performance status: “Excellent”, “Good”, or “Poor” based on Web Vitals thresholds.
units
string
Units for the metric value (“ms” for milliseconds, “score” for CLS).
description
string
Human-readable description of what the metric measures.
thresholds
string
Text description of the performance thresholds for this metric.
domain
string
The domain this metric was measured on.
tenant_id
string
The tenant ID for multi-tenant applications.

Example Request

curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://api.tinybird.co/v0/pipes/web_vitals_current.json?days=7&domain=example.com"

Example Response

{
  "data": [
    {
      "metric_name": "LCP",
      "avg_value": 2234.56,
      "p75": 2500.12,
      "p90": 3200.45,
      "p95": 3800.22,
      "p99": 4500.88,
      "measurements": 1523,
      "score": 100,
      "status": "Excellent",
      "units": "ms",
      "description": "Largest Contentful Paint - measures loading performance",
      "thresholds": "Excellent: ≤2500ms, Good: ≤4000ms, Poor: >4000ms",
      "domain": "example.com",
      "tenant_id": "tenant_123"
    },
    {
      "metric_name": "TTFB",
      "avg_value": 345.67,
      "p75": 412.34,
      "p90": 567.89,
      "p95": 678.90,
      "p99": 890.12,
      "measurements": 1523,
      "score": 100,
      "status": "Excellent",
      "units": "ms",
      "description": "Time to First Byte - measures server response time",
      "thresholds": "Excellent: ≤500ms, Good: ≤1000ms, Poor: >1000ms",
      "domain": "example.com",
      "tenant_id": "tenant_123"
    },
    {
      "metric_name": "CLS",
      "avg_value": 0.08,
      "p75": 0.09,
      "p90": 0.12,
      "p95": 0.15,
      "p99": 0.22,
      "measurements": 1523,
      "score": 100,
      "status": "Excellent",
      "units": "score",
      "description": "Cumulative Layout Shift - measures visual stability",
      "thresholds": "Excellent: ≤0.1, Good: ≤0.25, Poor: >0.25",
      "domain": "example.com",
      "tenant_id": "tenant_123"
    }
  ]
}

Use Cases

  • Dashboard Overview: Display current performance status across all Core Web Vitals
  • Performance Monitoring: Track whether your site meets Web Vitals standards
  • Alerting: Set up alerts when metrics fall below “Good” thresholds
  • Historical Analysis: Compare performance across different time periods using the days parameter

Build docs developers (and LLMs) love