API Errors
Introduction
If you want to port those definitions into your application, you can checkout the Exportable Definition section to retrieve the JSON describing errors.
Generic API Error
Example of API error response :
{
status: "error",
http_code: 401,
reason: "Unauthorized",
error_id: "301e2d9e-b4f5-4289-85ea-e452143338df",
message: "Invalid API key"
}
HTTP 400
Bad Request: Parameters sent to the API are incorrect. Check out the related documentation to figure out the error.
HTTP 404
Not Found: API URL might have a typo or be incorrect. Check out the related documentation to figure out the error.
HTTP 422
Unprocessable Entity: Your request was correct, but for some reason, we cannot handle it. Most of the time, the entity which you want to update/delete has already been processed.
HTTP 429
Too Many Request: API endpoint, which should be called with a high frequency, are throttled internally to prevent service disruption. If this happened too many times, your account would be suspended.
HTTP 500
Internal Server Error: Scrapfly is in trouble, and we have been alerted of the issue.
HTTP 502
Web service that exposes Scrapfly to the internet is in trouble, and we have been alerted of the issue.
HTTP 503
Service Temporary Unavailable: Scrapfly might run in degraded mode, or maintenance was scheduled to upgrade our service.
HTTP 504
Scrapfly is not reachable or takes too much time to respond.
Extraction API Errors
Scrapfly provides API errors in two locations - in the response body and the response headers:
The error details are also present in the response x-scrapfly-reject-*
headers.
Error Definitions
ERR::EXTRACTION::CONFIG_ERROR
Parameters sent to the API are not valid
- Retryable: No
- HTTP status code: 400
- Documentation:
ERR::EXTRACTION::CONTENT_TYPE_NOT_SUPPORTED
The content type of the response is not supported for extraction.
- Retryable: No
- HTTP status code: 422
- Documentation:
ERR::EXTRACTION::DATA_ERROR
Extracted data is invalid or have an issue
- Retryable: Yes
- HTTP status code: 422
- Documentation:
ERR::EXTRACTION::INVALID_RULE
The extraction rule is invalid
- Retryable: No
- HTTP status code: 400
- Documentation:
ERR::EXTRACTION::INVALID_TEMPLATE
The template used for extraction is invalid
- Retryable: No
- HTTP status code: 400
- Documentation:
ERR::EXTRACTION::NO_CONTENT
Target response is empty
- Retryable: No
- HTTP status code: 422
- Documentation:
ERR::EXTRACTION::OPERATION_TIMEOUT
Extraction Operation Timeout
- Retryable: Yes
- HTTP status code: 408
- Documentation:
ERR::EXTRACTION::OUT_OF_CAPACITY
Not able to extract more data, backend are out of capacity, retry later.
- Retryable: Yes
- HTTP status code: 429
- Documentation:
ERR::EXTRACTION::TEMPLATE_NOT_FOUND
The provided template do not exist
- Retryable: No
- HTTP status code: 404
- Documentation:
ERR::EXTRACTION::TIMEOUT
The extraction was tool long (maximum 25s) or do not had enough time to complete
- Retryable: Yes
- HTTP status code: 422
- Documentation:
Exportable Definition
If you want to handle errors from your application without copy-pasting the whole error definition into your application to match errors, here is a portable JSON of error definition: