Getting an API Key
Sign in
Sign in to your ScrapeBadger account.
Navigate to API Keys
Go to the API Keys page in your dashboard.
Using Your API Key
Include your API key in every request using one of these methods:Header Authentication (Recommended)
Pass your API key in thex-api-key header. This is the recommended method as it keeps your key out of URLs and logs.
Query Parameter
Alternatively, pass your API key as a query parameter. Note that this method may expose your key in logs and browser history.Error Responses
If authentication fails, the API returns one of these status codes:| Status | Name | Description |
|---|---|---|
401 | Unauthorized | Missing or invalid API key. Check that you’re including the key correctly. |
402 | Payment Required | Insufficient credits. Purchase more credits to continue making requests. |
403 | Forbidden | API key is disabled or account is restricted. Contact support if you believe this is an error. |
Error Response Format
Security Best Practices
Never expose keys in client-side code
API keys should only be used in server-side code. Never include them in frontend JavaScript, mobile apps, or public repositories.
Use separate keys for different environments
Create separate API keys for development, staging, and production. This makes it easier to rotate keys and track usage.
Rotate keys regularly
Periodically create new API keys and deactivate old ones. If a key is compromised, you can disable it without affecting other keys.
Managing API Keys
From your dashboard, you can:- Create multiple API keys for different projects
- Rename keys for easier identification
- Enable or disable keys without deleting them
- View usage statistics per key
- Delete keys that are no longer needed

