curl -H "X-Api-Key: $NEXTDNS_API_KEY" \
"https://api.nextdns.io/profiles/$PROFILE_ID/analytics/destinations?from=-1d&type=countries"
{
"data": [
{
"code": "US",
"name": "United States",
"domains": ["www.example.com", "api.example.org"],
"queries": 491
}
],
"meta": { "pagination": { "cursor": null } }
}
{
"data": [
{ "company": "others", "queries": 481 },
{ "company": "google", "queries": 377 },
{ "company": "apple", "queries": 288 }
],
"meta": { "pagination": { "cursor": null } }
}
Analytics
Destinations
Group queries by destination country or company.
GET
/
profiles
/
{profile}
/
analytics
/
destinations
curl -H "X-Api-Key: $NEXTDNS_API_KEY" \
"https://api.nextdns.io/profiles/$PROFILE_ID/analytics/destinations?from=-1d&type=countries"
{
"data": [
{
"code": "US",
"name": "United States",
"domains": ["www.example.com", "api.example.org"],
"queries": 491
}
],
"meta": { "pagination": { "cursor": null } }
}
{
"data": [
{ "company": "others", "queries": 481 },
{ "company": "google", "queries": 377 },
{ "company": "apple", "queries": 288 }
],
"meta": { "pagination": { "cursor": null } }
}
See the shared analytics filters and pagination.
With
type=countries, NextDNS looks up the country of the first destination IP in a DNS answer. Only queries with default status and a recorded destination country contribute. Each row includes the country code, localized name, and up to five frequently queried domains. Country time series omit domains. For the location of the client, use client IP addresses.
With type=gafam, NextDNS compares each recorded registrable domain to its company domain lists. The company field is google, amazon, facebook, apple, or microsoft for a match, and others for the remaining domains.
curl -H "X-Api-Key: $NEXTDNS_API_KEY" \
"https://api.nextdns.io/profiles/$PROFILE_ID/analytics/destinations?from=-1d&type=countries"
{
"data": [
{
"code": "US",
"name": "United States",
"domains": ["www.example.com", "api.example.org"],
"queries": 491
}
],
"meta": { "pagination": { "cursor": null } }
}
{
"data": [
{ "company": "others", "queries": 481 },
{ "company": "google", "queries": 377 },
{ "company": "apple", "queries": 288 }
],
"meta": { "pagination": { "cursor": null } }
}