Authentication
API Authentication
All API requests require authentication via an API key. Include your key in thex-api-keyheader with every request.
Get Your API Key
- Visit our pricing page and choose a plan
- Choose a subscription plan that fits your needs
- Navigate to your Dashboard
- Your API key will be displayed in the API Key section
Base URL
https://astro-api-1qnc.onrender.comRequired Headers
| Header | Value | Required |
|---|---|---|
| x-api-key | Your API key | Yes |
| Content-Type | application/json | Yes (for POST) |
Authentication Examples
curl -X POST "https://astro-api-1qnc.onrender.com/api/v1/natal/calculate" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"year": 1990, "month": 5, "day": 15, "hour": 10, "minute": 30, "lat": 40.7128, "lng": -74.006}'Security Best Practices
- •Never expose your API key in client-side code. Make API calls from your backend server.
- •Use environment variables to store your API key, not hardcoded strings.
- •Rotate your API key if you suspect it has been compromised.
- •Monitor your usage in the dashboard to detect unusual activity.
Authentication Errors
| Status | Message | Description |
|---|---|---|
| 401 | Missing API key | x-api-key header not provided |
| 401 | Invalid API key | The API key does not exist or was revoked |
| 429 | Rate limit exceeded | You've exceeded your plan's request limit |
| 403 | Subscription required | Your subscription has expired or is inactive |
Rate Limits
Rate limits vary by subscription plan. The following headers are included in every response:
| Header | Description |
|---|---|
| X-RateLimit-Limit | Total requests allowed per period |
| X-RateLimit-Remaining | Requests remaining in current period |
| X-RateLimit-Reset | Timestamp when the limit resets |