Journeys
BetaThe paths visits take, step by step: from where they came in, from a page or custom event, or leading up to one, as the Journeys report counts them.
Parameters
/pricing, which may end in *, or a custom event’s name: the steps from the first time a visit did it. Without from or to, the steps from where each visit came in.from or to, not both.to.1 to count custom events as steps too, or 0 for pages only. 0 if left out. An event in from or to is a step either way.today, yesterday, 7d, 30d, 90d, 52w, or a range of days or hours. The last 30 days if left out. Periodsprevious, month, or year. Adds compared to the response.America/New_York. The site’s own if left out.country=SE. They combine. FiltersRequest
Three steps from /pricing on an example site, the last 30 days.
curl -G https://app.lyli.io/api/v1/sites/s_k3m9x2p7qa/journeys \
-H "Authorization: Bearer $LYLI_API_KEY" \
-d from=/pricing \
-d depth=3 \
-d period=30d \
-d timezone=Europe/Stockholm// Node 18 or later, on your server
const url = "https://app.lyli.io/api/v1/sites/s_k3m9x2p7qa/journeys";
const params = new URLSearchParams({
from: "/pricing",
depth: "3",
period: "30d",
timezone: "Europe/Stockholm",
});
const res = await fetch(`${url}?${params}`, {
headers: { Authorization: `Bearer ${process.env.LYLI_API_KEY}` },
});
if (!res.ok) throw new Error(`Lyli API: ${res.status}`);
const { columns, paths } = await res.json();import os
import requests
res = requests.get(
"https://app.lyli.io/api/v1/sites/s_k3m9x2p7qa/journeys",
params={
"from": "/pricing",
"depth": "3",
"period": "30d",
"timezone": "Europe/Stockholm",
},
headers={"Authorization": f"Bearer {os.environ['LYLI_API_KEY']}"},
timeout=10,
)
res.raise_for_status()
paths = res.json()["paths"]Response
{
"site": "s_k3m9x2p7qa",
"period": {
"key": "30d",
"from": "2026-10-24",
"to": "2026-11-22",
"timezone": "Europe/Stockholm",
"interval": "day"
},
"journey": {
"direction": "from",
"anchor": { "kind": "page", "match": "/pricing" },
"depth": 3,
"events": false
},
"totals": {
"visits": 108,
"went_on": 49,
"came_in": 0,
"paths": 11
},
"columns": [
{
"visits": 108,
"steps": [
{ "kind": "page", "match": "/pricing", "visits": 108, "ends": 59 }
]
},
{
"visits": 49,
"steps": [
{ "kind": "page", "match": "/signup", "visits": 31, "ends": 26 },
{ "kind": "page", "match": "/features", "visits": 10, "ends": 5 },
{ "kind": "page", "match": "/", "visits": 8, "ends": 4 }
]
},
{
"visits": 14,
"steps": [
{ "kind": "page", "match": "/pricing", "visits": 8, "ends": 6 },
{ "kind": "page", "match": "/docs/getting-started", "visits": 5, "ends": 4 },
{ "kind": "page", "match": "/features", "visits": 1, "ends": 1 }
]
}
],
"paths": [
{
"steps": [
{ "kind": "page", "match": "/pricing" },
{ "kind": "page", "match": "/signup" }
],
"visits": 26,
"more": false,
"came_in": false
},
{
"steps": [
{ "kind": "page", "match": "/pricing" },
{ "kind": "page", "match": "/features" }
],
"visits": 5,
"more": false,
"came_in": false
},
// … 7 more paths
{
"steps": [
{ "kind": "page", "match": "/pricing" },
{ "kind": "page", "match": "/signup" },
{ "kind": "page", "match": "/docs/getting-started" }
],
"visits": 1,
"more": true,
"came_in": false
}
],
"compared": null
}An example site’s numbers. The paths are shortened here; the response has all 10.
direction, from or to; anchor, the page or event, or null for where visits came in; depth; and events.from or to, the visits that did its page or event.0 leading to one.0 from one.depth of them, in order. From, the first column is the page or event, or where visits came in; leading to, the last one is.kind, match, visits, and ends. Past 100, the rest are one entry of kind other, whose count says how many pages and events it holds.steps and visits. From, a path has two steps or more: the visits that left after the first are its column’s ends.null, or with against: the other period’s from, to, and totals. Also null when that period starts before the site’s data does.How it’s counted
Each visit that starts in the period and matches your filters, segment, and cohort becomes a list of steps in the order they happened: its pages, and its custom events with events=1. A step repeated right away, such as a reload, counts once. Activity after the period ends doesn’t count.
- From where visits came in: each visit’s first steps, up to
depth. - From a page or event: the steps from the first time a visit did it. Visits that never did aren’t in the journey.
- Leading to a page or event: the steps up to the first time a visit did it, so the last column is the page or event. A visit with fewer steps before it fills only the last columns.
The report’s diagram shows each step’s 5 largest pages and events; the API answers with its table, up to 100 a step. A step you highlight in the report isn’t part of the API.
Errors
from and to, a from or to that’s neither a path nor an event’s name, a depth outside 3 to 7, events other than 0 or 1, against=month for a period longer than 5 weeks, a segment or cohort the site doesn’t have, or a period, filter, or time zone we can’t parse.Every endpoint can also return 401 (missing, revoked, or expired key) and 429 (rate limit reached). All errors
Start from a report
Open the site’s Reports › Journeys and select Copy as API request in the Share menu. You get the journey on your screen as a curl request: from or to, depth, and events, then its period, comparison, filters, segment, cohort, and time zone. It reads your API key from the LYLI_API_KEY environment variable, so a copied request never contains a key.
A saved journey’s request carries its settings: the API doesn’t take a saved journey’s ID.