DEV Community

galb
galb

Posted on Originally published at lookoutstats.com AI-assisted

How to see Vercel Web Analytics for all your projects at once

If you have more than a few projects on Vercel, you know the routine: open a project, click Analytics, note the numbers, go back, open the next one. Vercel shows Web Analytics one project at a time.

In May 2026 Vercel made its Web Analytics API public. This post shows how to use it to get the numbers for every project, and what you have to build around it.

The API in two minutes

There are two datasets:

  • Visits: page views tracked automatically, with pageviews and visitors.
  • Events: custom events sent with track(), with count and visitors.

Each dataset has two queries:

  • Count (/v1/query/web-analytics/visits/count) returns one total.
  • Aggregate (/v1/query/web-analytics/visits/aggregate) returns rows grouped by up to two dimensions in by. One can be a time unit (hour, day, week, month, year). The others include country, referrerHostname, requestPath, deviceType, browserName and the UTM fields.

You authenticate with a normal Vercel access token. You pass a projectId, plus teamId for team projects.

Visitors and page views for one project over a week:

curl --get "https://api.vercel.com/v1/query/web-analytics/visits/count" \
  -H "Authorization: Bearer $VERCEL_TOKEN" \
  --data-urlencode "teamId=team_1234567890" \
  --data-urlencode "projectId=prj_1234567890" \
  --data-urlencode "since=2026-10-05" \
  --data-urlencode "until=2026-10-11"
Enter fullscreen mode Exit fullscreen mode

For a chart, ask the aggregate endpoint for one row per day:

curl --get "https://api.vercel.com/v1/query/web-analytics/visits/aggregate" \
  -H "Authorization: Bearer $VERCEL_TOKEN" \
  --data-urlencode "teamId=team_1234567890" \
  --data-urlencode "projectId=prj_1234567890" \
  --data-urlencode "since=2026-10-05" \
  --data-urlencode "until=2026-10-11" \
  --data-urlencode "by=day"
Enter fullscreen mode Exit fullscreen mode

The catch: one project per request

projectId is required on every query. To see all your projects, you build the rest yourself:

  1. List the projects. Call the projects API for each team, page through the results, and skip projects without Web Analytics.
  2. Make several queries per project. Totals, a daily series, top referrers and top countries are separate calls. At five calls per project, 100 projects cost about 500 calls.
  3. Query the previous period too. "Up 12% on last week" needs the same queries again for the week before. That period must be inside your plan's reporting window: 1 month on Hobby, 12 months on Pro, 24 months with Web Analytics Plus or Enterprise.
  4. Respect rate limits. The docs don't state a limit. In our tests, responses carried x-ratelimit-limit: 400 with a reset about a minute later. A large team needs a queue, backoff on 429, and a cache.
  5. Mind time zones. In our tests, time buckets were in UTC and the API had no time zone parameter.
  6. Keep one token per team. A team-scoped token sees one team, so agencies keep several. In our tests, personal access tokens worked, but integration tokens got 404 from the Web Analytics endpoints.

For a one-off answer: the CLI

vercel metrics queries the same data from a terminal. With --all and --group-by projectId it covers every project in the current team. It's a good fit for a question you ask once. It isn't a dashboard someone else can open.

Or use Lookout

I hit this problem with my own projects, so I built Lookout. It's the script above, finished:

  • Every project's visitors, page views and pages per visit on one board, against the previous period
  • Compare up to five projects on one chart
  • A read-only share link per board for clients, with no Vercel seat
  • Email alerts when a site spikes or drops, and a TV mode
  • An open-source MCP server, lookout-mcp, so Claude or Cursor can answer "which of my sites grew this week?"

You paste a Vercel token scoped the way you choose, and Lookout caches results and handles the rate limits. There's a live demo that needs no sign-up.

Whichever way you go, I'd like to hear how you track several Vercel projects today. Leave a comment.

Top comments (0)