Overview
ManyPi uses API key authentication with Bearer tokens. All API requests must include a valid API key in theAuthorization header.
API keys are tied to your account and provide access to all your scrapers. Keep them secure and never commit them to version control.
Getting your API key
1
Navigate to API Keys
Go to Settings → API Keys in your dashboard.
2
Create a new key
Click “Create API Key” and give it a descriptive name (e.g., “Production Server”, “Staging Environment”).
3
Copy and store securely
Copy the API key immediately - you won’t be able to see it again!
Making authenticated requests
Basic authentication
Include your API key in theAuthorization header as a Bearer token:
cURL
Authentication format
- Scheme:
Bearer - Token: Your API key (no additional encoding needed)
Code examples
Environment variables
Store your API key in environment variables, never hardcode it:- .env file
- Node.js
- Python
- Docker
- Kubernetes
.env
Authentication errors
401 Unauthorized
Cause: Missing or invalid API key- Check that the
Authorizationheader is present - Verify the API key is correct (no extra spaces or characters)
- Ensure the API key hasn’t been deleted or revoked
- Confirm you’re using the
Bearerscheme
403 Forbidden
Cause: Valid API key but insufficient permissions or credits- Check your credit balance in the dashboard
- Purchase additional credits or upgrade your plan
- Verify the scraper belongs to your account
Managing API keys
Creating multiple keys
Create separate API keys for different purposes:- Isolate rate limits (60 req/min per key)
- Easier to rotate keys without downtime
- Better security through separation
- Track usage by service
Rotating API keys
1
Create new key
Generate a new API key in the dashboard with a descriptive name.
2
Update your application
Deploy the new key to your application (use blue-green deployment or rolling updates).
3
Monitor
Verify the new key is working correctly in production.
4
Revoke old key
Once confirmed, delete the old API key from the dashboard.
Revoking compromised keys
If an API key is compromised:- Immediately revoke the key in your dashboard
- Create a new key and update your application
- Review usage logs for any suspicious activity
- Monitor credits for unexpected consumption
Security best practices
Never commit API keys to Git
Never commit API keys to Git
.gitignore
Use secret management services
Use secret management services
For production applications, use dedicated secret management:
- AWS Secrets Manager
- HashiCorp Vault
- Azure Key Vault
- Google Secret Manager
- Doppler
- 1Password Secrets Automation
Rotate keys regularly
Rotate keys regularly
Set up a rotation schedule:
Limit key exposure
Limit key exposure
- Don’t log API keys
- Don’t send keys in URLs or query parameters
- Don’t include keys in client-side code
- Use server-side proxies for browser applications
Monitor key usage
Monitor key usage
Track API key usage to detect anomalies:
Testing authentication
Verify your API key
Test your API key with a simple request:- ✅
HTTP/1.1 200 OK- Authentication successful - ❌
HTTP/1.1 401 Unauthorized- Invalid API key - ❌
HTTP/1.1 403 Forbidden- Valid key but insufficient permissions/credits
