> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nextdns.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Domains

> Rank queried domains by query count.

Each row contains a recorded `domain` and its query count. Queries logged without a domain are excluded. For a subdomain, `root` identifies its registrable domain when available. A recognized tracker can also include a `tracker` identifier.

**profile** `string` *required*

Profile ID.

See the [shared analytics filters and pagination](https://docs.nextdns.io/api-reference/analytics/overview#query-parameters).

**status** `string`

Accepts `default`, `blocked`, `allowed`, `error`, `rewritten`, and `relayed`. Separate multiple statuses with commas.

**root** `boolean` (default: false)

Set to `true` to group subdomains under their registrable domain. For example, `www.example.com` and `api.example.com` then contribute to a single `example.com` row.

**reason** `string`

Filter by a single [reason ID](https://docs.nextdns.io/api-reference/analytics/reasons.md), such as `denylist` or `blocklist:nextdns-recommended`. Add `status=blocked` to restrict the ranking to blocked queries. An unknown reason returns an empty list.

A query that matches two blocklists contributes to each list’s ranking when you filter by those reasons separately. This endpoint returns totals only.

```bash cURL theme={null}
curl -H "X-Api-Key: $NEXTDNS_API_KEY" \
  "https://api.nextdns.io/profiles/$PROFILE_ID/analytics/domains?from=-1d&status=blocked&reason=denylist"
```

```json 200 theme={null}
{
  "data": [
    { "domain": "ads.example.com", "root": "example.com", "queries": 86 },
    { "domain": "example.org", "queries": 21 }
  ],
  "meta": { "pagination": { "cursor": null } }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.