Get site totals
get_statsTotals for one site over a period: visitors, pageviews, bounce rate (% of visits with one pageview), average visit duration (seconds of engaged time), average scroll depth (%) and average visible duration (seconds). Visitors over a range add up each day’s unique visitors, so a returning reader counts once for each day. Optionally filtered, e.g. filters ["country==DE"]. Every number is real, including small ones, filtered or not (suppressed is always false). A null metric means it was not measured. Report the range the result echoes. Costs ceil(days/7) units, ×(1 + filter dimensions) ×5 when filtered. A range can include history imported from another analytics tool: imported says whether these totals include it and for which days, and bounce rate and durations always cover Pulse-measured days only.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"site_id": "<site_id>"
},
"name": "get_stats"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Last day, inclusive, YYYY-MM-DD, in the site's timezone. | |
| from | No | First day, YYYY-MM-DD, in the site's timezone. Use with to, instead of period, only for a range period cannot express. At most 366 days. | |
| period | No | 7d = today and the 6 days before it; 30d = today and the 29 days before it; month = this calendar month so far; year = this calendar year so far. All in the site's timezone. Use this rather than computing dates. Omit together with from/to for 7d. | |
| filters | No | Optional filters, each dimension==value or dimension!=value, e.g. country==DE or page==/pricing. At most 2 distinct dimensions. Any filter multiplies the cost by 5. | |
| site_id | Yes | The site's id, a UUID, from list_sites. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| range | Yes | ||
| filters | Yes | ||
| site_id | Yes | ||
| imported | No | Present only when the range includes days imported from another analytics tool: whether these numbers include them (included), which days (from, through), the tool (source), and why they were left out (reason). Absent means no imported day is involved. | |
| visitors | Yes | ||
| pageviews | Yes | ||
| suppressed | Yes | ||
| bounce_rate | Yes | ||
| avg_duration | Yes | ||
| min_cell_size | Yes | ||
| avg_scroll_depth | Yes | ||
| avg_visible_duration | Yes |