API Key Authentication
The DNSRadar API uses API keys to authenticate requests. All API requests must include your secret API key in the request header to identify your account and authorize access.Getting Your API Key
You can create and manage your API keys from the DNSRadar Dashboard:- Log in to your account
- Navigate to Settings → API Keys
- Click “Generate New API Key”
- Copy and securely store your key
API keys have the prefix
sk_ followed by a unique identifier.Making Authenticated Requests
Include your API key in theX-Api-Key header with every request:
Authentication Errors
If authentication fails, you’ll receive one of the following error responses:| Status Code | Error | Description |
|---|---|---|
401 | Unauthorized | No API key was provided in the request header |
403 | Forbidden | The API key provided is invalid or has been revoked |
Best Practices
Rotate Your Keys Regularly
Rotate Your Keys Regularly
Generate new API keys periodically and revoke old ones to minimize security risks.
Use Environment Variables
Use Environment Variables
Store API keys in environment variables rather than hardcoding them in your application code.
Monitor API Key Usage
Monitor API Key Usage
Track which keys are being used and where to quickly identify and respond to potential security issues.
Use HTTPS Only
Use HTTPS Only
Always make API requests over HTTPS to prevent your API key from being intercepted.

