---
title: "Read page data totals"
method: GET
path: "/api/{ns}/{id}/state/{col}/_stats"
tags: ["Page data"]
---

# Read page data totals

`GET /api/{ns}/{id}/state/{col}/_stats`

## Request

- Base URL: `https://brewpage.app`
- URL: `https://brewpage.app/api/{ns}/{id}/state/{col}/_stats`
- Auth: one of:
  - API key in header `X-Owner-Token`
  - API key in header `X-Manage-Key`

Number of entries in one list, every visitor's and yours. With countBy (a field with declared choices) also the entries per choice, in declared order, then other.

## Path parameters

- `ns` string, required
- `id` string, required
- `col` string, required

## Query parameters

- `countBy` string

## Headers

- `X-Owner-Token` unknown
- `X-Manage-Key` unknown

## Response `200`

Totals

- StateTotalsResponse
  - `count` integer, required: Entries in the list
  - `scope` 'all', required: Always all: every visitor's entries and yours
  - `countBy` StateCountBy
    - `field` string, required: The countBy field
    - `counts` object, required: Declared choices in order, then other, each with its entry count

## Other responses

- `400`: STATE_INVALID: list name or countBy has a mistake (countBy needs a field with declared choices)
- `403`: Owner token revoked or expired; or OWNER_AUTHORIZATION_FAILED: a public publication you do not own
- `404`: PUBLICATION_UNAVAILABLE: no such HTML page or site, not yours, hidden or expired
- `503`: STATE_UNAVAILABLE: page data is switched off for now; wait Retry-After

## Changes

- **2026-11-21** `19a6c5561e70`: 4 info
  - added the optional property `level` to the response with the `400` status
  - added the optional property `level` to the response with the `403` status
  - added the optional property `level` to the response with the `404` status
  - added the optional property `level` to the response with the `503` status
- **2026-11-16** `31cd78c9ccd6`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/brewpage/apis/brewpage-api/changes/api/:ns/:id/state/:col/_stats/get.md)

---

[API](https://skmtc.dev/brewpage/apis/brewpage-api.md) - [All operations](https://skmtc.dev/brewpage/apis/brewpage-api/llms.txt) - [OpenAPI document](https://skmtc.dev/brewpage/apis/brewpage-api/revisions/78d2720a18a9?raw)
