Error Handling

Learn about the error handling mechanisms in the MrScraper API, including common error codes, response formats, and best practices for managing errors in your applications.

Overview

The MrScraper API will return a JSON object containing error details when a request fails. This object includes an error code, message, and additional information to help diagnose the issue.

Response Message

ResponseDescription
Unauthorized accessThe API key provided is invalid or missing.
Could not find any entity of type "Scraper"The specified scraper could not be found.
Could not find any entity of type "Result"The specified result could not be found.

Error Troubleshooting

When encountering errors, consider the following tips:

Unauthorized Access

  • Ensure that your API key is correct and included in the request headers.

Could not find any entity of type "Scraper"

  • Verify that the scraper ID you are using exists and is correctly spelled.

Could not find any entity of type "Result"

  • Check that the result ID you are referencing is valid and corresponds to an existing result.

Common Scraping Errors

ErrorDescriptionSolution
TimeoutPage took too long to loadIncrease timeout or check target site availability
Invalid selectorCSS/XPath selector not foundVerify selectors match the target page structure
Access deniedWebsite blocks automated accessUse rotating proxies or adjust scraper settings
Invalid URLURL is malformed or unreachableCheck URL format and accessibility
Token limit exceededInsufficient tokensUpgrade plan or wait for token refresh