Error Codes

Should you send a bad request you may receive an HTTP error in response to your API query to generate a screenshot. The errors are self-explanatory in nature, but are also documented here as an example of what you can expect.

Quota Reached

Should you have reached your Quota you will receive an HTTP 402 response with the following content:

{
  "message": "You have reached your quota."
}

Validation Errors

Requests are validated to ensure they meet the required fields, that your URL is valid, or that they are within the limitations (e.g. delay can be between 0 and 10000).

Errors are returned in the "field": "errors" format, and below is an example for an invalid delay:

curl -H "Accept: application/json" \
    -H "Authorization: Bearer YOUR_API_TOKEN" \
    "https://screendot.io/api/standard?url=https://www.google.com&delay=999999"
    
{
  "delay": ["The delay must not be greater than 10000."]
}    

You may also receive multiple errors, as shown below:

curl -H "Accept: application/json" \
    -H "Authorization: Bearer YOUR_API_TOKEN" \
    "https://screendot.io/api/standard?url=bad://url&delay=999999"
    
{
  "url":["The url must be a valid URL."],
  "delay": ["The delay must not be greater than 10000."]
}  

Field Restrictions

FieldRules
urlValid http or https URL
delayOptional, between 0 and 10000
browserWidthOptional, between 50 and 4096
browserHeightOptional, between 50 and 10000
widthOptional, between 50 and 4096
widthOptional, between 50 and 10000
formatOptional, one of "jpg", "gif", "webp", "png"
refreshOptional, boolean
responseOptional, one of "json", "image", "url"