> ## 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.

# Analytics

> Compare DNS query counts across domains, devices, protocols, and filtering outcomes.

Analytics summarize the DNS queries retained for a profile. Each endpoint groups the queries by one attribute and returns the groups with the most queries first. For individual requests, use [logs](https://docs.nextdns.io/api-reference/logs/list.md).

This request returns the ten domains a profile queried most often in the past day.

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

## Choose a breakdown

Append one of these paths to `/profiles/{profile}/analytics`.

| Endpoint | Groups queries by |
| - | - |
| [`/status`](https://docs.nextdns.io/api-reference/analytics/status) | Filtering or resolution status |
| [`/domains`](https://docs.nextdns.io/api-reference/analytics/domains) | Queried domain or registrable domain |
| [`/reasons`](https://docs.nextdns.io/api-reference/analytics/reasons) | Rule or list that matched a blocked query |
| [`/devices`](https://docs.nextdns.io/api-reference/analytics/devices) | Device ID |
| [`/ips`](https://docs.nextdns.io/api-reference/analytics/ips) | Client IP address |
| [`/protocols`](https://docs.nextdns.io/api-reference/analytics/protocols) | DNS transport, such as UDP or DNS over HTTPS |
| [`/ipVersions`](https://docs.nextdns.io/api-reference/analytics/ip-versions) | Client IP version (IPv4 or IPv6) |
| [`/encryption`](https://docs.nextdns.io/api-reference/analytics/encryption) | Whether the DNS transport was encrypted |
| [`/queryTypes`](https://docs.nextdns.io/api-reference/analytics/query-types) | Requested DNS record type, such as A or AAAA |
| [`/dnssec`](https://docs.nextdns.io/api-reference/analytics/dnssec) | Whether the response was validated with DNSSEC |
| [`/destinations`](https://docs.nextdns.io/api-reference/analytics/destinations) | Destination country or company |

For counts over time, append `;series` to any endpoint except `/domains`. See [time series](https://docs.nextdns.io/api-reference/analytics/time-series.md).

## Query parameters

| Parameter | Meaning |
| - | - |
| `from` | Include queries at or after this time. Omit it to start with the oldest retained queries. Required for time series. |
| `to` | Include queries earlier than this time. Defaults to `now`. |
| `device` | Restrict counts to an ID from [Devices](https://docs.nextdns.io/api-reference/analytics/devices.md). Use `__UNIDENTIFIED__` for queries without a device ID. |
| `limit` | Number of groups per page, from 1 to 1,000. Defaults to 10. |
| `cursor` | Use the value in `meta.pagination.cursor` to request the next page with the same filters. A `null` cursor marks the last page. |
| `locale` | Language for translated labels such as blocking reasons and country names. For example, use `fr` for French. |

Use fixed `from` and `to` timestamps to keep the time window the same across pages. In totals, groups with equal counts can change order between requests. See [time ranges](https://docs.nextdns.io/api-reference/time-ranges.md) and [responses and pagination](https://docs.nextdns.io/api-reference/responses.md).

The profile’s [logging settings](https://docs.nextdns.io/api-reference/profiles/settings.md) determine which breakdowns a query can contribute to. Omitting client IPs removes those queries from IP address and IP version counts. Omitting domains also removes the query type and destination country.


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