Skip to main content

Overview

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.

Getting Your API Key

1

Create Account

Visit anysite.io and create your account
2

Generate API Key

Navigate to your account settings and generate a new API key
3

Secure Storage

Store your API key securely and never expose it in client-side code

Authentication Methods

Access Token Header (Required)

Include your API key in the access-token header:
curl -X GET "https://api.anysite.io/tokens/statistic" \
  -H "access-token: YOUR_API_KEY"
The AnySite API does not use Bearer token authentication. Always use the access-token header.

Rate Limits

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.

Error Responses

When authentication fails, you’ll receive one of these responses:
401 Unauthorized
error
Invalid or missing API key
403 Forbidden
error
API key doesn’t have permission for this resource
429 Too Many Requests
error
Rate limit exceeded

Best Practices

  • Store API keys as environment variables
  • Use different API keys for different environments
  • Rotate API keys regularly
  • Monitor API usage in your dashboard
  • Never commit API keys to version control

Testing Authentication

Test your authentication setup with this simple request:
curl -X GET "https://api.anysite.io/tokens/statistic" \
  -H "access-token: YOUR_API_KEY"
I