/Docs
Search docs or ask a question⌘K
DocsAgent
Changelog
API Reference Get Time on Page

Get Time on Page

Average, median and 90th-percentile seconds visitors spend on a page, with the change against the previous window.

GET/v1/projects/{projectId}/analytics/time-on-pageTry it
Session token

Returns how long visitors stay on a page — average, median and 90th percentile, in seconds — across every page view in the window that reported a duration, and how the average moved against the previous window of the same length.

Note

Session JWT and org membership required. Any role can read it — an API key gets 401, a non-member 403. Any plan.

Path Parameters

NameDescription
projectId:stringpathRequired
The project ID.

Query Parameters

NameDescription
days:integerquery
Time window in days.
Default30

Response Fields

NameDescription
data.avgSeconds:number
Mean seconds on page. 0 when no page view in the window reported a duration.
data.medianSeconds:number
Median seconds on page.
data.p90Seconds:number
90th-percentile seconds on page.
data.changeSeconds:integer | null
This window's average minus the previous window's, rounded to whole seconds. null when either window has no durations. Optional — see trend fields.

Error Responses

401 Unauthorized

Missing, invalid or expired session JWT, or an API key.

403 Forbidden

You are not a member of the organization that owns the project.

404 Not Found

The project does not exist or has been deleted.

Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl "https://api.syntext.dev/v1/projects/3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c/analytics/time-on-page?days=30" \
-H "Authorization: Bearer $SYNTEXT_JWT"
Responseapplication/json
200OK
{
"data": {
"avgSeconds": 94.2,
"medianSeconds": 61,
"p90Seconds": 233.5,
"changeSeconds": 7
}
}
Product
Resources
Company
© 2026 SyntextBuilt with Syntext