Error Codes Reference
Complete reference of error codes, their meanings, and troubleshooting steps for Easy Scrape API.
Error Code Format
All API errors follow this consistent format:
{
"error": "Missing url",
"code": "MISSING_REQUIRED_FIELD",
"statusCode": 400
}
400 - Bad Request Errors
MISSING_REQUIRED_FIELD
Description: A required parameter is missing from the request.
{
"error": "Missing url",
"code": "MISSING_REQUIRED_FIELD",
"statusCode": 400
}
Common Causes:
- No
urlparameter provided - Empty request body
- Malformed JSON
Solution:
{
"url": "https://example.com"
}
SCRAPING_FAILED
Description: The JavaScript script execution failed.
{
"error": "Script execution failed: ReferenceError: undefinedVar is not defined",
"code": "SCRAPING_FAILED",
"statusCode": 400
}
Common Causes:
- Syntax errors in JavaScript
- Trying to access non-existent elements
- Network timeouts
- Page load failures
Debugging Steps:
- Test with simpler script first
- Add try-catch blocks
- Use console.log for debugging
- Check if elements exist before accessing
Example Fix:
// ❌ Problematic
"const title = document.querySelector('h1').textContent";
// ✅ Safe
"const titleEl = document.querySelector('h1'); const title = titleEl ? titleEl.textContent.trim() : 'No title found'";
INVALID_OUTPUT_FORMAT
Description: Unsupported output format specified.
{
"error": "Invalid output format. Supported: json, html",
"code": "INVALID_OUTPUT_FORMAT",
"statusCode": 400
}
Solution:
{
"url": "https://example.com",
"outputFormat": "json" // or "html"
}
401 - Authentication Errors
MISSING_API_KEY
Description: No API key provided in request headers.
{
"error": "API key is required",
"code": "MISSING_API_KEY",
"statusCode": 401
}
Solution: Include proper headers:
curl -H "X-RapidAPI-Key: YOUR_KEY" \
-H "X-RapidAPI-Host: easy-scrape-api.rapidapi.com"
INVALID_API_KEY
Description: The provided API key is not valid.
{
"error": "Invalid API key",
"code": "INVALID_API_KEY",
"statusCode": 401
}
Troubleshooting:
- Check API key in RapidAPI dashboard
- Verify correct host header
- Ensure subscription is active
- Check for typos in key
500 - Server Errors
INTERNAL_SERVER_ERROR
Description: Unexpected server error occurred.
{
"error": "Internal server error",
"code": "INTERNAL_SERVER_ERROR",
"statusCode": 500
}
What to do:
- Retry the request after a few seconds
- If persistent, contact support
- Check API status page
Script Runtime Errors
MEMORY_LIMIT_EXCEEDED
Description: Script used too much memory.
{
"error": "Memory limit exceeded",
"code": "MEMORY_LIMIT_EXCEEDED",
"statusCode": 400
}
Solutions:
- Process data in smaller chunks
- Avoid storing large arrays in memory
- Use streaming/pagination for large datasets
Getting Help
Error Resolution Steps
- Check this reference for your specific error code
- Review request format against API documentation
- Test with simpler examples to isolate the issue
- Check API status page for service issues
- Contact support with error details if unresolved
Support Information
When contacting support, include:
- Complete error response
- Request payload (without API key)
- Steps to reproduce
- Expected vs actual behavior
- Timestamp of the error
Common Solutions Summary
| Error Type | Quick Fix |
|---|---|
| Missing elements | Use optional chaining ?. |
| Timeouts | Add waitForSelector with reasonable timeouts |
| Rate limits | Implement exponential backoff |
| Authentication | Verify API key and headers |
| Script errors | Add try-catch blocks and logging |
| Page load issues | Check URL and site availability |