# GET /domains/{name}/stats

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the domains group.

Get a domain's traffic statistics for a period

- Who may call it: administrator, reseller, customer
- Token scope, any of: domains, read, all
- Answers: 200 OK

Human traffic figures appear at the top level and robot traffic figures appear under robots. When human traffic statistics are available but separate robot statistics are absent, robots.available is 0. The response includes apart_since when UrbeStack has a recorded start date for counting robots separately.

The months array lists months with recorded data, newest first. Each entry gives the first and last recorded days, the number of recorded days, and totals for visitors, requests and bytes for people and robots. For a monthly period, days gives that month's daily figures. When the preceding month has data, previous gives its month and daily figures.

The enabled field is 1 when statistics collection is enabled for both the server and the domain. When statistics are available, updated gives the time of the last statistics run and utc_offset gives the server's UTC offset for interpreting hourly visit times. A request for all-time statistics returns available set to 0 if no statistics are available.

An invalid period returns 400. An unknown domain or a month for which no statistics are kept returns 404. Access to an existing domain is limited to administrators, the domain owner and the owner's reseller. Other callers receive 403.

## Parameters

- `name` (path, DomainName, required)
- `period` (query, string, matching ^(all|latest|[0-9]{4}-(0[1-9]|1[0-2]))$): Statistics period as all (the default) for data since collection began, YYYY-MM for a calendar month, or latest for the newest available month with all as the fallback. The response's period field gives the period used.

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X GET "$API/domains/example.com/stats?period=text" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "apart_since": "text",
  "available": true,
  "days": [
    {}
  ],
  "domain": "example.com",
  "enabled": true,
  "general": {},
  "months": [
    {
      "days": 1,
      "first": "text",
      "last": "text",
      "month": "text",
      "people": {},
      "robots": {}
    }
  ],
  "period": "text",
  "previous": {},
  "robots": {},
  "updated": "text",
  "utc_offset": "text"
}
```

## Errors

- 400: A period is all, latest, or a month as YYYY-MM
- 400: Domain name required
- 400: Domain name too long
- 400: Invalid domain name
- 401: Authentication required
- 403: Insufficient privileges
- 404: Domain '<name>' not found
- 404: No statistics are kept for <month>
