Skip to main content

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 url parameter 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:

  1. Test with simpler script first
  2. Add try-catch blocks
  3. Use console.log for debugging
  4. 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:

  1. Check API key in RapidAPI dashboard
  2. Verify correct host header
  3. Ensure subscription is active
  4. 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:

  1. Retry the request after a few seconds
  2. If persistent, contact support
  3. 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

  1. Check this reference for your specific error code
  2. Review request format against API documentation
  3. Test with simpler examples to isolate the issue
  4. Check API status page for service issues
  5. 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 TypeQuick Fix
Missing elementsUse optional chaining ?.
TimeoutsAdd waitForSelector with reasonable timeouts
Rate limitsImplement exponential backoff
AuthenticationVerify API key and headers
Script errorsAdd try-catch blocks and logging
Page load issuesCheck URL and site availability