Skip to main content

Make your first request

The API base URL is https://api.nextdns.io. Copy or create a key in the API section of your NextDNS account page. Set NEXTDNS_API_KEY to that value in your shell. List your profiles by sending the key in the X-Api-Key header. Run this from your terminal or server. Cross-origin browser requests from third-party sites cannot send this header.
Copy the id of the profile you want to use. The role field tells you what access you have.

Read a profile

Set PROFILE_ID to an id from the response, then fetch that profile.
Use the same ID to manage the profile’s Denylist, count blocked queries, or read recent logs. The API is in beta and may change without notice.