### Logs endpoint response example Source: https://nextdns.io/api Example response from the /logs endpoint showing log entries with fields like timestamp, domain, status, and reasons. The response is paginated and includes a data array. ```json { "data": [ { "timestamp": "2021-03-18T03:00:10.338Z", "domain": "21-courier.push.apple.com", "root": "apple.com", "tracker": "apple", "encrypted": true, "protocol": "DNS-over-HTTPS", "clientIp": "2a01:e0a:2cd:87a0:1b23:2832:57cd:aa1d", "client": "apple-profile", "device": { "id": "8TD1G", "name": "Romain’s iPhone", "model": "iPhone 12 Pro Max" }, "status": "default", "reasons": [] }, { "timestamp": "2021-03-18T02:56:14.182Z", "domain": "sb.scorecardresearch.com", "root": "scorecardresearch.com", "tracker": "scorecard_research_beacon", "encrypted": false, "protocol": "UDP", "clientIp": "91.172.51.28", "status": "blocked", "reasons": [ { "id": "blocklist:nextdns-recommended", "name": "NextDNS Ads & Trackers Blocklist" }, { "id": "blocklist:oisd", "name": "oisd" } ] }, ... ], ... } ``` -------------------------------- ### GET /profiles/:profile/logs/download Source: https://nextdns.io/api Downloads the logs for a profile. By default, this endpoint will automatically redirect to the public URL of the file. Use `?redirect=0` to get a JSON containing that URL. ```APIDOC ## GET /profiles/:profile/logs/download ### Description Downloads the logs for a profile. By default, this endpoint will automatically redirect to the public URL of the file. Use `?redirect=0` to get a JSON containing that URL. ### Method GET ### Endpoint https://api.nextdns.io/profiles/:profile/logs/download ### Parameters #### Path Parameters - **profile** (String) - Required - The profile identifier. #### Query Parameters - **redirect** (Integer) - Optional - Set to `0` to get a JSON containing the public URL instead of redirecting. ### Response #### Success Response (200) - If `redirect=0`, returns a JSON containing the public URL of the file. #### Response Example ```json { "url": "https://..." } ``` ``` -------------------------------- ### GET /profiles/:profile/settings/performance Source: https://nextdns.io/api Retrieves the performance settings of a profile. ```APIDOC ## GET /profiles/:profile/settings/performance ### Description Retrieves the performance settings of a profile. ### Method GET ### Endpoint https://api.nextdns.io/profiles/:profile/settings/performance ### Parameters #### Path Parameters - **profile** (string) - Required - The ID of the profile. ### Response #### Success Response (200) Returns the performance settings object. ``` -------------------------------- ### GET /profiles/:profile/logs Source: https://nextdns.io/api Retrieves DNS query logs for a profile with filtering, sorting, pagination, and search capabilities. ```APIDOC ## GET /profiles/:profile/logs ### Description Retrieves DNS query logs for a profile with filtering, sorting, pagination, and search capabilities. ### Method GET ### Endpoint https://api.nextdns.io/profiles/:profile/logs ### Parameters #### Path Parameters - **profile** (String) - Required - The profile identifier. #### Query Parameters - **from** (Date) - Optional - Filter out logs with older date (inclusive). - **to** (Date) - Optional - Filter out logs with newer or equal date (exclusive). - **sort** (String) - Optional - Values: `asc` or `desc`. Default: `desc`. Using `asc` will return logs from oldest to newest, `desc` from newest to oldest. - **limit** (Integer) - Optional - Limit the number of results returned. Default: `100`. Must be >= 10 and <= 1000. - **cursor** (String) - Optional - Use `cursor` to get the next page (see Pagination). - **device** (String) - Optional - Only get logs made for a specific device. Use `__UNIDENTIFIED__` to filter against all unidentified devices. - **status** (String) - Optional - Filter by status. Values: `default`, `error`, `blocked`, `allowed`. - **search** (String) - Optional - Only returns logs matching the search query. e.g. `facebook` will show logs from facebook.com, facebook.hello.com and hellofacebookhello.com. - **raw** (Boolean) - Optional - Default: `false`. By default, only navigational query types (`A`, `AAAA` and `HTTPS`) are returned, and are automatically deduplicated. Irrelevant domains considered noise are also not returned. Use `raw=1` to show all DNS queries. ### Response #### Success Response (200) - **data** (Array) - List of log entries. - **timestamp** (String) - Timestamp of the log entry. - **domain** (String) - The queried domain. - **root** (String) - The root domain. - **tracker** (String) - The tracker identifier, if any. - **encrypted** (Boolean) - Whether the query was encrypted. - **protocol** (String) - The protocol used (e.g., DNS-over-HTTPS, UDP). - **clientIp** (String) - The client IP address. - **client** (String) - The client identifier. - **device** (Object) - Device information. - **id** (String) - Device ID. - **name** (String) - Device name. - **model** (String) - Device model. - **status** (String) - Status of the query (e.g., default, blocked). - **reasons** (Array) - List of reasons for blocking, if any. - **id** (String) - Reason ID. - **name** (String) - Reason name. - **meta** (Object) - Metadata, including pagination and streaming info. - **stream** (Object) - Streaming information. - **id** (String) - The stream ID for resuming. #### Response Example ```json { "data": [ { "timestamp": "2021-03-18T03:00:10.338Z", "domain": "21-courier.push.apple.com", "root": "apple.com", "tracker": "apple", "encrypted": true, "protocol": "DNS-over-HTTPS", "clientIp": "2a01:e0a:2cd:87a0:1b23:2832:57cd:aa1d", "client": "apple-profile", "device": { "id": "8TD1G", "name": "Romain’s iPhone", "model": "iPhone 12 Pro Max" }, "status": "default", "reasons": [] } ], "meta": { "stream": { "id": "64v32d9r6rwkcctg6cu38e9g60" } } } ``` ``` -------------------------------- ### GET /profiles/:profile Source: https://nextdns.io/api Retrieves a profile by its ID. ```APIDOC ## GET /profiles/:profile ### Description Retrieves a profile by its ID. ### Method GET ### Endpoint https://api.nextdns.io/profiles/:profile ### Parameters #### Path Parameters - **profile** (string) - Required - The ID of the profile. ### Response #### Success Response (200) Returns the profile object as described in the Profile section. ``` -------------------------------- ### NextDNS time series response for queryTypes;series Source: https://nextdns.io/api Example response for a time series query on the NextDNS API. The URL appends `;series` to an analytics endpoint and uses `from=-7d&interval=1d&limit=2`. The response contains an array of `queries` values per type, a `meta.series` object with the starting date of each tumbling window and the interval in seconds, and a pagination cursor. ```json // https://api.nextdns.io/profiles/abc123/analytics/queryTypes;series?from=-7d&interval=1d&limit=2 { "data": [ { "type": 28, "name": "AAAA", "queries": [ 4019, 5801, 2667, 2817, 3314, 3128, 3810 ] }, { "type": 1, "name": "A", "queries": [ 3873, 5421, 2691, 2865, 3387, 3192, 3864 ] } ], "meta": { "series": { "times": [ // the starting date of each tumbling window "2021-03-08T16:51:36.623Z", "2021-03-09T16:51:36.623Z", "2021-03-10T16:51:36.623Z", "2021-03-11T16:51:36.623Z", "2021-03-12T16:51:36.623Z", "2021-03-13T16:51:36.623Z", "2021-03-14T16:51:36.623Z" ], "interval": 86400 // the duration (in seconds) of each tumbling window }, "pagination": { "cursor": "jS8sl16m" } } } ``` -------------------------------- ### SSE event format for /logs/stream Source: https://nextdns.io/api Example SSE event format from the /logs/stream endpoint. The event includes an id field and a data field containing the log entry as JSON. ```text id: 64v32d9r6rwkcctg6cu38e9g60 data: {"timestamp":"2021-03-16T04:40:30.344Z","domain":"g.whatsapp.net","root":"whatsapp.net","encrypted":true,"protocol":"DNS-over-HTTPS","clientIp":"2a01:e0a:2cd:87a0:5540:d573:57cd:aa1d","client":"apple-profile","device":{"id":"8TD1G","name":"Romain’s iPhone","model":"iPhone 12 Pro Max"},"status":"default","reasons":[]} ``` -------------------------------- ### GET /profiles/:profile/analytics/devices Source: https://nextdns.io/api Retrieves the analytics devices for a profile, showing the number of queries per device. ```APIDOC ## GET /profiles/:profile/analytics/devices ### Description Retrieves the analytics devices for a profile, showing the number of queries per device. ### Method GET ### Endpoint /profiles/:profile/analytics/devices ### Parameters #### Path Parameters - **profile** (string) - Required - The profile identifier. ### Response #### Success Response (200) - **data** (array) - List of device objects. - **id** (string) - The device identifier. - **name** (string) - The device name. - **model** (string) - The device model. - **localIp** (string) - The local IP address (optional). - **queries** (integer) - Number of queries for that device. #### Response Example { "data": [ { "id": "8TD1G", "name": "Romain’s iPhone", "model": "iPhone 12 Pro Max", "queries": 489885 }, { "id": "E24AR", "name": "MBP", "model": "Macbook Pro", "localIp": "192.168.0.11", "queries": 215663 } ] } ``` -------------------------------- ### GET /profiles/:profile/analytics/reasons Source: https://nextdns.io/api Retrieves the analytics reasons for a profile, showing the number of queries per blocking reason. ```APIDOC ## GET /profiles/:profile/analytics/reasons ### Description Retrieves the analytics reasons for a profile, showing the number of queries per blocking reason. ### Method GET ### Endpoint /profiles/:profile/analytics/reasons ### Parameters #### Path Parameters - **profile** (string) - Required - The profile identifier. ### Response #### Success Response (200) - **data** (array) - List of reason objects. - **id** (string) - The reason identifier. - **name** (string) - The reason name. - **queries** (integer) - Number of queries for that reason. #### Response Example { "data": [ { "id": "blocklist:nextdns-recommended", "name": "NextDNS Ads & Trackers Blocklist", "queries": 131833 }, { "id": "native:apple", "name": "Native Tracking (Apple)", "queries": 402 } ] } ``` -------------------------------- ### GET /profiles/:profile/analytics/protocols Source: https://nextdns.io/api Retrieves the analytics protocols for a profile, showing the number of queries per protocol. ```APIDOC ## GET /profiles/:profile/analytics/protocols ### Description Retrieves the analytics protocols for a profile, showing the number of queries per protocol. ### Method GET ### Endpoint /profiles/:profile/analytics/protocols ### Parameters #### Path Parameters - **profile** (string) - Required - The profile identifier. ### Response #### Success Response (200) - **data** (array) - List of protocol objects. - **protocol** (string) - The protocol name (e.g., DNS-over-HTTPS). - **queries** (integer) - Number of queries for that protocol. #### Response Example { "data": [ { "protocol": "DNS-over-HTTPS", "queries": 958757 }, { "protocol": "DNS-over-TLS", "queries": 39582 } ] } ``` -------------------------------- ### GET /profiles/:profile/analytics/* Source: https://nextdns.io/api Retrieves analytics data for a profile. The wildcard can be replaced with specific analytics endpoints such as `protocols`. ```APIDOC ## GET /profiles/:profile/analytics/* ### Description Retrieves analytics data for a profile. The wildcard can be replaced with specific analytics endpoints such as `protocols`. ### Method GET ### Endpoint https://api.nextdns.io/profiles/:profile/analytics/* ### Parameters #### Path Parameters - **profile** (string) - Required - The ID of the profile. #### Query Parameters - **from** (Date) - Optional - Filter out entities with older date (inclusive). - **to** (Date) - Optional - Filter out entities with newer or equal date (exclusive). - **limit** (Integer) - Optional - Default: 10. Limit the number of results returned (see Pagination). Must be >= 1 and <= 500. - **cursor** (String) - Optional - Use `cursor` to get the next page (see Pagination). - **device** (String) - Optional - Only get entities related to a specific device. Use `__UNIDENTIFIED__` to filter against all unidentified devices. ### Response #### Success Response (200) Returns analytics data. ``` -------------------------------- ### Logs response with stream id Source: https://nextdns.io/api Example response from the /logs endpoint showing the stream id in the meta object, which can be used to resume streaming from the /logs/stream endpoint. ```json { "data": [...], "meta": { ... "stream": { "id": "64v32d9r6rwkcctg6cu38e9g60" } } } ``` -------------------------------- ### GET /profiles/:profile/analytics/ipVersions Source: https://nextdns.io/api Retrieves the analytics IP versions for a profile, showing the number of queries per IP version. ```APIDOC ## GET /profiles/:profile/analytics/ipVersions ### Description Retrieves the analytics IP versions for a profile, showing the number of queries per IP version. ### Method GET ### Endpoint /profiles/:profile/analytics/ipVersions ### Parameters #### Path Parameters - **profile** (string) - Required - The profile identifier. ### Response #### Success Response (200) - **data** (array) - List of IP version objects. - **version** (integer) - The IP version (4 or 6). - **queries** (integer) - Number of queries for that version. #### Response Example { "data": [ { "version": 6, "queries": 784154 }, { "version": 4, "queries": 174308 } ] } ``` -------------------------------- ### GET /profiles/:profile/logs/stream Source: https://nextdns.io/api Streams new logs in real-time using Server-sent events (SSE). Supports all query string parameters of the `/logs` endpoint except `from`, `to`, `sort`, `limit`, and `cursor`. ```APIDOC ## GET /profiles/:profile/logs/stream ### Description Streams new logs in real-time using Server-sent events (SSE). Supports all query string parameters of the `/logs` endpoint except `from`, `to`, `sort`, `limit`, and `cursor`. ### Method GET ### Endpoint https://api.nextdns.io/profiles/:profile/logs/stream ### Parameters #### Path Parameters - **profile** (String) - Required - The profile identifier. #### Query Parameters - **device** (String) - Optional - Only get logs made for a specific device. Use `__UNIDENTIFIED__` to filter against all unidentified devices. - **status** (String) - Optional - Filter by status. Values: `default`, `error`, `blocked`, `allowed`. - **search** (String) - Optional - Only returns logs matching the search query. - **raw** (Boolean) - Optional - Default: `false`. Use `raw=1` to show all DNS queries. - **id** (String) - Optional - Pass the last `id` received to resume where you left off. ### Response #### Success Response (200) Server-sent events with the following format: - **id** (String) - Event ID. - **data** (String) - JSON string containing the log entry. #### Response Example ``` id: 64v32d9r6rwkcctg6cu38e9g60 data: {"timestamp":"2021-03-16T04:40:30.344Z","domain":"g.whatsapp.net","root":"whatsapp.net","encrypted":true,"protocol":"DNS-over-HTTPS","clientIp":"2a01:e0a:2cd:87a0:5540:d573:57cd:aa1d","client":"apple-profile","device":{"id":"8TD1G","name":"Romain’s iPhone","model":"iPhone 12 Pro Max"},"status":"default","reasons":[]} ``` ``` -------------------------------- ### Pagination response with cursor Source: https://nextdns.io/api Shows the paginated response structure with a cursor in the meta.pagination object. Pass the cursor as the query string argument 'cursor' to get the next page; cursor is null when there is no more page. ```json { "data": [...], "meta": { "pagination": { "cursor": "j2k3zl3b4v" } } } // get the next page with /endpoint?...&cursor=j2k3zl3b4v ``` -------------------------------- ### GET /profiles Source: https://nextdns.io/api This snippet documents the profiles endpoint, which is part of the NextDNS API. The source mentions profiles as a section but does not provide explicit endpoint details, so this is a minimal representation based on the available information. ```APIDOC ## GET /profiles ### Description Retrieves a list of profiles. (This endpoint is implied by the documentation's mention of profiles, but the exact method and path are not explicitly stated in the source. The source only mentions the base endpoint and the profiles section.) ### Method GET ### Endpoint /profiles ### Response #### Success Response (200) - **data** (array) - List of profiles - **meta** (object) - Optional metadata #### Response Example { "data": [ { "id": "string", "name": "string" } ], "meta": {} } ``` -------------------------------- ### Get time zone with Intl.DateTimeFormat Source: https://nextdns.io/api JavaScript code to get the current time zone name from the Time Zone Database, which is the format accepted by the API. ```javascript Intl.DateTimeFormat().resolvedOptions().timeZone > "Europe/Paris" ``` -------------------------------- ### Create profile response with id Source: https://nextdns.io/api Response returned by the API after creating a new profile with POST to https://api.nextdns.io/profiles. Contains the id of the newly created profile, which is then used in subsequent GET, PATCH, and DELETE requests. ```json { "data": { "id": "abc123" // the id of the newly created profile } } ``` -------------------------------- ### GET /profiles/{id}/logs Source: https://nextdns.io/api This snippet documents the logs endpoint for a profile. The source mentions logs, streaming, download, and clear operations, but does not provide explicit endpoint details. ```APIDOC ## GET /profiles/{id}/logs ### Description Retrieves logs for a specific profile. The source mentions logs, streaming, download, and clear operations, but does not provide explicit endpoint details. ### Method GET ### Endpoint /profiles/{id}/logs ### Parameters #### Path Parameters - **id** (string) - Required - Profile ID ### Response #### Success Response (200) - **data** (array) - Log entries - **meta** (object) - Optional metadata #### Response Example { "data": [], "meta": {} } ``` -------------------------------- ### GET /profiles/:profile/analytics/queryTypes Source: https://nextdns.io/api Retrieves the analytics query types for a profile, showing the number of queries per DNS query type. ```APIDOC ## GET /profiles/:profile/analytics/queryTypes ### Description Retrieves the analytics query types for a profile, showing the number of queries per DNS query type. ### Method GET ### Endpoint /profiles/:profile/analytics/queryTypes ### Parameters #### Path Parameters - **profile** (string) - Required - The profile identifier. ### Response #### Success Response (200) - **data** (array) - List of query type objects. - **type** (integer) - The DNS query type number. - **name** (string) - The query type name (e.g., AAAA). - **queries** (integer) - Number of queries for that type. #### Response Example { "data": [ { "type": 28, "name": "AAAA", "queries": 356230 }, { "type": 1, "name": "A", "queries": 341812 } ] } ``` -------------------------------- ### GET /profiles/:profile/analytics/destinations?type=gafam Source: https://nextdns.io/api Retrieves the analytics destinations by GAFAM company for a profile, showing the number of queries per company. ```APIDOC ## GET /profiles/:profile/analytics/destinations?type=gafam ### Description Retrieves the analytics destinations by GAFAM company for a profile, showing the number of queries per company. ### Method GET ### Endpoint /profiles/:profile/analytics/destinations?type=gafam ### Parameters #### Path Parameters - **profile** (string) - Required - The profile identifier. #### Query Parameters - **type** (string) - Required - Must be `gafam`. ### Response #### Success Response (200) - **data** (array) - List of company objects. - **company** (string) - The company name (e.g., others, apple, google). - **queries** (integer) - Number of queries for that company. #### Response Example { "data": [ { "company": "others", "queries": 478732 }, { "company": "apple", "queries": 284832 }, { "company": "google", "queries": 159488 } ] } ``` -------------------------------- ### GET /profiles/:profile/analytics/ips Source: https://nextdns.io/api Retrieves the analytics IP addresses for a profile, showing the number of queries per IP address along with network and geo information. ```APIDOC ## GET /profiles/:profile/analytics/ips ### Description Retrieves the analytics IP addresses for a profile, showing the number of queries per IP address along with network and geo information. ### Method GET ### Endpoint /profiles/:profile/analytics/ips ### Parameters #### Path Parameters - **profile** (string) - Required - The profile identifier. ### Response #### Success Response (200) - **data** (array) - List of IP objects. - **ip** (string) - The IP address. - **network** (object) - Network information. - **cellular** (boolean) - Whether the network is cellular. - **vpn** (boolean) - Whether the network is a VPN. - **isp** (string) - The ISP name. - **asn** (integer) - The ASN. - **geo** (object) - Geographic information. - **latitude** (number) - Latitude. - **longitude** (number) - Longitude. - **countryCode** (string) - Country code. - **country** (string) - Country name. - **city** (string) - City name. - **queries** (integer) - Number of queries for that IP. #### Response Example { "data": [ { "ip": "91.171.12.34", "network": { "cellular": false, "vpn": false, "isp": "Free", "asn": 12322 }, "geo": { "latitude": 48.8998, "longitude": 2.703, "countryCode": "FR", "country": "France", "city": "Gagny" }, "queries": 136935 } ] } ``` -------------------------------- ### GET /profiles/:profile/analytics/encryption Source: https://nextdns.io/api Retrieves the analytics encryption status for a profile, showing the number of queries per encryption status. ```APIDOC ## GET /profiles/:profile/analytics/encryption ### Description Retrieves the analytics encryption status for a profile, showing the number of queries per encryption status. ### Method GET ### Endpoint /profiles/:profile/analytics/encryption ### Parameters #### Path Parameters - **profile** (string) - Required - The profile identifier. ### Response #### Success Response (200) - **data** (array) - List of encryption objects. - **encrypted** (boolean) - Whether the query was encrypted. - **queries** (integer) - Number of queries for that status. #### Response Example { "data": [ { "encrypted": true, "queries": 958331 }, { "encrypted": false, "queries": 1 } ] } ``` -------------------------------- ### GET /profiles/{id}/analytics Source: https://nextdns.io/api This snippet documents the analytics endpoint for a profile. The source mentions analytics endpoints and query string parameters, but does not provide explicit details. ```APIDOC ## GET /profiles/{id}/analytics ### Description Retrieves analytics data for a specific profile. The source mentions analytics endpoints and query string parameters, but does not provide explicit details. ### Method GET ### Endpoint /profiles/{id}/analytics ### Parameters #### Path Parameters - **id** (string) - Required - Profile ID #### Query Parameters - **date** (string) - Optional - Date in the format specified in the Miscellaneous section - **timezone** (string) - Optional - TimeZone format ### Response #### Success Response (200) - **data** (object) - Analytics data - **meta** (object) - Optional metadata #### Response Example { "data": {}, "meta": {} } ``` -------------------------------- ### GET /profiles/:profile/analytics/destinations?type=countries Source: https://nextdns.io/api Retrieves the analytics destinations by country for a profile, showing the number of queries per country and the domains queried. ```APIDOC ## GET /profiles/:profile/analytics/destinations?type=countries ### Description Retrieves the analytics destinations by country for a profile, showing the number of queries per country and the domains queried. ### Method GET ### Endpoint /profiles/:profile/analytics/destinations?type=countries ### Parameters #### Path Parameters - **profile** (string) - Required - The profile identifier. #### Query Parameters - **type** (string) - Required - Must be `countries`. ### Response #### Success Response (200) - **data** (array) - List of country objects. - **code** (string) - The country code. - **domains** (array of strings) - List of domains queried. - **queries** (integer) - Number of queries for that country. #### Response Example { "data": [ { "code": "US", "domains": [ "app.smartmailcloud.com", "imap.gmail.com" ], "queries": 209851 }, { "code": "FR", "domains": [ "inappcheck.itunes.apple.com" ], "queries": 105497 } ] } ``` -------------------------------- ### GET /profiles/:profile/analytics/status Source: https://nextdns.io/api Retrieves the analytics status for a profile, showing the number of queries per status (default, blocked, allowed). ```APIDOC ## GET /profiles/:profile/analytics/status ### Description Retrieves the analytics status for a profile, showing the number of queries per status (default, blocked, allowed). ### Method GET ### Endpoint /profiles/:profile/analytics/status ### Parameters #### Path Parameters - **profile** (string) - Required - The profile identifier. ### Response #### Success Response (200) - **data** (array) - List of status objects. - **status** (string) - The status type (e.g., default, blocked, allowed). - **queries** (integer) - Number of queries for that status. #### Response Example { "data": [ { "status": "default", "queries": 819491 }, { "status": "blocked", "queries": 132513 }, { "status": "allowed", "queries": 6923 } ] } ``` -------------------------------- ### GET /profiles/:profile/analytics/domains Source: https://nextdns.io/api Retrieves the analytics domains for a profile, showing the number of queries per domain. Supports filtering by status and root domains. ```APIDOC ## GET /profiles/:profile/analytics/domains ### Description Retrieves the analytics domains for a profile, showing the number of queries per domain. Supports filtering by status and root domains. ### Method GET ### Endpoint /profiles/:profile/analytics/domains ### Parameters #### Path Parameters - **profile** (string) - Required - The profile identifier. #### Query Parameters - **status** (string) - Optional - Filter by status: `default`, `blocked`, or `allowed`. - **root** (boolean) - Optional - If `true`, returns root domains instead of full domains. Default is `false`. ### Response #### Success Response (200) - **data** (array) - List of domain objects. - **domain** (string) - The domain name. - **root** (string) - The root domain (only present when `root` is true). - **queries** (integer) - Number of queries for that domain. #### Response Example { "data": [ { "domain": "app-measurement.com", "queries": 29801 }, { "domain": "gateway.icloud.com", "root": "icloud.com", "queries": 18468 } ] } ``` -------------------------------- ### GET /profiles/:profile/analytics/dnssec Source: https://nextdns.io/api Retrieves the analytics DNSSEC validation status for a profile, showing the number of queries per validation status. ```APIDOC ## GET /profiles/:profile/analytics/dnssec ### Description Retrieves the analytics DNSSEC validation status for a profile, showing the number of queries per validation status. ### Method GET ### Endpoint /profiles/:profile/analytics/dnssec ### Parameters #### Path Parameters - **profile** (string) - Required - The profile identifier. ### Response #### Success Response (200) - **data** (array) - List of DNSSEC objects. - **validated** (boolean) - Whether the query was DNSSEC validated. - **queries** (integer) - Number of queries for that status. #### Response Example { "data": [ { "validated": false, "queries": 817664 }, { "validated": true, "queries": 8199 } ] } ``` -------------------------------- ### GET /profiles/{profileId}/analytics/{endpoint};series Source: https://nextdns.io/api This snippet documents the time series variant of the NextDNS analytics endpoints. It shows how to append `;series` to any analytics endpoint to retrieve time series data, including the supported query parameters and the response structure. ```APIDOC ## [GET] /profiles/{profileId}/analytics/{endpoint};series ### Description Returns time series data for any analytics endpoint by appending `;series` to the endpoint path. This allows easy charting of query counts over time. ### Method GET ### Endpoint `/profiles/{profileId}/analytics/{endpoint};series` ### Parameters #### Path Parameters - **profileId** (string) - Required - The profile identifier. - **endpoint** (string) - Required - The analytics endpoint (e.g., `queryTypes`, `status`). #### Query Parameters - **from** (string) - Required - Start of the time window (e.g., `-7d`). - **to** (string) - Optional - End of the time window. - **interval** (Seconds | Duration) - Optional - Duration of each tumbling window. Defaults to an appropriate duration based on the full window size. - **alignment** (string) - Optional - Values: `start`, `end`, `clock`. Default: `end`. Aligns tumbling windows to the start, end, or clock. - **timezone** (TimeZone) - Optional - Default: `GMT`. Used with `alignment=clock`. - **partials** (string) - Optional - Values: `none`, `start`, `end`, `all`. Default: `none`. Controls whether partial tumbling windows are returned. - **limit** (integer) - Optional - Limits the number of results. ### Request Example ``` // https://api.nextdns.io/profiles/abc123/analytics/queryTypes;series?from=-7d&interval=1d&limit=2 ``` ### Response #### Success Response (200) - **data** (array) - Array of objects, each containing `type`, `name`, and `queries` (array of numbers). - **meta.series.times** (array of strings) - Starting date of each tumbling window. - **meta.series.interval** (integer) - Duration (in seconds) of each tumbling window. - **meta.pagination.cursor** (string) - Pagination cursor for the next page. #### Response Example ``` { "data": [ { "type": 28, "name": "AAAA", "queries": [4019, 5801, 2667, 2817, 3314, 3128, 3810] }, { "type": 1, "name": "A", "queries": [3873, 5421, 2691, 2865, 3387, 3192, 3864] } ], "meta": { "series": { "times": [ "2021-03-08T16:51:36.623Z", "2021-03-09T16:51:36.623Z", "2021-03-10T16:51:36.623Z", "2021-03-11T16:51:36.623Z", "2021-03-12T16:51:36.623Z", "2021-03-13T16:51:36.623Z", "2021-03-14T16:51:36.623Z" ], "interval": 86400 }, "pagination": { "cursor": "jS8sl16m" } } } ``` ``` -------------------------------- ### POST /profiles Source: https://nextdns.io/api Creates a new profile by posting the profile JSON to the profiles endpoint. ```APIDOC ## POST /profiles ### Description Creates a new profile by posting the profile JSON to the profiles endpoint. ### Method POST ### Endpoint https://api.nextdns.io/profiles ### Request Body - **name** (string) - Required - The name of the profile. - **security** (object) - Optional - Security settings. - **privacy** (object) - Optional - Privacy settings. - **parentalControl** (object) - Optional - Parental control settings. - **denylist** (array) - Optional - List of domains to block. - **allowlist** (array) - Optional - List of domains to allow. - **settings** (object) - Optional - General settings. ### Request Example { "name": "My profile", "security": { "threatIntelligenceFeeds": true, "aiThreatDetection": true, "googleSafeBrowsing": true, "cryptojacking": true, "dnsRebinding": true, "idnHomographs": true, "typosquatting": true, "dga": true, "nrd": true, "ddns": true, "parking": true, "csam": true, "tlds": [ { "id": "ru" }, { "id": "cn" }, { "id": "cf" }, { "id": "accountants" } ] }, "privacy": { "blocklists": [ { "id": "nextdns-recommended" }, { "id": "oisd" } ], "natives": [ { "id": "huawei" }, { "id": "samsung" } ], "disguisedTrackers": true, "allowAffiliate": true }, "parentalControl": { "services": [ { "id": "tiktok", "active": true }, { "id": "facebook", "active": false } ], "categories": [ { "id": "porn", "active": true }, { "id": "social-networks", "active": false } ], "safeSearch": true, "youtubeRestrictedMode": true, "blockBypass": false }, "denylist": [ { "id": "badwebsite.com", "active": true }, { "id": "pornhub.com", "active": false } ], "allowlist": [ { "id": "goodwebsite.com", "active": true }, { "id": "nytimes.com", "active": false } ], "settings": { "logs": { "enabled": true, "drop": { "ip": false, "domain": false }, "retention": 7776000, "location": "eu" }, "blockPage": { "enabled": true }, "performance": { "ecs": true, "cacheBoost": false, "cnameFlattening": true }, "web3": true } } ### Response #### Success Response (200) - **data.id** (string) - The id of the newly created profile. #### Response Example { "data": { "id": "abc123" } } ``` -------------------------------- ### POST /profiles/:profile/denylist Source: https://nextdns.io/api Adds a domain to the Denylist of a profile. ```APIDOC ## POST /profiles/:profile/denylist ### Description Adds a domain to the Denylist of a profile. ### Method POST ### Endpoint https://api.nextdns.io/profiles/:profile/denylist ### Parameters #### Path Parameters - **profile** (string) - Required - The ID of the profile. ### Request Body - **id** (string) - Required - The domain to add. - **active** (boolean) - Optional - Whether the entry is active. ### Response #### Success Response (200) Returns the created denylist entry. ``` -------------------------------- ### PATCH /profiles/:profile/settings/performance Source: https://nextdns.io/api Updates the performance settings of a profile. ```APIDOC ## PATCH /profiles/:profile/settings/performance ### Description Updates the performance settings of a profile. ### Method PATCH ### Endpoint https://api.nextdns.io/profiles/:profile/settings/performance ### Parameters #### Path Parameters - **profile** (string) - Required - The ID of the profile. ### Request Body Partial performance settings object. ### Response #### Success Response (200) Returns the updated performance settings object. ``` -------------------------------- ### Analytics IP versions response Source: https://nextdns.io/api Response for the /profiles/:profile/analytics/ipVersions endpoint. Each entry contains an IP version (6 or 4) and the number of queries. ```json { "data": [ { "version": 6, "queries": 784154 }, { "version": 4, "queries": 174308 }, ... ], ... } ``` -------------------------------- ### Response format for 200 and 400 statuses Source: https://nextdns.io/api All API responses with 200 or 400 status follow one of these formats. The first shows a successful response with optional meta; the second shows an error response. ```json { "data": {...}, // or [...], depending on the endpoint "meta": {...} // optional } ``` ```json { "errors": [...] } ``` -------------------------------- ### DELETE /profiles/:profile/logs Source: https://nextdns.io/api Clears the logs for a profile. Logs are automatically cleared when a profile is deleted. ```APIDOC ## DELETE /profiles/:profile/logs ### Description Clears the logs for a profile. Logs are automatically cleared when a profile is deleted. ### Method DELETE ### Endpoint https://api.nextdns.io/profiles/:profile/logs ### Parameters #### Path Parameters - **profile** (String) - Required - The profile identifier. ### Response #### Success Response (200) No content. ``` -------------------------------- ### Analytics devices response Source: https://nextdns.io/api Response for the /profiles/:profile/analytics/devices endpoint. Each entry contains a device id, name, model, optional localIp, and query count. Devices without a name may have id __UNIDENTIFIED__. ```json { "data": [ { "id": "8TD1G", "name": "Romain’s iPhone", "model": "iPhone 12 Pro Max", "queries": 489885 }, { "id": "E24AR", "name": "MBP", "model": "Macbook Pro", "localIp": "192.168.0.11", "queries": 215663 }, { "id": "__UNIDENTIFIED__", "queries": 74242 }, ... ], ... } ``` -------------------------------- ### Analytics reasons response Source: https://nextdns.io/api Response for the /profiles/:profile/analytics/reasons endpoint. Each entry contains an id, a human-readable name, and the number of queries. ```json { "data": [ { "id": "blocklist:nextdns-recommended", "name": "NextDNS Ads & Trackers Blocklist", "queries": 131833 }, { "id": "native:apple", "name": "Native Tracking (Apple)", "queries": 402 }, { "id": "disguised-trackers", "name": "Disguised Third-Party Trackers", "queries": 269 }, ... ], ... } ```