---
title: "Counts custom events"
method: GET
path: "/v1/query/web-analytics/events/count"
tags: ["web-analytics"]
---

# Counts custom events

`GET /v1/query/web-analytics/events/count`

## Request

- Base URL: `https://api.vercel.com`
- URL: `https://api.vercel.com/v1/query/web-analytics/events/count`
- Auth: HTTP bearer

Counts the number of custom events on a project (production only), since Web Analytics was enabled. Results can be filtered on supported dimensions.

## Query parameters

- `projectId` string, required: The project identifier or the project name
- `since` union: Timestamp in milliseconds, or a valid Date string. Selects data from (including) this date and time. Will be adjusted according to the desired time granularity.
  - number
  - string
- `until` union: Timestamp in milliseconds, or a valid Date string. Selects data until (including) this date. Will be adjusted according to the desired time granularity.
  - number
  - string
- `filter` string: OData-compliant filter. Encode the value when sending it in a URL. Allows filtering on one or multiple dimensions. Supported dimensions: country, deviceType, environment, requestPath, referrerHostname, osName, browserName, route, utmSource, utmMedium, utmCampaign, utmContent, utmTerm, eventName. JSON dimensions filtered by key: flags/<name>, eventData/<property>, for example eventData/plan eq 'pro'. Wrap keys containing characters other than letters, digits, and underscores in single quotes, for example flags/'my-flag' eq 'true'. Supported operations include eq, ne, in, and logical operators and, or, not with parentheses. Functions such as startswith are supported by the OData parser.
- `teamId` string
- `slug` string

## Response `200`

- object
  - `data` union, required
    - object
      - `browserName` string, required
      - `country` string, required
      - `deviceType` string, required
      - `environment` string, required
      - `eventData` string, required
      - `eventName` string, required
      - `flags` string, required
      - `groupId` string, required
      - `osName` string, required
      - `projectId` string, required
      - `projectName` string, required
      - `referrerHostname` string, required
      - `requestHostname` string, required
      - `requestPath` string, required
      - `route` string, required
      - `userId` string, required
      - `utmCampaign` string, required
      - `utmContent` string, required
      - `utmMedium` string, required
      - `utmSource` string, required
      - `utmTerm` string, required
      - `visitorId` string, required
    - object
      - `count` number, required
      - `visitors` number, required
  - `query` object, required
    - `filter` string
    - `since` string, required
    - `until` string, required
  - `version` number, required

## Other responses

- `400`: One of the provided values in the request query is invalid.
- `401`: The request is not authorized.
- `402`
- `403`: You do not have permission to access this resource.
- `404`
- `410`
- `503`

## Changes

- **2026-10-23** `5a120284f519`: 2 info
  - added the required property `data/oneOf[subschema #1]/groupId` to the response with the `200` status
  - added the required property `data/oneOf[subschema #1]/userId` to the response with the `200` status
- **2026-10-03** `2c463a1d98b1`: 1 warning
  - for the `query` request parameter `filter`, the maxLength was set to `2048`
- **2026-09-26** `9688d14fb03a`: 220 breaking
  - removed the required property `data/oneOf[subschema #1]/affinityDisplacedProvider` from the response with the `200` status
  - removed the required property `data/oneOf[subschema #1]/affinityOutcome` from the response with the `200` status
  - removed the required property `data/oneOf[subschema #1]/affinityPinnedProvider` from the response with the `200` status
  - removed the required property `data/oneOf[subschema #1]/aiGatewayModelId` from the response with the `200` status
  - …216 more
- **2026-09-25** `7881412aa042`: 3 info
  - added the required property `data/oneOf[subschema #1]/affinityDisplacedProvider` to the response with the `200` status
  - added the required property `data/oneOf[subschema #1]/affinityPinnedProvider` to the response with the `200` status
  - added the required property `data/oneOf[subschema #1]/clientSessionIdSource` to the response with the `200` status
- …earlier changes not shown

[Operation history](https://skmtc.dev/vercel/apis/vercel-api/changes/v1/query/web-analytics/events/count/get.md)

---

[API](https://skmtc.dev/vercel/apis/vercel-api.md) - [All operations](https://skmtc.dev/vercel/apis/vercel-api/llms.txt) - [OpenAPI document](https://skmtc.dev/vercel/apis/vercel-api/revisions/60686c0e1f6a?raw)
