Skip to Content

Authentication

How to authenticate requests to the DNS.Tools API with your API key.

Free Tier

We offer a generous free tier so you can start using the API immediately. With 1,000 credits a month, it's perfect for testing and light usage.

Create an account to get an API key and use the free tier — no credit card required.

API Key Authentication

Every request must be authenticated with your API key. We support three methods of providing it:

Authentication Methods
X-API-Key: YOUR-API-KEYheader

Provide your API key in an HTTP request header.

Authorization: Bearer YOUR-API-KEYheader

Authenticate using standard Bearer token format.

?key=YOUR-API-KEYquerystring

Provide your API key as a URL query parameter.

Example Authenticated Requests

Authentication Examples
# Using X-API-Key Header
curl -X GET "https://api.dns.tools/v1/domain?domain=google.com" \
  -H "X-API-Key: YOUR-API-KEY"

# Using Authorization Bearer Token
curl -X GET "https://api.dns.tools/v1/domain?domain=google.com" \
  -H "Authorization: Bearer YOUR-API-KEY"

# Using Query Parameter
curl -X GET "https://api.dns.tools/v1/domain?domain=google.com&key=YOUR-API-KEY"
JavaScript Fetch Example
const response = await fetch('https://api.dns.tools/v1/domain?domain=google.com', {
  method: 'GET',
  headers: {
    'X-API-Key': 'YOUR-API-KEY'
    // or with Authorization Bearer Token (don't need both)
    // 'Authorization: Bearer YOUR-API-KEY'
  }
});

const data = await response.json();