API reference

Document analytics API

The headline numbers behind the analytics page, for a dashboard of your own, and the attention profile of a single document — which sections were read, skimmed or skipped.

Base URL https://xdocs.io/api/v1, with Authorization: Bearer xdk_… on every request. Pagination, rate limits, scopes and error codes are the same for every endpoint and are described once, in how the API behaves.

Analytics

The headline numbers behind the analytics page, and the attention profile of a single document.

GET/api/v1/analytics/summaryviews:read

Views against the previous period, visitors, reading time, completion, the top documents, rooms, links and visitors, devices, and a per-day series.

Query parameters

daysinteger
7, 30 or 90. Defaults to 30. Anything else is a 400.

Returns

{ data: { days, since, current, previous, series[], topDocuments[], topRooms[], topLinks[], topVisitors[], recent[], devices, anonymousShare } } — series has one entry per day, oldest first; anonymousShare is the share of views (0–100) with no address captured

GET/api/v1/analytics/documents/:idviews:read

Where readers spent their attention in one document, section by section — per page for a PDF — including visits that arrived through a room.

Query parameters

shareLinkIdstring
Only visits through one link.

Returns

{ data: { documentId, title, kind, unit, views, measuredViews, totalMs, sections: [{ index, heading, words, seen, readers, totalMs, medianMs, msPerHundredWords, friction, stoppedHere, reached, reachedPct }] } } — unit is section or page; seen counts visits that dwelt on a section at all and readers those that read it; friction is pace against the document's own median, where 1 is typical

← The whole API referenceNext: Access requests API →