Authentication
Learn how to authenticate with the Nolano API using API keys
Overview
The Nolano API uses API key authentication to secure access to all endpoints. This ensures that only authorized users can access your forecasting data and manage API resources.
Authentication Methods
API Key Authentication
All forecast endpoints use API key authentication. Include your API key in the Authorization
header:
API Key Format
Nolano API keys follow a specific format for easy identification:
Example:
Security Features
Secure Storage
- API keys are hashed using SHA-256 before storage
- Only the hash is stored in the database
- The original key is never stored in plain text
Usage Tracking
Every API call is tracked with detailed metrics:
- Usage Count: Total number of requests made
- Last Used: Timestamp of the most recent request
- Request Patterns: Monitoring for unusual activity
Permission System
API keys support fine-grained permissions:
read
Access to forecast endpoints and data retrieval
write
Ability to create and modify forecasts
admin
Manage API keys for the account
delete
Delete data and forecasts
Getting Your API Key
You can create and manage your API keys from the Nolano dashboard.
Go to API Keys Dashboard
Navigate to the API Keys section in your dashboard to create, manage, and monitor your keys.
From the dashboard, you can:
- Create new API keys with specific permissions.
- Monitor usage statistics for each key.
- Set custom expiration dates.
- Rotate and revoke keys securely.
Error Handling
Common Authentication Errors
401 Unauthorized
401 Unauthorized
403 Forbidden
403 Forbidden
Cause: API key lacks required permissions
Solution:
- Check your key’s permissions
- Contact support to upgrade permissions if needed
- Use a different key with appropriate permissions
429 Rate Limited
429 Rate Limited
Cause: Too many requests in a short time period
Solution:
- Implement exponential backoff
- Reduce request frequency
- Consider upgrading to a higher tier plan
Security Best Practices
Key Management
- Store Securely: Never commit API keys to version control
- Environment Variables: Use environment variables for key storage
- Rotate Regularly: Rotate keys periodically for security
- Minimize Permissions: Only grant necessary permissions
- Monitor Usage: Regularly review key usage patterns
Request Security
- HTTPS Only: Always use HTTPS for API requests
- Secure Headers: Include proper headers in requests
- Rate Limiting: Implement client-side rate limiting
- Error Handling: Don’t expose keys in error messages
Example: Secure Storage
Rate Limits
Different subscription tiers have different rate limits:
Tier | Requests/Minute | Requests/Hour | Requests/Day |
---|---|---|---|
Free | 10 | 100 | 1,000 |
Standard | 100 | 1,000 | 50,000 |
Premium | 500 | 5,000 | 250,000 |
Enterprise | Custom | Custom | Custom |
Rate Limit Headers
API responses include rate limit information:
Testing Authentication
Quick Test
Test your API key with a simple request:
Expected Response
A successful authentication will return either:
- 200 OK: Your request was processed
- 500 Server Error: Authentication succeeded, but the target API is unreachable
An authentication failure will return:
- 401 Unauthorized: Invalid or missing API key