---
title: "POST /v1/analytics/query | Documentation - Vemetric"
description: "Query analytics"
url: https://vemetric.com/docs/api/endpoints/post-v1-analytics-query
---

# Query analytics

Query analytics metrics with optional grouping, sorting and filters.

* * *

Method

POST

Path

/v1/analytics/query

The Query Endpoint is very flexible and can be used to retrieve aggregated analytics data based on custom filters, groupings, and time ranges. It basically lets you retrieve all the data you can see in the [Vemetric Dashboard](https://vemetric.com/docs/dashboard), programmatically.

## Examples

Below you can see several examples of how to use the Query Endpoint to retrieve different types of aggregated analytics data. Further down this page, you can find a [detailed reference](#request-body) of all the available options you can pass.

Copy the JSON body of any of these examples, and use it in a `POST` request to `https://api.vemetric.com/v1/analytics/query` with your API key to see the results.

```json
{
  "dateRange": "7days",
  "metrics": ["users", "pageviews", "events", "bounceRate", "visitDuration"]
}
```

```json
{
  "dateRange": "30days",
  "metrics": ["users", "pageviews"],
  "groupBy": ["country"],
  "orderBy": [["users", "desc"]]
}
```

```json
{
  "dateRange": "3months",
  "metrics": ["users", "pageviews"],
  "groupBy": ["interval:day"]
}
```

```json
{
  "dateRange": "30days",
  "metrics": ["users", "events"],
  "groupBy": ["interval:auto"],
  "orderBy": [["date", "asc"]],
  "filters": [
    {
      "type": "event",
      "name": {
        "operator": "eq",
        "value": "Signup"
      }
    }
  ]
}
```

```json
{
  "dateRange": "30days",
  "metrics": ["pageviews"],
  "groupBy": ["page:path"],
  "orderBy": [["pageviews", "desc"]],
  "filters": [
    {
      "type": "page",
      "path": {
        "operator": "startsWith",
        "value": "/blog/"
      }
    }
  ]
}
```

```json
{
  "dateRange": "30days",
  "metrics": ["users", "events"],
  "groupBy": ["event:prop:plan"],
  "filters": [
    {
      "type": "event",
      "name": {
        "operator": "eq",
        "value": "Signup"
      }
    }
  ]
}
```

```json
{
  "dateRange": ["2026-01-01", "2026-01-31"],
  "metrics": ["users"],
  "filters": [
    {
      "type": "referrer",
      "operator": "eq",
      "value": "ChatGPT"
    }
  ]
}
```

```json
{
  "dateRange": "30days",
  "metrics": ["users"],
  "groupBy": ["referrerType"],
  "orderBy": [["users", "desc"]]
}
```

```json
{
  "dateRange": "7days",
  "metrics": ["users"],
  "filters": [
    {
      "type": "referrerType",
      "operator": "oneOf",
      "value": ["none"]
    }
  ]
}
```

Be sure to also check out the [filter values endpoint](https://vemetric.com/docs/api/endpoints/post-v1-filters-values) to see which values you can use in the `filters` field.

To group by the properties of a custom event (`event:prop:<name>`), you can look up their names with the [event properties endpoint](https://vemetric.com/docs/api/endpoints/post-v1-events-properties).

## How filters work

Filters select **users**: the results include all data of the users who match your filters in the given period. For example, a page filter for `/blog` doesn’t only count the blog pages, but also the other pages and sessions of the users who visited your blog. Only the `pageviews` and `events` metrics apply page and event filters to the counted pageviews and events themselves.

The operators, empty values, time series intervals, the default order and the values of each field are described in the [reference below](#request-body). What each referrer type (`referrerType`) means is explained in [Referrers and referrer types](https://vemetric.com/docs/dashboard#referrers-and-referrer-types).

## Headers

Authorization

required

Project or organization API key (starts with `vem_`), created in the project or organization settings on the API tab. Organization keys name the project of each request in the `X-Vemetric-Project` header.

Example: `Bearer vem_xxxxxxxxxxxx`

X-Vemetric-Project

optional

ID of the project the request is about. Required for organization keys; optional for project keys (must be the key's project if sent).

Example: `1234567890123456`

## Request Body (required)

application/json object

`dateRange`

\* required

Description

Can be either one of the preset strings below, or an array with two date strings \[start, end\]. Date strings can be either in YYYY-MM-DD format or UTC ISO-8601 format with second precision.

Type

"live" | "1hr" | "24hrs" | "7days" | "30days" | "3months" | "6months" | "1year" | array<string, string>

Example

\["2026-01-01T12:00:00Z","2026-01-31T12:00:00Z"\]

* * *

`metrics`

Description

Metrics to calculate and include in the response.

Type

array<"users" | "pageviews" | "events" | "bounceRate" | "visitDuration">

Default

\["users","pageviews","events"\]

* * *

`groupBy`

Description

Allowed values: "interval:auto", "interval:hour", "interval:day", "interval:week", "interval:month", "country", "city", "page:origin", "page:path", "browser", "deviceType", "os", "referrer", "referrerType", "utm_", "event:name", "event:prop:<property\_name>", or the first visit: "firstVisit:referrer", "firstVisit:referrerType", "firstVisit:utm_", "firstVisit:page:origin", "firstVisit:page:path". At the moment it's only possible to group by one field, please tell us if you need more.  
  
The interval values return a time series with one row per hour, day, week (starting on Monday) or month, for every interval of the period, also the ones without data (`users`, `pageviews` and `events` are `0` there, `bounceRate` and `visitDuration` are `null`). If the period runs until now, its last interval is still in progress, so lower values there aren't a drop. "interval:auto" picks the interval from the length of the period: hourly up to 2 days, daily up to 31 days, weekly up to 90 days and monthly beyond (for presets: `live` every 30 seconds, `1hr` every 10 minutes, `24hrs` hourly, `7days` and `30days` daily, `3months` weekly, `6months` and `1year` monthly).  
  
Rows without a value for the field (e.g. visits without a UTM campaign, or for `referrer` visits without a referrer and visits from the project's own domain) are grouped under an empty string `""`, which you can also use as a filter value.  
  
The `firstVisit:` values group by where each user came from on their first visit ever (first-touch attribution), which can be before the selected period, while `referrer`, `utm` and `page:*` group each visit by its own source (last touch). Combined with the `users` metric and an event filter, e.g. for a signup event, they show which first-touch sources bring conversions. Vemetric stores the first visit when a user is identified, so anonymous users are grouped under `""`.

Type

array<"country" | "city" | "page:origin" | "page:path" | "browser" | "deviceType" | "os" | "referrer" | "referrerType" | "utmCampaign" | "utmContent" | "utmMedium" | "utmSource" | "utmTerm" | "event:name" | "firstVisit:referrer" | "firstVisit:referrerType" | "firstVisit:utmCampaign" | "firstVisit:utmContent" | "firstVisit:utmMedium" | "firstVisit:utmSource" | "firstVisit:utmTerm" | "firstVisit:page:origin" | "firstVisit:page:path" | "interval:auto" | "interval:hour" | "interval:day" | "interval:week" | "interval:month" | string<pattern:^event:prop:(\[^\\r\\n\]+)$>>

Default

\[\]

Example

\["country"\]

* * *

`orderBy`

Description

Gives you the ability to order by a specific field and direction. At the moment it's only possible to order by one field. Without it, rows are ordered by `date` ascending when grouping by an interval, and by the first metric descending for other groupings (skipping metrics that don't apply to the grouping, like `bounceRate` per page). Rows with equal values are ordered by their group value.

Type

array<array<"users" | "pageviews" | "events" | "bounceRate" | "visitDuration" | "country" | "city" | "page:origin" | "page:path" | "browser" | "deviceType" | "os" | "referrer" | "referrerType" | "utmCampaign" | "utmContent" | "utmMedium" | "utmSource" | "utmTerm" | "event:name" | "firstVisit:referrer" | "firstVisit:referrerType" | "firstVisit:utmCampaign" | "firstVisit:utmContent" | "firstVisit:utmMedium" | "firstVisit:utmSource" | "firstVisit:utmTerm" | "firstVisit:page:origin" | "firstVisit:page:path" | "date" | string<pattern:^event:prop:(\[^\\r\\n\]+)$>, "asc" | "desc">>

Default

\[\]

Example

\[\["users","desc"\]\]

* * *

`limit`

Description

Limits the number of returned rows. Max value is 1000.

Type

integer

Default

100

* * *

`offset`

Description

Number of rows to skip from the start of the result set, to implement pagination.

Type

integer

Default

0

* * *

`filters`

Description

Ability to filter the results based on multiple criteria. Filters select users: the results include all data of the users who match the filters in the period. For example, a page filter for `/blog` also counts the other pages and sessions of the users who visited the blog. Only the `pageviews` and `events` metrics apply page and event filters to the counted pageviews and events themselves. Use an empty string to match a missing value, e.g. `{"type":"referrer","operator":"eq","value":""}` for visits without a referrer and visits from the project's own domain.

Type

array<object>

Show nested properties (12)

`type: page`

Description

Filter based on specific page view properties, like the full URL (origin + path + hash) or its individual parts.

Type

object

Default

"page"

Example

{"type":"page","origin":{"value":"https://example.com","operator":"eq"},"path":{"value":"/blog","operator":"startsWith"}}

Show nested properties (3)

`origin`

Description

Filter based on the page origin (protocol + host). For example, "https://example.com".

Type

object

Show nested properties (2)

`value`

\* required

Description

Value to filter by

Type

string

* * *

`operator`

\* required

Description

Operator to apply for the string filter. "eq" means equals, "notEq" means not equals. "any" means no restriction and also matches users without a value; to require a value, use "notEq" with an empty string.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

* * *

* * *

`path`

Description

Filter based on the page path. For example, "/blog".

Type

object

Show nested properties (2)

`value`

\* required

Description

Value to filter by

Type

string

* * *

`operator`

\* required

Description

Operator to apply for the string filter. "eq" means equals, "notEq" means not equals. "any" means no restriction and also matches users without a value; to require a value, use "notEq" with an empty string.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

* * *

* * *

`hash`

Description

Filter based on the page hash. For example, "#section1".

Type

object

Show nested properties (2)

`value`

\* required

Description

Value to filter by

Type

string

* * *

`operator`

\* required

Description

Operator to apply for the string filter. "eq" means equals, "notEq" means not equals. "any" means no restriction and also matches users without a value; to require a value, use "notEq" with an empty string.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

* * *

* * *

* * *

`type: event`

Description

Filter by event name and/or event property values.

Type

object

Default

"event"

Example

{"type":"event","name":{"operator":"eq","value":"signup"},"properties":\[{"property":"plan","operator":"eq","value":"pro"}\]}

Show nested properties (2)

`name`

Description

Filter by event name.

Type

object

Show nested properties (2)

`value`

\* required

Description

Value to filter by

Type

string

* * *

`operator`

\* required

Description

Operator to apply for the string filter. "eq" means equals, "notEq" means not equals. "any" means no restriction and also matches users without a value; to require a value, use "notEq" with an empty string.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

* * *

* * *

`properties`

Description

Filter by one or more custom event properties.

Type

array<object>

Show nested properties (3)

`property`

\* required

Description

Event property key inside custom event data.

Type

string

Example

"provider"

* * *

`value`

\* required

Description

Event property value to compare against.

Type

string

Example

"github"

* * *

`operator`

\* required

Description

String matching operator for `value`.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

Example

"eq"

* * *

* * *

* * *

`type: user`

Description

Ability to filter for either anonymous or identified users. This is useful when you want to include only known users (for example, for a retention analysis) or only anonymous users (for example, to analyze new visitor behavior).

Type

object

Default

"user"

Example

{"type":"user","anonymous":true}

Show nested properties (1)

`anonymous`

\* required

Description

Filter for anonymous (`true`) or identified (`false`) users.

Type

boolean

Example

true

* * *

* * *

`type: location`

Description

Filter by geographic location fields.

Type

object

Default

"location"

Example

{"type":"location","country":{"operator":"oneOf","value":\["US","DE"\]},"city":{"operator":"oneOf","value":\["Berlin"\]}}

Show nested properties (2)

`country`

Description

Filter by one or more country codes (ISO-3166 alpha-2, e.g. "US").

Type

object

Show nested properties (2)

`value`

\* required

Description

List of values to filter by

Type

array<string>

* * *

`operator`

\* required

Description

Operator to apply for the list filter. The "any" operator means that any value is accepted and effectively disables the filter. To require a value, use "noneOf" with \[""\].

Type

"any" | "oneOf" | "noneOf"

* * *

* * *

`city`

Description

Filter by one or more city names.

Type

object

Example

{"value":\["Berlin","New York"\],"operator":"oneOf"}

Show nested properties (2)

`value`

\* required

Description

List of values to filter by

Type

array<string>

* * *

`operator`

\* required

Description

Operator to apply for the list filter. The "any" operator means that any value is accepted and effectively disables the filter. To require a value, use "noneOf" with \[""\].

Type

"any" | "oneOf" | "noneOf"

* * *

* * *

* * *

`type: referrer`

Description

Filter by referrer name.

Type

object

Default

"referrer"

Example

{"type":"referrer","operator":"eq","value":"Google"}

Show nested properties (2)

`value`

\* required

Description

Referrer value to match, as returned when grouping by `referrer` (e.g. "Google"). An empty string matches visits without a referrer and visits from the project's own domain (referrer type `internal`). For visits without a referrer only, filter by the referrer type `none`.

Type

string

Example

"Google"

* * *

`operator`

\* required

Description

String matching operator for `value`.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

Example

"eq"

* * *

* * *

`type: referrerUrl`

Description

Filter by referrer URL.

Type

object

Default

"referrerUrl"

Example

{"type":"referrerUrl","operator":"contains","value":"google.com"}

Show nested properties (2)

`value`

\* required

Description

Referrer URL value to match.

Type

string

Example

"https://google.com"

* * *

`operator`

\* required

Description

String matching operator for `value`.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

Example

"contains"

* * *

* * *

`type: referrerType`

Description

Filter by referrer category/type.

Type

object

Default

"referrerType"

Example

{"type":"referrerType","operator":"oneOf","value":\["search"\]}

Show nested properties (2)

`value`

\* required

Description

List of referrer types to match: `none` (no referrer: typed in, bookmarks, apps), `search`, `social`, `llm`, `email`, `paid`, `internal` (came from a page on the project's own domain, e.g. a link from your app to your website; `direct` is accepted as an old name) or `unknown` (a website or source that isn't in Vemetric's list of known sources; visits without a referrer are `none`).

Type

array<string>

Example

\["search","social"\]

* * *

`operator`

\* required

Description

List matching operator for `value`. To require a value, use "noneOf" with `[""]`.

Type

"any" | "oneOf" | "noneOf"

Example

"oneOf"

* * *

* * *

`type: utmTags`

Description

Filter by one or more UTM parameters.

Type

object

Default

"utmTags"

Example

{"type":"utmTags","utmSource":{"operator":"eq","value":"google"},"utmMedium":{"operator":"eq","value":"cpc"}}

Show nested properties (5)

`utmCampaign`

Description

Filter by UTM campaign.

Type

object

Show nested properties (2)

`value`

\* required

Description

Value to filter by

Type

string

* * *

`operator`

\* required

Description

Operator to apply for the string filter. "eq" means equals, "notEq" means not equals. "any" means no restriction and also matches users without a value; to require a value, use "notEq" with an empty string.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

* * *

* * *

`utmContent`

Description

Filter by UTM content.

Type

object

Show nested properties (2)

`value`

\* required

Description

Value to filter by

Type

string

* * *

`operator`

\* required

Description

Operator to apply for the string filter. "eq" means equals, "notEq" means not equals. "any" means no restriction and also matches users without a value; to require a value, use "notEq" with an empty string.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

* * *

* * *

`utmMedium`

Description

Filter by UTM medium.

Type

object

Show nested properties (2)

`value`

\* required

Description

Value to filter by

Type

string

* * *

`operator`

\* required

Description

Operator to apply for the string filter. "eq" means equals, "notEq" means not equals. "any" means no restriction and also matches users without a value; to require a value, use "notEq" with an empty string.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

* * *

* * *

`utmSource`

Description

Filter by UTM source.

Type

object

Show nested properties (2)

`value`

\* required

Description

Value to filter by

Type

string

* * *

`operator`

\* required

Description

Operator to apply for the string filter. "eq" means equals, "notEq" means not equals. "any" means no restriction and also matches users without a value; to require a value, use "notEq" with an empty string.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

* * *

* * *

`utmTerm`

Description

Filter by UTM term.

Type

object

Show nested properties (2)

`value`

\* required

Description

Value to filter by

Type

string

* * *

`operator`

\* required

Description

Operator to apply for the string filter. "eq" means equals, "notEq" means not equals. "any" means no restriction and also matches users without a value; to require a value, use "notEq" with an empty string.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

* * *

* * *

* * *

`type: browser`

Description

Filter by browser.

Type

object

Default

"browser"

Example

{"type":"browser","operator":"oneOf","value":\["Chrome"\]}

Show nested properties (2)

`value`

\* required

Description

List of browser names to match.

Type

array<string>

Example

\["Chrome","Safari"\]

* * *

`operator`

\* required

Description

List matching operator for `value`. To require a value, use "noneOf" with `[""]`.

Type

"any" | "oneOf" | "noneOf"

Example

"oneOf"

* * *

* * *

`type: device`

Description

Filter by device type.

Type

object

Default

"device"

Example

{"type":"device","operator":"oneOf","value":\["desktop"\]}

Show nested properties (2)

`value`

\* required

Description

List of device types to match.

Type

array<string>

Example

\["desktop","mobile"\]

* * *

`operator`

\* required

Description

List matching operator for `value`. To require a value, use "noneOf" with `[""]`.

Type

"any" | "oneOf" | "noneOf"

Example

"oneOf"

* * *

* * *

`type: os`

Description

Filter by operating system.

Type

object

Default

"os"

Example

{"type":"os","operator":"oneOf","value":\["macOS"\]}

Show nested properties (2)

`value`

\* required

Description

List of operating system names to match.

Type

array<string>

Example

\["macOS","Windows"\]

* * *

`operator`

\* required

Description

List matching operator for `value`. To require a value, use "noneOf" with `[""]`.

Type

"any" | "oneOf" | "noneOf"

Example

"oneOf"

* * *

* * *

`type: funnel`

Description

Filter users based on funnel step completion.

Type

object

Default

"funnel"

Example

{"type":"funnel","id":"550e8400-e29b-41d4-a716-446655440000","step":1,"operator":"completed"}

Show nested properties (3)

`id`

\* required

Description

Funnel ID to evaluate for completion status.

Type

string

Example

"550e8400-e29b-41d4-a716-446655440000"

* * *

`step`

\* required

Description

Zero-based funnel step index to evaluate.

Type

integer

Example

1

* * *

`operator`

\* required

Description

Whether users must have completed or not completed the selected step.

Type

"completed" | "notCompleted"

Example

"completed"

* * *

* * *

* * *

`filtersOperator`

Description

Operator to apply between multiple filters. Can be either "and" or "or".

Type

"and" | "or"

Default

"and"

* * *

## Responses

200 Success

application/json

`period`

Description

Resolved query period.

Type

object

`from`

Description

Resolved UTC start timestamp for the query window.

Type

string<pattern:^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$>

Example

"2026-01-19T12:30:00Z"

* * *

`to`

Description

Resolved UTC end timestamp for the query window.

Type

string<pattern:^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$>

Example

"2026-01-19T12:30:00Z"

* * *

* * *

`query`

Description

Resolved query configuration used for this response.

Type

object

`dateRange`

Description

Echo of the incoming `dateRange` request field.

Type

"live" | "1hr" | "24hrs" | "7days" | "30days" | "3months" | "6months" | "1year" | array<string, string>

Example

\["2026-01-01T12:00:00Z","2026-01-31T12:00:00Z"\]

* * *

`groupBy`

Description

Echo of the incoming `groupBy` request field.

Type

array<"country" | "city" | "page:origin" | "page:path" | "browser" | "deviceType" | "os" | "referrer" | "referrerType" | "utmCampaign" | "utmContent" | "utmMedium" | "utmSource" | "utmTerm" | "event:name" | "firstVisit:referrer" | "firstVisit:referrerType" | "firstVisit:utmCampaign" | "firstVisit:utmContent" | "firstVisit:utmMedium" | "firstVisit:utmSource" | "firstVisit:utmTerm" | "firstVisit:page:origin" | "firstVisit:page:path" | "interval:auto" | "interval:hour" | "interval:day" | "interval:week" | "interval:month" | string<pattern:^event:prop:(\[^\\r\\n\]+)$>>

* * *

`metrics`

Description

Resolved list of metrics used in the query.

Type

array<"users" | "pageviews" | "events" | "bounceRate" | "visitDuration">

* * *

`orderBy`

Description

Echo of the incoming `orderBy` request field.

Type

array<array<"users" | "pageviews" | "events" | "bounceRate" | "visitDuration" | "country" | "city" | "page:origin" | "page:path" | "browser" | "deviceType" | "os" | "referrer" | "referrerType" | "utmCampaign" | "utmContent" | "utmMedium" | "utmSource" | "utmTerm" | "event:name" | "firstVisit:referrer" | "firstVisit:referrerType" | "firstVisit:utmCampaign" | "firstVisit:utmContent" | "firstVisit:utmMedium" | "firstVisit:utmSource" | "firstVisit:utmTerm" | "firstVisit:page:origin" | "firstVisit:page:path" | "date" | string<pattern:^event:prop:(\[^\\r\\n\]+)$>, "asc" | "desc">>

Show nested properties (1)

`[0]`

Description

Type

"users" | "pageviews" | "events" | "bounceRate" | "visitDuration" | "country" | "city" | "page:origin" | "page:path" | "browser" | "deviceType" | "os" | "referrer" | "referrerType" | "utmCampaign" | "utmContent" | "utmMedium" | "utmSource" | "utmTerm" | "event:name" | "firstVisit:referrer" | "firstVisit:referrerType" | "firstVisit:utmCampaign" | "firstVisit:utmContent" | "firstVisit:utmMedium" | "firstVisit:utmSource" | "firstVisit:utmTerm" | "firstVisit:page:origin" | "firstVisit:page:path" | "date" | string<pattern:^event:prop:(\[^\\r\\n\]+)$>

Example

"event:prop:plan"

* * *

* * *

`limit`

Description

Echo of the incoming `limit` request field.

Type

integer

* * *

`offset`

Description

Echo of the incoming `offset` request field.

Type

integer

* * *

`filters`

Description

Echo of the incoming `filters` request field.

Type

array<object>

Show nested properties (12)

`type: page`

Description

Filter based on specific page view properties, like the full URL (origin + path + hash) or its individual parts.

Type

object

Default

"page"

Example

{"type":"page","origin":{"value":"https://example.com","operator":"eq"},"path":{"value":"/blog","operator":"startsWith"}}

Show nested properties (3)

`origin`

Description

Filter based on the page origin (protocol + host). For example, "https://example.com".

Type

object

Show nested properties (2)

`value`

Description

Value to filter by

Type

string

* * *

`operator`

Description

Operator to apply for the string filter. "eq" means equals, "notEq" means not equals. "any" means no restriction and also matches users without a value; to require a value, use "notEq" with an empty string.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

* * *

* * *

`path`

Description

Filter based on the page path. For example, "/blog".

Type

object

Show nested properties (2)

`value`

Description

Value to filter by

Type

string

* * *

`operator`

Description

Operator to apply for the string filter. "eq" means equals, "notEq" means not equals. "any" means no restriction and also matches users without a value; to require a value, use "notEq" with an empty string.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

* * *

* * *

`hash`

Description

Filter based on the page hash. For example, "#section1".

Type

object

Show nested properties (2)

`value`

Description

Value to filter by

Type

string

* * *

`operator`

Description

Operator to apply for the string filter. "eq" means equals, "notEq" means not equals. "any" means no restriction and also matches users without a value; to require a value, use "notEq" with an empty string.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

* * *

* * *

* * *

`type: event`

Description

Filter by event name and/or event property values.

Type

object

Default

"event"

Example

{"type":"event","name":{"operator":"eq","value":"signup"},"properties":\[{"property":"plan","operator":"eq","value":"pro"}\]}

Show nested properties (2)

`name`

Description

Filter by event name.

Type

object

Show nested properties (2)

`value`

Description

Value to filter by

Type

string

* * *

`operator`

Description

Operator to apply for the string filter. "eq" means equals, "notEq" means not equals. "any" means no restriction and also matches users without a value; to require a value, use "notEq" with an empty string.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

* * *

* * *

`properties`

Description

Filter by one or more custom event properties.

Type

array<object>

Show nested properties (3)

`property`

Description

Event property key inside custom event data.

Type

string

Example

"provider"

* * *

`value`

Description

Event property value to compare against.

Type

string

Example

"github"

* * *

`operator`

Description

String matching operator for `value`.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

Example

"eq"

* * *

* * *

* * *

`type: user`

Description

Ability to filter for either anonymous or identified users. This is useful when you want to include only known users (for example, for a retention analysis) or only anonymous users (for example, to analyze new visitor behavior).

Type

object

Default

"user"

Example

{"type":"user","anonymous":true}

Show nested properties (1)

`anonymous`

Description

Filter for anonymous (`true`) or identified (`false`) users.

Type

boolean

Example

true

* * *

* * *

`type: location`

Description

Filter by geographic location fields.

Type

object

Default

"location"

Example

{"type":"location","country":{"operator":"oneOf","value":\["US","DE"\]},"city":{"operator":"oneOf","value":\["Berlin"\]}}

Show nested properties (2)

`country`

Description

Filter by one or more country codes (ISO-3166 alpha-2, e.g. "US").

Type

object

Show nested properties (2)

`value`

Description

List of values to filter by

Type

array<string>

* * *

`operator`

Description

Operator to apply for the list filter. The "any" operator means that any value is accepted and effectively disables the filter. To require a value, use "noneOf" with \[""\].

Type

"any" | "oneOf" | "noneOf"

* * *

* * *

`city`

Description

Filter by one or more city names.

Type

object

Example

{"value":\["Berlin","New York"\],"operator":"oneOf"}

Show nested properties (2)

`value`

Description

List of values to filter by

Type

array<string>

* * *

`operator`

Description

Operator to apply for the list filter. The "any" operator means that any value is accepted and effectively disables the filter. To require a value, use "noneOf" with \[""\].

Type

"any" | "oneOf" | "noneOf"

* * *

* * *

* * *

`type: referrer`

Description

Filter by referrer name.

Type

object

Default

"referrer"

Example

{"type":"referrer","operator":"eq","value":"Google"}

Show nested properties (2)

`value`

Description

Referrer value to match, as returned when grouping by `referrer` (e.g. "Google"). An empty string matches visits without a referrer and visits from the project's own domain (referrer type `internal`). For visits without a referrer only, filter by the referrer type `none`.

Type

string

Example

"Google"

* * *

`operator`

Description

String matching operator for `value`.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

Example

"eq"

* * *

* * *

`type: referrerUrl`

Description

Filter by referrer URL.

Type

object

Default

"referrerUrl"

Example

{"type":"referrerUrl","operator":"contains","value":"google.com"}

Show nested properties (2)

`value`

Description

Referrer URL value to match.

Type

string

Example

"https://google.com"

* * *

`operator`

Description

String matching operator for `value`.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

Example

"contains"

* * *

* * *

`type: referrerType`

Description

Filter by referrer category/type.

Type

object

Default

"referrerType"

Example

{"type":"referrerType","operator":"oneOf","value":\["search"\]}

Show nested properties (2)

`value`

Description

List of referrer types to match: `none` (no referrer: typed in, bookmarks, apps), `search`, `social`, `llm`, `email`, `paid`, `internal` (came from a page on the project's own domain, e.g. a link from your app to your website; `direct` is accepted as an old name) or `unknown` (a website or source that isn't in Vemetric's list of known sources; visits without a referrer are `none`).

Type

array<string>

Example

\["search","social"\]

* * *

`operator`

Description

List matching operator for `value`. To require a value, use "noneOf" with `[""]`.

Type

"any" | "oneOf" | "noneOf"

Example

"oneOf"

* * *

* * *

`type: utmTags`

Description

Filter by one or more UTM parameters.

Type

object

Default

"utmTags"

Example

{"type":"utmTags","utmSource":{"operator":"eq","value":"google"},"utmMedium":{"operator":"eq","value":"cpc"}}

Show nested properties (5)

`utmCampaign`

Description

Filter by UTM campaign.

Type

object

Show nested properties (2)

`value`

Description

Value to filter by

Type

string

* * *

`operator`

Description

Operator to apply for the string filter. "eq" means equals, "notEq" means not equals. "any" means no restriction and also matches users without a value; to require a value, use "notEq" with an empty string.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

* * *

* * *

`utmContent`

Description

Filter by UTM content.

Type

object

Show nested properties (2)

`value`

Description

Value to filter by

Type

string

* * *

`operator`

Description

Operator to apply for the string filter. "eq" means equals, "notEq" means not equals. "any" means no restriction and also matches users without a value; to require a value, use "notEq" with an empty string.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

* * *

* * *

`utmMedium`

Description

Filter by UTM medium.

Type

object

Show nested properties (2)

`value`

Description

Value to filter by

Type

string

* * *

`operator`

Description

Operator to apply for the string filter. "eq" means equals, "notEq" means not equals. "any" means no restriction and also matches users without a value; to require a value, use "notEq" with an empty string.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

* * *

* * *

`utmSource`

Description

Filter by UTM source.

Type

object

Show nested properties (2)

`value`

Description

Value to filter by

Type

string

* * *

`operator`

Description

Operator to apply for the string filter. "eq" means equals, "notEq" means not equals. "any" means no restriction and also matches users without a value; to require a value, use "notEq" with an empty string.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

* * *

* * *

`utmTerm`

Description

Filter by UTM term.

Type

object

Show nested properties (2)

`value`

Description

Value to filter by

Type

string

* * *

`operator`

Description

Operator to apply for the string filter. "eq" means equals, "notEq" means not equals. "any" means no restriction and also matches users without a value; to require a value, use "notEq" with an empty string.

Type

"any" | "eq" | "notEq" | "contains" | "notContains" | "startsWith" | "endsWith"

* * *

* * *

* * *

`type: browser`

Description

Filter by browser.

Type

object

Default

"browser"

Example

{"type":"browser","operator":"oneOf","value":\["Chrome"\]}

Show nested properties (2)

`value`

Description

List of browser names to match.

Type

array<string>

Example

\["Chrome","Safari"\]

* * *

`operator`

Description

List matching operator for `value`. To require a value, use "noneOf" with `[""]`.

Type

"any" | "oneOf" | "noneOf"

Example

"oneOf"

* * *

* * *

`type: device`

Description

Filter by device type.

Type

object

Default

"device"

Example

{"type":"device","operator":"oneOf","value":\["desktop"\]}

Show nested properties (2)

`value`

Description

List of device types to match.

Type

array<string>

Example

\["desktop","mobile"\]

* * *

`operator`

Description

List matching operator for `value`. To require a value, use "noneOf" with `[""]`.

Type

"any" | "oneOf" | "noneOf"

Example

"oneOf"

* * *

* * *

`type: os`

Description

Filter by operating system.

Type

object

Default

"os"

Example

{"type":"os","operator":"oneOf","value":\["macOS"\]}

Show nested properties (2)

`value`

Description

List of operating system names to match.

Type

array<string>

Example

\["macOS","Windows"\]

* * *

`operator`

Description

List matching operator for `value`. To require a value, use "noneOf" with `[""]`.

Type

"any" | "oneOf" | "noneOf"

Example

"oneOf"

* * *

* * *

`type: funnel`

Description

Filter users based on funnel step completion.

Type

object

Default

"funnel"

Example

{"type":"funnel","id":"550e8400-e29b-41d4-a716-446655440000","step":1,"operator":"completed"}

Show nested properties (3)

`id`

Description

Funnel ID to evaluate for completion status.

Type

string

Example

"550e8400-e29b-41d4-a716-446655440000"

* * *

`step`

Description

Zero-based funnel step index to evaluate.

Type

integer

Example

1

* * *

`operator`

Description

Whether users must have completed or not completed the selected step.

Type

"completed" | "notCompleted"

Example

"completed"

* * *

* * *

* * *

`filtersOperator`

Description

Echo of the incoming `filtersOperator` request field.

Type

"and" | "or"

* * *

* * *

`pagination`

Description

Pagination metadata for the response.

Type

object

`limit`

Description

Applied row limit after internal normalization.

Type

integer

* * *

`offset`

Description

Applied row offset after internal normalization.

Type

integer

* * *

`returned`

Description

Number of rows returned in `data`. Can be used to determine if there are more rows available for pagination (when `returned` is equal to `limit`, there might be more rows available on the next page).

Type

integer

* * *

* * *

`data`

Description

Result rows for the query after grouping, sorting, and pagination.

Type

array<object>

`group`

Description

Group values for this row. Empty object for aggregate queries.

Type

object

Example

{"date":"2026-01-18T00:00:00Z"}

Show nested properties (25)

`date`

Description

UTC timestamp in ISO-8601 format with second precision (no milliseconds).

Type

string<pattern:^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$>

Example

"2026-01-19T12:30:00Z"

* * *

`country`

Description

Type

string

* * *

`city`

Description

Type

string

* * *

`page:origin`

Description

Type

string

* * *

`page:path`

Description

Type

string

* * *

`browser`

Description

Type

string

* * *

`deviceType`

Description

Type

string

* * *

`os`

Description

Type

string

* * *

`referrer`

Description

Type

string

* * *

`referrerType`

Description

Type

string

* * *

`utmCampaign`

Description

Type

string

* * *

`utmContent`

Description

Type

string

* * *

`utmMedium`

Description

Type

string

* * *

`utmSource`

Description

Type

string

* * *

`utmTerm`

Description

Type

string

* * *

`event:name`

Description

Type

string

* * *

`firstVisit:referrer`

Description

Type

string

* * *

`firstVisit:referrerType`

Description

Type

string

* * *

`firstVisit:utmCampaign`

Description

Type

string

* * *

`firstVisit:utmContent`

Description

Type

string

* * *

`firstVisit:utmMedium`

Description

Type

string

* * *

`firstVisit:utmSource`

Description

Type

string

* * *

`firstVisit:utmTerm`

Description

Type

string

* * *

`firstVisit:page:origin`

Description

Type

string

* * *

`firstVisit:page:path`

Description

Type

string

* * *

* * *

`metrics`

Description

Calculated metric values for the row. Only requested metrics are returned.

Type

object

Show nested properties (5)

`users`

Description

Unique users count for this row.

Type

number

Example

412

* * *

`pageviews`

Description

Pageview events count for this row.

Type

number

Example

1736

* * *

`events`

Description

Custom events count for this row.

Type

number

Example

43

* * *

`bounceRate`

Description

Bounce rate percentage for this row. Can be `null` when not applicable for the selected grouping.

Type

number | null

Example

34.12

* * *

`visitDuration`

Description

Average visit duration in seconds for this row. Can be `null` when not applicable for the selected grouping.

Type

number | null

Example

1222.45

* * *

* * *

* * *

400 Bad request - invalid request payload or parameters, or an organization key without the X-Vemetric-Project header

application/json

`error`

Description

Error details.

Type

object

`code`

Description

Machine-readable error code. `HTTP_ERROR` is returned for a malformed JSON body, `PROJECT_REQUIRED` for an organization key without the X-Vemetric-Project header.

Type

"VALIDATION\_ERROR" | "HTTP\_ERROR" | "PROJECT\_REQUIRED"

* * *

`message`

Description

Human-readable error message.

Type

string

* * *

`details`

Description

Per-field validation issues. Only present for `VALIDATION_ERROR`.

Type

array<object>

Show nested properties (2)

`field`

Description

Path to the invalid request field.

Type

string

Example

"groupBy.0"

* * *

`message`

Description

Validation error message for the field.

Type

string

* * *

* * *

* * *

401 Unauthorized - missing, malformed, invalid or revoked API key

application/json

`error`

Description

Error details.

Type

object

`code`

Description

Machine-readable error code.

Type

"UNAUTHORIZED"

* * *

`message`

Description

Human-readable error message.

Type

string

* * *

* * *

403 Requested date range is not allowed for the current plan

application/json

`error`

Description

Error details.

Type

object

`code`

Description

Machine-readable error code.

Type

"PLAN\_LIMIT\_EXCEEDED"

* * *

`message`

Description

Human-readable error message.

Type

string

* * *

* * *

404 Project was not found or is not covered by the API key

application/json

`error`

Description

Error details.

Type

object

`code`

Description

Machine-readable error code.

Type

"PROJECT\_NOT\_FOUND"

* * *

`message`

Description

Human-readable error message.

Type

string

* * *

* * *

429 Rate limit exceeded - retry after the number of seconds in the Retry-After header

application/json

`error`

Description

Error details.

Type

object

`code`

Description

Machine-readable error code.

Type

"RATE\_LIMIT\_EXCEEDED"

* * *

`message`

Description

Human-readable error message.

Type

string

* * *

* * *

500 Unexpected internal error

application/json

`error`

Description

Error details.

Type

object

`code`

Description

Machine-readable error code.

Type

"INTERNAL\_ERROR"

* * *

`message`

Description

Human-readable error message.

Type

string

* * *

* * *
