viakite
Dashboard

API/Reports/The top 10 pages before and after a page

The top 10 pages before and after a page

POST/v1/projects/{project}/analytics/journeys
Secret keyNeeds analytics.viewus.api.vk.viabio.me

Path parameters

projectstringrequired
The project's id (prj_…).

Body

pagestringrequiredup to 2000 chars
filtersFilter[]
A dimension matching any of up to 20 values, or or, a list of such filters (not nested). Filters in a list are ANDed; up to 20 in all. goal matches the names of the project's saved goals an event reaches (is_not: none of them); page_group matches the name of the first of the project's saved page groups whose pattern the event's path matches (empty when none does); new_returning is New or Returning.
Show 4 fields
dimensionstring
A dimension's name; keyed ones take a key: props.plan.
operatorstring
isis_notcontainsnot_containsstarts_withregex
valuesstring[]1–20 items
orFilter[]
date_rangeobjectrequired
A preset, or from and to as dates (2026-11-01, whole days in the project's time zone, to included) or RFC 3339 times (to excluded). Empty means the last 30 days. A range starting before the first day the plan keeps (retention_days of F47: the last N days, today included, in the project's time zone) starts on that day instead: the answer's date_range shows where it starts, and F1, F2 and the public queries add a range_clamped warning. A range wholly before it is empty.
Show 3 fields
presetstring
todayyesterday7d30d90dthis_monthlast_monththis_yearall
fromstring
tostring
compareobject
previous_period, previous_year, or from and to.
Show 3 fields
presetstring
previous_periodprevious_year
fromstring
tostring
compare_filtersFilter[]up to 20 items
A second segment: the comparison (compare_before, compare_after) runs these filters instead of filters, over the same range, or over compare's range when both are given. An empty list is every visitor.
Show 4 fields
dimensionstring
A dimension's name; keyed ones take a key: props.plan.
operatorstring
isis_notcontainsnot_containsstarts_withregex
valuesstring[]1–20 items
orFilter[]

Responses

The pages before and after.

pagestringrequired
beforePageViews[]required
Show 2 fields
pagestringrequired
viewsnumberrequired
afterPageViews[]required
Show 2 fields
pagestringrequired
viewsnumberrequired
compare_beforePageViews[]
The pages before over the comparison; only when the request has compare or compare_filters.
Show 2 fields
pagestringrequired
viewsnumberrequired
compare_afterPageViews[]
The pages after over the comparison; only with a comparison.
Show 2 fields
pagestringrequired
viewsnumberrequired
compare_rangeobject
A resolved range [from, to) in UTC.
Show 2 fields
fromstring · date-timerequired
A time in UTC, ISO 8601.
tostring · date-timerequired
A time in UTC, ISO 8601.
Example response
1{
2 "page": "/pricing",
3 "before": [
4 {
5 "page": "/pricing",
6 "views": 1.5
7 }
8 ],
9 "after": [
10 {
11 "page": "/pricing",
12 "views": 1.5
13 }
14 ],
15 "compare_before": [
16 {
17 "page": "/pricing",
18 "views": 1.5
19 }
20 ],
21 "compare_after": [
22 {
23 "page": "/pricing",
24 "views": 1.5
25 }
26 ],
27 "compare_range": {
28 "from": "2026-11-21T09:30:00Z",
29 "to": "2026-11-21T09:30:00Z"
30 }
31}

Errors

Every error has the same shape: error.code, a message for people and details.

StatusCode
422validation_error