curl -H "X-Api-Key: $NEXTDNS_API_KEY" \
"https://api.nextdns.io/profiles/$PROFILE_ID/analytics/reasons?from=-7d"
{
"data": [
{
"id": "blocklist:nextdns-recommended",
"name": "NextDNS Ads & Trackers Blocklist",
"queries": 186
},
{ "id": "denylist", "name": "Denylist", "queries": 34 }
],
"meta": { "pagination": { "cursor": null } }
}
Analytics
Blocking reasons
Count blocked queries by the rule or list that matched them.
GET
/
profiles
/
{profile}
/
analytics
/
reasons
curl -H "X-Api-Key: $NEXTDNS_API_KEY" \
"https://api.nextdns.io/profiles/$PROFILE_ID/analytics/reasons?from=-7d"
{
"data": [
{
"id": "blocklist:nextdns-recommended",
"name": "NextDNS Ads & Trackers Blocklist",
"queries": 186
},
{ "id": "denylist", "name": "Denylist", "queries": 34 }
],
"meta": { "pagination": { "cursor": null } }
}
Each row includes a reason
id, its display name, and the number of blocked queries it matched. One query can match several reasons, so adding the counts can exceed the number of blocked queries.
To see which blocked domains contributed to a row, pass its id as reason and include status=blocked on the domains endpoint. Use locale to request display names in another language.
See the shared analytics filters and pagination.
curl -H "X-Api-Key: $NEXTDNS_API_KEY" \
"https://api.nextdns.io/profiles/$PROFILE_ID/analytics/reasons?from=-7d"
{
"data": [
{
"id": "blocklist:nextdns-recommended",
"name": "NextDNS Ads & Trackers Blocklist",
"queries": 186
},
{ "id": "denylist", "name": "Denylist", "queries": 34 }
],
"meta": { "pagination": { "cursor": null } }
}