### GET /profiles/:profile/settings/performance Source: https://nextdns.github.io/api Retrieves the performance settings for a given profile. ```APIDOC ## GET /profiles/:profile/settings/performance ### Description Retrieves the performance settings for a given profile. ### Method GET ### Endpoint /profiles/:profile/settings/performance ``` -------------------------------- ### GET /profiles/:profile/analytics/reasons Source: https://nextdns.github.io/api Retrieves analytics reasons data for a given profile. ```APIDOC ## GET /profiles/:profile/analytics/reasons ### Description Retrieves analytics reasons data for a given profile. ### Method GET ### Endpoint /profiles/:profile/analytics/reasons ### Query Parameters #### Query String 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). `limit` should 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) - **data** (Array) - Contains reason ID, name, and query count objects. ### Response Example ```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 }, ... ], ... } ``` ``` -------------------------------- ### GET /profiles/:profile/privacy/blocklists Source: https://nextdns.github.io/api Retrieves blocklists for a given profile. ```APIDOC ## GET /profiles/:profile/privacy/blocklists ### Description Retrieves blocklists for a given profile. ### Method GET ### Endpoint /profiles/:profile/privacy/blocklists ``` -------------------------------- ### Get All DNS Queries (Raw) Source: https://nextdns.github.io/api Use the `raw=1` query parameter to retrieve all DNS queries, not just navigational ones. This provides a comprehensive view of network activity. ```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" } ] }, ... ], ... } ``` -------------------------------- ### Pagination Metadata Source: https://nextdns.github.io/api Example of pagination metadata in an API response, showing the cursor for fetching the next page of results. ```json { "data": [...], "meta": { "pagination": { "cursor": "j2k3zl3b4v" } } } // get the next page with /endpoint?...&cursor=j2k3zl3b4v ``` -------------------------------- ### GET /profiles/:profile/analytics/devices Source: https://nextdns.github.io/api Retrieves analytics device data for a given profile. ```APIDOC ## GET /profiles/:profile/analytics/devices ### Description Retrieves analytics device data for a given profile. ### Method GET ### Endpoint /profiles/:profile/analytics/devices ### Query Parameters #### Query String 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). `limit` should 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) - **data** (Array) - Contains device ID, name, model, local IP (if applicable), and query count objects. ### Response Example ```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 }, ... ], ... } ``` ``` -------------------------------- ### Get Logs Source: https://nextdns.github.io/api Retrieves DNS logs for a given profile. By default, it returns navigational query types and deduplicates them. The `raw=1` parameter can be used to show all DNS queries. ```APIDOC ## GET /profiles/:profile/logs ### Description Retrieves DNS logs for a given profile. By default, only navigational query types (A, AAAA, HTTPS) are returned and deduplicated. Irrelevant domains are also filtered out. Use `raw=1` to show all DNS queries. ### Method GET ### Endpoint `/profiles/:profile/logs` ### Query Parameters - **raw** (Boolean) - Optional - Use `raw=1` to show all DNS queries instead of just navigational ones. ``` -------------------------------- ### GET /profiles/:profile/privacy Source: https://nextdns.github.io/api Retrieves privacy settings for a given profile. ```APIDOC ## GET /profiles/:profile/privacy ### Description Retrieves privacy settings for a given profile. ### Method GET ### Endpoint /profiles/:profile/privacy ``` -------------------------------- ### GET /profiles/:profile/analytics/ipVersions Source: https://nextdns.github.io/api Retrieves analytics IP version data for a given profile. ```APIDOC ## GET /profiles/:profile/analytics/ipVersions ### Description Retrieves analytics IP version data for a given profile. ### Method GET ### Endpoint /profiles/:profile/analytics/ipVersions ### Query Parameters #### Query String 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). `limit` should 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) - **data** (Array) - Contains IP version and query count objects. ### Response Example ```json { "data": [ { "version": 6, "queries": 784154 }, { "version": 4, "queries": 174308 }, ... ], ... } ``` ``` -------------------------------- ### GET /profiles/:profile/analytics/protocols Source: https://nextdns.github.io/api Retrieves analytics protocol data for a given profile. ```APIDOC ## GET /profiles/:profile/analytics/protocols ### Description Retrieves analytics protocol data for a given profile. ### Method GET ### Endpoint /profiles/:profile/analytics/protocols ### Query Parameters #### Query String 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). `limit` should 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) - **data** (Array) - Contains protocol name and query count objects. ### Response Example ```json { "data": [ { "protocol": "DNS-over-HTTPS", "queries": 958757 }, { "protocol": "DNS-over-TLS", "queries": 39582 }, { "protocol": "UDP", "queries": 2334 }, ... ], ... } ``` ``` -------------------------------- ### GET /profiles/:profile/analytics/dnssec Source: https://nextdns.github.io/api Retrieves analytics DNSSEC data for a given profile. ```APIDOC ## GET /profiles/:profile/analytics/dnssec ### Description Retrieves analytics DNSSEC data for a given profile. ### Method GET ### Endpoint /profiles/:profile/analytics/dnssec ### Query Parameters #### Query String 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). `limit` should 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) - **data** (Array) - Contains DNSSEC validation status and query count objects. ### Response Example ```json { "data": [ { "validated": false, "queries": 817664 }, { "validated": true, "queries": 8199 }, ... ], ... } ``` ``` -------------------------------- ### GET /profiles/:profile/analytics/domains Source: https://nextdns.github.io/api Retrieves analytics domain data for a given profile. ```APIDOC ## GET /profiles/:profile/analytics/domains ### Description Retrieves analytics domain data for a given profile. Supports filtering by status and root domain. ### Method GET ### Endpoint /profiles/:profile/analytics/domains ### Query Parameters #### Query String 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). `limit` should 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. - **status** (String) - Optional - `default | blocked | allowed` - **root** (Boolean) - Optional - Default `false` ### Response #### Success Response (200) - **data** (Array) - Contains domain, root (if applicable), and query count objects. ### Response Example ```json { "data": [ { "domain": "app-measurement.com", "queries": 29801 }, { "domain": "gateway.icloud.com", "root": "icloud.com", "queries": 18468 }, { "domain": "app.smartmailcloud.com", "root": "smartmailcloud.com", "queries": 16414 }, ... ], ... } ``` ``` -------------------------------- ### Get, Update, or Delete Profile Source: https://nextdns.github.io/api Allows retrieval, modification, or deletion of a specific profile using its unique identifier. ```APIDOC ## GET, PATCH, DELETE /profiles/:profile ### Description Retrieves, updates, or deletes a specific profile identified by its unique ID. ### Method GET, PATCH, DELETE ### Endpoint https://api.nextdns.io/profiles/:profile ### Parameters #### Path Parameters - **profile** (string) - Required - The unique identifier of the profile to manage. ### Request Body (for PATCH) - **name** (string) - Optional - The new name for the profile. - **security** (object) - Optional - Updated security settings. - **privacy** (object) - Optional - Updated privacy settings. - **parentalControl** (object) - Optional - Updated parental control settings. - **denylist** (array) - Optional - Updated list of domains to deny. - **allowlist** (array) - Optional - Updated list of domains to allow. - **settings** (object) - Optional - Updated general settings. ### Response (for GET) #### Success Response (200) - **data** (object) - The full JSON representation of the profile. #### Response Example (GET) ```json { "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 } } ``` ``` -------------------------------- ### GET /profiles/:profile/analytics/status Source: https://nextdns.github.io/api Retrieves analytics status data for a given profile. ```APIDOC ## GET /profiles/:profile/analytics/status ### Description Retrieves analytics status data for a given profile. ### Method GET ### Endpoint /profiles/:profile/analytics/status ### Query Parameters #### Query String 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). `limit` should 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) - **data** (Array) - Contains status and query count objects. ### Response Example ```json { "data": [ { "status": "default", "queries": 819491 }, { "status": "blocked", "queries": 132513 }, { "status": "allowed", "queries": 6923 }, ... ], ... } ``` ``` -------------------------------- ### GET /profiles/:profile/analytics/ips Source: https://nextdns.github.io/api Retrieves analytics IP address data for a given profile. ```APIDOC ## GET /profiles/:profile/analytics/ips ### Description Retrieves analytics IP address data for a given profile. ### Method GET ### Endpoint /profiles/:profile/analytics/ips ### Query Parameters #### Query String 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). `limit` should 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) - **data** (Array) - Contains IP address, network, geo, and query count objects. ### Response Example ```json { "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 }, { "ip": "2a01:e0a:2cd:1234:312a:4c24:215d:185", "network": { "cellular": false, "vpn": false, "isp": "Free", "asn": 12322 }, "geo": { "latitude": 48.5136, "longitude": -1.9042, "countryCode": "FR", "country": "France", "city": "Miniac-Morvan" }, "queries": 40410 }, ... ], ... } ``` ``` -------------------------------- ### Get Analytics Reasons Source: https://nextdns.github.io/api Retrieves analytics data categorized by the reason for query processing (e.g., blocklist, native tracking). This helps in understanding why queries are being processed or blocked. ```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 }, ... ], ... } ``` -------------------------------- ### GET /profiles/:profile/analytics/queryTypes Source: https://nextdns.github.io/api Retrieves analytics query type data for a given profile. ```APIDOC ## GET /profiles/:profile/analytics/queryTypes ### Description Retrieves analytics query type data for a given profile. ### Method GET ### Endpoint /profiles/:profile/analytics/queryTypes ### Query Parameters #### Query String 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). `limit` should 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) - **data** (Array) - Contains query type, name, and query count objects. ### Response Example ```json { "data": [ { "type": 28, "name": "AAAA", "queries": 356230 }, { "type": 1, "name": "A", "queries": 341812 }, { "type": 65, "name": "HTTPS", "queries": 260478 }, ... ], ... } ``` ``` -------------------------------- ### Get Analytics Devices Source: https://nextdns.github.io/api Retrieves analytics data broken down by device, showing device ID, name, model, and query counts. Includes a special entry for unidentified devices. ```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 }, ... ], ... } ``` -------------------------------- ### Get Analytics Protocols Source: https://nextdns.github.io/api Retrieves analytics data showing query counts per protocol (e.g., DNS-over-HTTPS, DNS-over-TLS, UDP). Useful for understanding network protocol usage. ```json { "data": [ { "protocol": "DNS-over-HTTPS", "queries": 958757 }, { "protocol": "DNS-over-TLS", "queries": 39582 }, { "protocol": "UDP", "queries": 2334 }, ... ], ... } ``` -------------------------------- ### Get Analytics IP Versions Source: https://nextdns.github.io/api Retrieves analytics data showing query counts for different IP versions (IPv4 and IPv6). Useful for understanding the distribution of IP versions used in DNS queries. ```json { "data": [ { "version": 6, "queries": 784154 }, { "version": 4, "queries": 174308 }, ... ], ... } ``` -------------------------------- ### Get Analytics Domains Source: https://nextdns.github.io/api Retrieves a list of domains with their associated query counts. Supports filtering by status (default, blocked, allowed) and by root domain. Useful for identifying top queried or blocked domains. ```json { "data": [ { "domain": "app-measurement.com", "queries": 29801 }, { "domain": "gateway.icloud.com", "root": "icloud.com", "queries": 18468 }, { "domain": "app.smartmailcloud.com", "root": "smartmailcloud.com", "queries": 16414 }, ... ], ... } ``` -------------------------------- ### Get Analytics Query Types Source: https://nextdns.github.io/api Retrieves analytics data detailing query counts for different DNS record types (e.g., A, AAAA, HTTPS). Helps in analyzing the types of DNS requests being made. ```json { "data": [ { "type": 28, "name": "AAAA", "queries": 356230 }, { "type": 1, "name": "A", "queries": 341812 }, { "type": 65, "name": "HTTPS", "queries": 260478 }, ... ], ... } ``` -------------------------------- ### Get Analytics Status Source: https://nextdns.github.io/api Retrieves the current status of analytics, including counts for default, blocked, and allowed queries. This endpoint is useful for a high-level overview of query activity. ```json { "data": [ { "status": "default", "queries": 819491 }, { "status": "blocked", "queries": 132513 }, { "status": "allowed", "queries": 6923 }, ... ], ... } ``` -------------------------------- ### Get Time Zone Information Source: https://nextdns.github.io/api Retrieve the user's time zone information using JavaScript's `Intl.DateTimeFormat` object. The API accepts time zone names from the Time Zone Database. ```javascript Intl.DateTimeFormat().resolvedOptions().timeZone > "Europe/Paris" ``` -------------------------------- ### Get Analytics IPs Source: https://nextdns.github.io/api Retrieves analytics data aggregated by IP address, including network information (cellular, VPN, ISP) and geolocation. Useful for analyzing traffic sources and patterns. ```json { "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 }, { "ip": "2a01:e0a:2cd:1234:312a:4c24:215d:185", "network": { "cellular": false, "vpn": false, "isp": "Free", "asn": 12322 }, "geo": { "latitude": 48.5136, "longitude": -1.9042, "countryCode": "FR", "country": "France", "city": "Miniac-Morvan" }, "queries": 40410 }, ... ], ... } ``` -------------------------------- ### Get Analytics DNSSEC Status Source: https://nextdns.github.io/api Retrieves analytics data on DNSSEC validation status, showing counts for validated and non-validated queries. Helps in assessing the adoption and effectiveness of DNSSEC. ```json { "data": [ { "validated": false, "queries": 817664 }, { "validated": true, "queries": 8199 }, ... ], ... } ``` -------------------------------- ### Create Profile Source: https://nextdns.github.io/api Creates a new profile with the specified configuration. The API returns the ID of the newly created profile upon success. ```APIDOC ## POST /profiles ### Description Creates a new profile with the specified configuration. ### Method POST ### Endpoint https://api.nextdns.io/profiles ### Request Body - **name** (string) - Required - The name of the profile. - **security** (object) - Optional - Security settings for the profile. - **privacy** (object) - Optional - Privacy settings for the profile. - **parentalControl** (object) - Optional - Parental control settings for the profile. - **denylist** (array) - Optional - List of domains to deny. - **allowlist** (array) - Optional - List of domains to allow. - **settings** (object) - Optional - General settings for the profile. ### Request Example ```json { "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** (object) - Contains the ID of the newly created profile. - **id** (string) - The ID of the newly created profile. #### Response Example ```json { "data": { "id": "abc123" } } ``` ``` -------------------------------- ### Download Logs Source: https://nextdns.github.io/api Initiates the download of DNS logs. By default, the endpoint redirects to the public URL of the generated file. Use `?redirect=0` to receive a JSON object containing the URL instead. ```APIDOC ## GET /profiles/:profile/logs/download ### Description Initiates the download of DNS logs. 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 `/profiles/:profile/logs/download` ### Query Parameters - **redirect** (integer) - Optional - Set to `0` to receive a JSON containing the file URL instead of being redirected. ``` -------------------------------- ### Create Profile Response Source: https://nextdns.github.io/api API response after successfully creating a new profile, containing the ID of the new profile. ```json { "data": { "id": "abc123" // the id of the newly created profile } } ``` -------------------------------- ### Stream DNS Logs in Real-time Source: https://nextdns.github.io/api Use the `/logs/stream` endpoint to receive new DNS query logs as Server-sent events (SSE). This endpoint supports most query parameters from the `/logs` endpoint, excluding pagination and sorting parameters. ```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":[]} ``` -------------------------------- ### POST /profiles/:profile/privacy/blocklists Source: https://nextdns.github.io/api Adds a blocklist for a given profile. ```APIDOC ## POST /profiles/:profile/privacy/blocklists ### Description Adds a blocklist for a given profile. ### Method POST ### Endpoint /profiles/:profile/privacy/blocklists ``` -------------------------------- ### POST /profiles/:profile/denylist Source: https://nextdns.github.io/api Adds a domain to the denylist for a given profile. ```APIDOC ## POST /profiles/:profile/denylist ### Description Adds a domain to the denylist for a given profile. ### Method POST ### Endpoint /profiles/:profile/denylist ``` -------------------------------- ### Full Profile Object Source: https://nextdns.github.io/api A complete JSON representation of a user profile, including security, privacy, parental controls, denylist, allowlist, and settings. ```json { "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 } } ``` -------------------------------- ### Stream Logs Source: https://nextdns.github.io/api Streams new logs in real-time using Server-sent events (SSE). Supports most query string parameters from the `/logs` endpoint, excluding `from`, `to`, `sort`, `limit`, and `cursor`. The `id` parameter can be used to resume streaming from a specific point. ```APIDOC ## GET /profiles/:profile/logs/stream ### Description Streams new logs in real-time using Server-sent events (SSE). Supports all query string parameters supported by the `/logs` endpoint with the exception of `from`, `to`, `sort`, `limit` and `cursor`. Events have a specific format, and the last `id` received can be used to resume streaming. ### Method GET ### Endpoint `/profiles/:profile/logs/stream` ### Query Parameters - **id** (string) - Optional - The last `id` received to resume streaming from. ``` -------------------------------- ### Time Series Analytics for Query Types Source: https://nextdns.github.io/api Fetches time series data for different DNS query types, allowing for chart creation. Use query parameters like `from`, `interval`, `limit`, `series`, `alignment`, `timezone`, and `partials` to customize the data. ```javascript // 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": [ "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" } } } ``` -------------------------------- ### API Response Format (Success) Source: https://nextdns.github.io/api Standard JSON structure for successful API responses, containing 'data' and optional 'meta' sections. ```json { "data": {...}, // or [...], depending on the endpoint "meta": {...} // optional } ``` -------------------------------- ### /profiles/:profile/logs Source: https://nextdns.github.io/api Retrieves log data for a given profile. This endpoint supports filtering by date range, sorting, limiting results, and filtering by device, status, or search query. ```APIDOC ## GET /profiles/:profile/logs ### Description Retrieves log data for a given profile. This endpoint supports filtering by date range, sorting, limiting results, and filtering by device, status, or search query. ### Endpoint `/profiles/:profile/logs` ### Query Parameters - **from** (Date) - Filter out logs with older date (inclusive). - **to** (Date) - Filter out logs with newer or equal date (exclusive). - **sort** (asc | desc) - Sort order for logs. Defaults to 'desc'. - **limit** (Integer) - Limit the number of results returned. Should be between 10 and 1000. Defaults to 100. - **cursor** (String) - Use to get the next page of results. - **device** (String) - Filter logs for a specific device. Use `__UNIDENTIFIED__` for unidentified devices. - **status** (default | error | blocked | allowed) - Filter by log status (optional). - **search** (String) - Filter logs matching the search query (e.g., 'facebook'). ``` -------------------------------- ### Resume Log Streaming Source: https://nextdns.github.io/api To resume log streaming without duplicates or missing logs, pass the last `id` received from the stream as a query parameter to the `/logs/stream` endpoint. ```json { "data": [...], "meta": { ... "stream": { "id": "64v32d9r6rwkcctg6cu38e9g60" } } } ``` -------------------------------- ### PATCH /profiles/:profile/settings/performance Source: https://nextdns.github.io/api Updates the performance settings for a given profile. ```APIDOC ## PATCH /profiles/:profile/settings/performance ### Description Updates the performance settings for a given profile. ### Method PATCH ### Endpoint /profiles/:profile/settings/performance ``` -------------------------------- ### PUT /profiles/:profile/privacy/blocklists Source: https://nextdns.github.io/api Updates blocklists for a given profile. ```APIDOC ## PUT /profiles/:profile/privacy/blocklists ### Description Updates blocklists for a given profile. ### Method PUT ### Endpoint /profiles/:profile/privacy/blocklists ``` -------------------------------- ### DELETE /profiles/:profile/privacy/blocklists/:id Source: https://nextdns.github.io/api Deletes a specific blocklist for a given profile. ```APIDOC ## DELETE /profiles/:profile/privacy/blocklists/:id ### Description Deletes a specific blocklist for a given profile. ### Method DELETE ### Endpoint /profiles/:profile/privacy/blocklists/:id ``` -------------------------------- ### Time series analytics Source: https://nextdns.github.io/api All analytics endpoints can return time series data by appending ';series' to the endpoint. This allows for creating charts by returning an array of values for 'queries' over time. Additional parameters like 'interval', 'alignment', 'timezone', and 'partials' can be used to customize the time series. ```APIDOC ## GET [Analytics Endpoint];series ### Description Retrieves time series data for analytics endpoints. Appending ';series' to an analytics endpoint returns an array of query counts over time, enabling chart creation. Supports 'interval', 'alignment', 'timezone', and 'partials' query parameters for customization. ### Endpoint `[Analytics Endpoint];series` ### Query Parameters - **from** (Date) - Filter out data older than this date (inclusive). - **to** (Date) - Filter out data newer than or equal to this date (exclusive). - **interval** (Seconds | Duration) - Specifies the duration for each tumbling window. - **alignment** (start | end | clock) - Aligns tumbling windows on the clock. Defaults to 'end'. - **timezone** (TimeZone) - Specifies the timezone for alignment when `alignment=clock`. Defaults to 'GMT'. - **partials** (none | start | end | all) - Determines whether to return partial tumbling windows. Defaults to 'none'. ### Response #### Success Response (200) - **data** (array) - An array of objects, where each object represents a data point: - **queries** (array) - An array of query counts for the specified time series. - **meta.series.times** (array) - An array of timestamps indicating the start of each tumbling window. - **meta.series.interval** (integer) - The duration in seconds of each tumbling window. ``` -------------------------------- ### PATCH /profiles/:profile/privacy/blocklists/:id Source: https://nextdns.github.io/api Updates a specific blocklist for a given profile. ```APIDOC ## PATCH /profiles/:profile/privacy/blocklists/:id ### Description Updates a specific blocklist for a given profile. ### Method PATCH ### Endpoint /profiles/:profile/privacy/blocklists/:id ``` -------------------------------- ### Clear Logs Source: https://nextdns.github.io/api Deletes all DNS logs for a given profile. Note that logs are automatically cleared when a profile is deleted. ```APIDOC ## DELETE /profiles/:profile/logs ### Description Deletes all DNS logs for a given profile. Logs are automatically cleared when a profile is deleted. ### Method DELETE ### Endpoint `/profiles/:profile/logs` ```