Vercel Web Analytics API: visitors across projects
What Vercel's public Web Analytics API returns, what it takes to query every project in a team, and the parts you'd have to build yourself.
Last updated October 12, 2026
What the API offers
Vercel made its Web Analytics API public in May 2026 (changelog). It reads the same aggregated data as the Analytics tab in the dashboard. Vercel’s guide describes two datasets:
- Visits: automatically tracked page views, with the metrics
pageviewsandvisitors. - Events: custom events sent with
track(), withcountandvisitors.
Each dataset has two kinds of query:
- Count (
/v1/query/web-analytics/visits/count) returns one total. Vercel’s reference says it counts production data. - Aggregate (
/v1/query/web-analytics/visits/aggregate) returns rows grouped by up to two dimensions inby: at most one time granularity (hour, day, week, month or year) plus dimensions such ascountry,referrerHostname,requestPath,route,deviceType,browserName,osNameand the UTM fields.limit(1 to 100, default 10) caps the rows and groups the rest into “Others”. See the reference.
Both take an optional filter in OData syntax, for example requestPath eq '/pricing', which by default covers production only. You authenticate with a Vercel access token as a bearer token, pass the project’s projectId, and for team projects add teamId or slug. The project needs Web Analytics enabled.
One project, one request
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"The response’s data holds pageviews and visitors. For a chart, ask the aggregate endpoint for one row per day; each row has a timestamp with pageviews and visitors:
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"projectId is required on every query, so each request answers for one project. That’s fine for a single site and where the work starts for many.
What you build to see every project
- A token per team. A team-scoped token sees one team, so agencies with several teams keep several. In our tests in October 2026, tokens from a Vercel integration could list projects but got 404 from the Web Analytics endpoints; personal access tokens worked.
- The project list. List each team’s projects with Vercel’s projects API, page through them, and skip the ones without Web Analytics.
- Several queries per project. Totals, a daily or hourly series, top referrers and countries are separate calls. Lookout’s dashboard makes five per project, so 100 projects cost about 500 calls on a cold cache.
- The previous period. “Up 12% on last week” needs the same queries for the period before. That period has to fall inside the plan’s reporting window, which Vercel’s pricing page puts at 1 month on Hobby, 12 months on Pro and 24 months with Web Analytics Plus or Enterprise. A 30-day comparison on Hobby has nothing to compare with.
- Rate limits and caching. Vercel’s Web Analytics docs don’t state a limit. When we tested, responses carried
x-ratelimit-limit: 400with a reset about a minute later. At several calls per project, a large team needs a queue, backoff on 429 and a cache, or every page load starts over. - Time zones. In our tests, time buckets were in UTC and the API took no time zone parameter, so “today” follows UTC.
- Somewhere to look at it, and a safe place for the tokens.
The Vercel CLI alternative
For a one-off answer in a terminal, vercel metrics queries the same data. Its documentation shows a query across every project in the current team with --all and --group-by projectId. It’s a good fit for questions you ask once; it isn’t a dashboard someone else can open.
Or skip the script
Lookout is that script, finished: you paste a team-scoped token (how to create one), pick the projects, and see visitors, page views, pages per visit, referrers and countries for all of them side by side, against the previous period where the plan keeps it. It only calls Vercel’s read endpoints, caches results, and handles the rate limits. For the trade-offs between the approaches, see how to see Vercel Analytics for multiple projects, or open the live demo.