# Page views (https://webmetic.de/docs/api/referenz/visitor-intelligence/session-user-data)

## GET /session_user_data

Retrieves detailed user data for sessions associated with a specified domain within a given time range.

This endpoint provides granular information about user interactions during each session, including page
views, scroll depth, and time spent on each page.

Parameters:
- domain (str): The domain name for which you want to retrieve session user data.
- from_date (str, optional): The starting date and time for the session data range. Accepts ISO 8601 format
or relative dates like '-30 days'. Default is '-30 days'.
- to_date (str, optional): The ending date and time for the session data range. Accepts ISO 8601 format
or 'now' for the current date and time. Default is 'now'.
- page (int, optional): The page number of results to retrieve. Default is 1.
- page_size (int, optional): The number of entries to retrieve per page, up to 10000. Default is 10000.

Returns:
A JSON object containing:
1. Pagination information:
- total: Total number of user data entries
- page_total: Total number of pages
- isFirst: Boolean indicating if it's the first page
- current: Current page number
- isLast: Boolean indicating if it's the last page
- page_size: Number of entries per page
2. Result: An array of user data objects, each containing:
- session_id: Unique identifier for the session
- timestamp: Date and time of the user interaction
- document_location: URL of the page viewed
- document_title: Title of the page viewed
- scroll_depth: Percentage of the page scrolled
- referrer: URL of the referring page
- time_spent: Time spent on the page in seconds
- user_events_count: Number of user events (e.g., clicks, form submissions) on the page

Note: This endpoint is rate-limited to 1 request per second.

### Parameter

| Name | Ort | Typ | Pflicht | Beschreibung |
| --- | --- | --- | --- | --- |
| `domain` | query | string | ja |  |
| `from_date` | query | string | nein | Starting DateTime format or relative dates like '-30 days', '-1 hour', '-5 minutes'. Examples: '2023-01-01', '-7 days', '-12 hours', '-5 minutes', 'now' |
| `to_date` | query | string | nein | Ending DateTime format or 'now' for the current date/time. Examples: '2023-01-31', 'now' |
| `page` | query | integer | nein | Selected result page, starting at 1 |
| `page_size` | query | integer | nein | Number of entries per page, from 1 up to a maximum of 10000 |

### Antworten

| Status | Beschreibung |
| --- | --- |
| 200 | One entry per page view; missing fields are absent |
| 400 | INVALID_DATE: from_date or to_date cannot be read |
| 403 | API_KEY_MISSING, API_KEY_INVALID, API_KEY_NOT_FOUND, or API_KEY_NOT_AUTHORIZED: the domain is not a website of your account (send it exactly as listed there) |
| 422 | VALIDATION_ERROR: a parameter is missing or out of range (page from 1, page_size 1 to 10000); `errors` lists each problem |
| 429 | RATE_LIMITED: more than one request per second to this endpoint |
| 500 | INTERNAL_ERROR: unexpected server error |

Felder der Antwort 200:

| Feld | Typ | Pflicht | Beschreibung |
| --- | --- | --- | --- |
| `pagination` | Pagination[] | ja | Always one entry |
| `pagination[].total` | integer | ja | Entries over all pages |
| `pagination[].page_total` | integer | ja | Number of pages; 0 on an empty result |
| `pagination[].isFirst` | boolean | ja | true on page 1 |
| `pagination[].current` | integer | ja | This page, from 1 |
| `pagination[].isLast` | boolean | ja | true when current >= page_total, also on an empty result |
| `pagination[].page_size` | integer | ja | Entries per page as requested |
| `result` | PageViewRow[] | ja | One entry per page view |
| `result[].session_id` | string \| null | nein | Id of the visit |
| `result[].timestamp` | string \| null | nein | When the page was opened, UTC, ISO 8601 without offset, e.g. 2026-10-20T08:20:26.384000 |
| `result[].document_location` | string \| null | nein | URL of the page |
| `result[].document_title` | string \| null | nein | Title of the page |
| `result[].scroll_depth` | integer \| null | nein | How far the page was scrolled, percent |
| `result[].referrer` | string \| null | nein | Referring URL |
| `result[].time_spent` | number \| null | nein | Seconds on the page |
| `result[].engagement_time` | number \| null | nein | Active seconds on the page |
| `result[].user_events_count` | integer \| null | nein | Number of interactions on the page |
| `result[].events` | PageEvent[] \| null | nein | Interactions on the page: form submits, downloads, outbound clicks, … |
| `result[].blurred` | boolean \| null | nein | Only on Free, for a company past the month's readable ones: true, and only the ids and visit times are given |

### Beispiel

```bash
curl -X GET 'https://hub.webmetic.de/session_user_data?domain=website.example' \
  -H 'Authorization: wmtc_IHR_API_SCHLUESSEL'
```