API Authorization
Warning
Never expose your API keys or tokens in client-side code or publicly accessible URLs.
To use the UK DNS Privacy Project API, you must authenticate your requests using one of the following methods:
1. Bearer Token (Authorization Header)
You can include a Bearer token in the Authorization
header of your request.
Example Header
Authorization: Bearer your-access-token
Example Request
curl -X GET "https://dnsprivacy.org.uk/domains" \
-H "Authorization: Bearer your-access-token" \
-H "accept: application/json"
2. API Key (Query Parameter)
Alternatively, you can include an apikey
directly in the query string of your request.
Example URL
https://dnsprivacy.org.uk/domains?apikey=your-api-key
Example Request
curl -X GET "https://dnsprivacy.org.uk/domains?apikey=your-api-key" \
-H "accept: application/json"
Which Should I Use?
- Bearer Token is recommended for secure, authenticated API access via user or app tokens.
- API Key is simpler for quick tests or for server-to-server access where embedding a key in the URL is acceptable.