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

# API quickstart

> Use your API key to list your NextDNS profiles and read their settings.

## 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](https://my.nextdns.io/account). 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.

```bash theme={null}
curl -sS 'https://api.nextdns.io/profiles' \
  -H "X-Api-Key: $NEXTDNS_API_KEY"
```

Copy the `id` of the profile you want to use. The `role` field tells you what access you have.

```json theme={null}
{
  "data": [
    {
      "id": "c2ke6y",
      "fingerprint": "fp0123456789abcdef",
      "role": "owner",
      "name": "Home"
    }
  ]
}
```

## Read a profile

Set `PROFILE_ID` to an `id` from the response, then fetch that profile.

```bash theme={null}
curl -sS "https://api.nextdns.io/profiles/$PROFILE_ID" \
  -H "X-Api-Key: $NEXTDNS_API_KEY"
```

Use the same ID to [manage the profile’s Denylist](https://docs.nextdns.io/api-reference/profiles/domain-lists.md), [count blocked queries](https://docs.nextdns.io/api-reference/analytics/status.md), or [read recent logs](https://docs.nextdns.io/api-reference/logs/list.md).

The API is in beta and may change without notice.


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