Learn how to authenticate with the Anysite API
Anysite uses API key authentication to secure access to all endpoints. You'll need to include your API key in the request headers for all API calls.
Visit [anysite.io](https://app.anysite.io/register) and create your account
Navigate to your account settings and generate a new API key
Store your API key securely and never expose it in client-side code
Include your API key in the access-token header:
curl -X GET "https://api.anysite.io/token/statistic" \
-H "access-token: YOUR_API_KEY"
The Anysite API does not use Bearer token authentication. Always use the access-token header.
API requests are subject to rate limiting to ensure fair usage:
Rate limits vary by endpoint and subscription plan. Check your dashboard for current limits.
When authentication fails, you'll receive one of these responses:
Invalid or missing API key
API key doesn't have permission for this resource
Rate limit exceeded
Test your authentication setup with this simple request:
curl -X GET "https://api.anysite.io/token/statistic" \
-H "access-token: YOUR_API_KEY"
import requests
headers = {
'access-token': 'YOUR_API_KEY'
}
response = requests.get(
'https://api.anysite.io/token/statistic',
headers=headers
)
print(response.json())
const response = await fetch('https://api.anysite.io/token/statistic', {
headers: {
'access-token': 'YOUR_API_KEY'
}
});
const data = await response.json();
console.log(data);