Accessing Metrics with Vercel CLI
Use vercel metrics to query Speed Insights data from your terminal. You can reproduce common dashboard views, count collected data points, and order grouped results to find the best and worst performing pages.
Speed Insights metrics are available through vercel metrics without Observability Plus.
The schema is the source of truth for the metrics, dimensions, and aggregations available to your account. Start by inspecting the available Speed Insights metrics:
vercel metrics schema
vercel metrics schema vercel.speed_insightsSpeed Insights exposes value metrics for Core Web Vitals and related Web Vitals. Use vercel.speed_insights.lcp_ms, vercel.speed_insights.inp_ms, and vercel.speed_insights.cls for Core Web Vitals.
Use vercel.speed_insights.fcp_ms and vercel.speed_insights.ttfb_ms for the additional Speed Insights metrics.
Query P75 Largest Contentful Paint by route:
vercel metrics vercel.speed_insights.lcp_ms --aggregation p75 --group-by route --since 7d --project project-name --prodWhen you group a Speed Insights value metric, vercel metrics orders results by collected data points for that metric. For the LCP query above, routes are ordered by count desc unless you pass --order-by value.
Query P75 Interaction to Next Paint by device type:
vercel metrics vercel.speed_insights.inp_ms --aggregation p75 --group-by deviceType --since 7d --order-by count --project project-name --prodQuery P75 Cumulative Layout Shift by country:
vercel metrics vercel.speed_insights.cls --aggregation p75 --group-by country --since 7d --limit 10 --project project-name --prodQuery daily P75 Largest Contentful Paint for one route:
vercel metrics vercel.speed_insights.lcp_ms --aggregation p75 --filter 'route:/dashboard' --since 7d --granularity 1d --project project-name --prodEach Speed Insights value metric supports the count aggregation for collected data points. Use data point counts to evaluate how representative a metric value is. Fewer data points can make comparisons less reliable.
By default, grouped queries return the results with the most data points first. To make this explicit, use --order-by count.
Query collected LCP data points by route:
vercel metrics vercel.speed_insights.lcp_ms --aggregation count --group-by route --since 7d --project project-name --prodQuery collected CLS data points by country:
vercel metrics vercel.speed_insights.cls --aggregation count --group-by country --since 7d --limit 10 --project project-name --prodUse --group-by route to compare pages, then use --order-by value to order the grouped results by the selected value metric instead of data point count. Lower values are better for LCP, FCP, INP, TTFB, and CLS.
Find the slowest production routes by P75 LCP:
vercel metrics vercel.speed_insights.lcp_ms --aggregation p75 --group-by route --since 7d --order-by value --order desc --limit 10 --project project-name --prodFind the fastest production routes by P75 LCP:
vercel metrics vercel.speed_insights.lcp_ms --aggregation p75 --group-by route --since 7d --order-by value --order asc --limit 10 --project project-name --prodFind the routes with the lowest P75 CLS:
vercel metrics vercel.speed_insights.cls --aggregation p75 --group-by route --since 7d --order-by value --order asc --limit 10 --project project-name --prodThe following query shapes are not available in the Speed Insights dashboard. Use them when you need more precise filtering, multi-dimensional comparisons, or team-wide reporting.
Use a field-scoped OR expression to include multiple path prefixes, != to exclude a value, and repeated --group-by options to compare Core Web Vitals for selected path prefixes:
vercel metrics vercel.speed_insights.lcp_ms --aggregation p75 --filter 'requestPath:(/docs* OR /guides*)' --filter 'country != US' --group-by route --group-by deviceType --since 7d --project project-name --prodUse --all with projectId to compare Speed Insights metrics across every project in the current team:
vercel metrics vercel.speed_insights.lcp_ms --all --aggregation p75 --group-by projectId --group-by country --since 7d --limit 20 --prodFor all options, see the vercel metrics reference. For what each dashboard metric measures, see Speed Insights Metrics.
Was this helpful?