API Authentication
ECODATA API uses Bearer token authentication.
Getting Your API Key
- Log in to ECODATA Dashboard
- Navigate to Settings → API Keys
- Click Generate New Key
- Copy and store your key securely
Using the API Key
Header Authentication (Recommended)
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://ecodata.khoviet.com/api/v1/indicators
Query Parameter (Alternative)
curl "https://ecodata.khoviet.com/api/v1/indicators?api_key=YOUR_API_KEY"
Security Best Practices
- ✅ Store API keys in environment variables
- ✅ Use HTTPS for all requests
- ✅ Rotate keys periodically
- ❌ Never commit keys to version control
- ❌ Never share keys publicly
Error Responses
| Code | Message | Solution |
|---|---|---|
| 401 | Invalid API key | Check your API key |
| 403 | Rate limit exceeded | Wait or upgrade plan |
| 403 | Insufficient permissions | Check your subscription |
Keep Keys Secret
Never expose your API key in client-side code.