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

# Destinations

> Group queries by destination country or company.

**profile** `string` *required*

Profile ID.

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

**type** `string` *required*

Use `countries` to group by country or `gafam` to group by company.

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](https://docs.nextdns.io/api-reference/analytics/ips.md).

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.

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

```json Countries theme={null}
{
  "data": [
    {
      "code": "US",
      "name": "United States",
      "domains": ["www.example.com", "api.example.org"],
      "queries": 491
    }
  ],
  "meta": { "pagination": { "cursor": null } }
}
```

```json Companies theme={null}
{
  "data": [
    { "company": "others", "queries": 481 },
    { "company": "google", "queries": 377 },
    { "company": "apple", "queries": 288 }
  ],
  "meta": { "pagination": { "cursor": null } }
}
```


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