Vercel Analytics from the command line, and a speed check in CI

npx lookoutstats shows a Vercel project's visitors and speed grade in the terminal, lists every site, and fails a scheduled CI job when a grade drops.

Last updated November 21, 2026

What the command line does

npx lookoutstats shows your Vercel Web Analytics and Speed Insights numbers in a terminal. It needs Node.js 20 or later and installs nothing permanent. It is read-only.

Sign in

  1. Run npx lookoutstats login. The browser opens lookoutstats.com and the terminal shows a code.
  2. Make sure the page shows the same code as the terminal.
  3. Click Approve. Only a workspace owner can approve.

The command saves a read-only key to ~/.lookout. Only your user can read the file. Settings › API & MCP in Lookout lists the key with the computer's name, and you can revoke it there. npx lookoutstats logout removes the key from the computer.

This folder's site

Run the command in a project folder:

npx lookoutstats

  northwind.io · last 7 days

  Visitors     13,912   ▲ 9.6%
  Page views   34,780
  Speed        A        3 of 3 checks pass on phones
               LCP 2.1s · INP 140ms · CLS 0.04

  Top pages    /           6,204
               /pricing    3,483

It finds the site from the folder's Vercel link (.vercel/project.json, or .vercel/repo.json and apps/* in a monorepo). A folder without a link needs the site: --site northwind.io or the project id. Add --range 24h or --range 30d to change the period.

Every site

npx lookoutstats sites shows every site in the workspace as a table, busiest first, with visitors, change and speed grade. Add --board "Landing pages" to show one board.

A speed check in CI

npx lookoutstats check --min-grade B lists each site's grade. The exit codes are:

  • 0: every graded site is at the minimum grade or better.
  • 1: one or more sites are below the minimum grade.
  • 2: the command could not run, for example no key, no such site, or a network error.

The grade comes from real visits to what is already live. So run the check on a schedule or after a deploy, not as a gate before the build. This GitHub Actions workflow checks one site every day:

# .github/workflows/speed.yml
name: Speed check
on:
  schedule:
    - cron: "0 6 * * *"   # every day at 06:00 UTC
  workflow_dispatch:
jobs:
  speed:
    runs-on: ubuntu-latest
    steps:
      - run: npx --yes lookoutstats check --min-grade B --site northwind.io
        env:
          LOOKOUT_API_KEY: ${{ secrets.LOOKOUT_API_KEY }}
  1. Create a read-only key in Lookout, Settings › API & MCP.
  2. In the repository, open Settings › Secrets and variables › Actions and add the secret LOOKOUT_API_KEY.
  3. Add the workflow file above. Change the site and the minimum grade.

A CI checkout has no Vercel link, so name the site with --site or the variable LOOKOUT_SITE. Without either, check checks every site in the workspace.

Numbers as JSON

Add --json to any command to get the same numbers as JSON, for scripts and dashboards. With check, the exit code stays the same.

The command line is open source (MIT): lookoutstats/lookout-dev. For the editor, see Vercel Analytics in VS Code and Cursor and the Editor & CLI page.

Common questions

Can check stop a slow release before it ships?

No. The grade comes from real visits to the version that is already live, over the period (7 days by default). A build step cannot measure the new build. Run check after a deploy or on a schedule, so it tells you when a site gets slower.

What happens to a site without speed data?

check skips it and says so. A site has no grade when Speed Insights is off, when the project has no Speed Insights Plus, or when it had fewer than 50 page loads. Add --require-data to fail those sites instead.

Which key should CI use?

A read-only key from Lookout, Settings › API & MCP, saved as a secret named LOOKOUT_API_KEY. Don't create a key with the notes and exports scope for CI.