The crawler.dev API uses API key authentication. You'll need to include your API key in the x-api-key header of every request.
Getting Your API Key
- Sign up for a crawler.dev account at crawler.dev
- Copy your API key from the API keys page
- Keep it secure - treat your API key like a password
Using Your API Key
Include your API key in the x-api-key header:
Code
Example Request
Code
Environment Variables
Store your API key as an environment variable:
Code
Then use it in your code:
Code
Error Responses
Authentication errors return HTTP 401 with details:
Code
Common authentication error codes:
| Code | Message | Solution |
|---|---|---|
missing_auth | No Authorization header provided | Add the Authorization header |
invalid_key | Invalid API key format | Check your API key format |
key_not_found | API key not found | Verify your API key is correct |
key_disabled | API key has been disabled | Contact support or generate a new key |
Managing API Keys
From your dashboard, you can:
- View all your API keys
- Generate new API keys
- Disable compromised keys
- Monitor usage per key
- Set usage alerts
Need Help?
Having trouble with authentication? Here are some common solutions:
- Double-check your API key for typos
- Verify you're using the correct environment (test vs live)
- Ensure the Authorization header format is correct
- Check that your API key hasn't expired or been disabled
If you're still having issues, please contact our support team.
