API Access Key & Authentication
After signing up, every user is assigned a personal API Access Key - a unique "password" used to authenticate with the API.
To call the Screenshotlayer API, simply append your access_key as a parameter to the base URL:
https://api.apilayer.net/screenshotlayer/capture?access_key=YOUR_ACCESS_KEYSign up for a free or paid plan to get your API Access Key from the Dashboard. Our Free Plan offers up to 100 monthly snapshots. Paid plans provide larger request volumes and a full stack of advanced features.
HTTPS - Secure Datastreams
All Customers may establish a secure connection via 256-bit HTTPS (industry-standard SSL) to the Screenshotlayer API, ensuring encrypted datastreams between server and client. To connect securely, simply append an s to the HTTP Protocol.
https://api.apilayer.net/screenshotlayer/capture?access_key=YOUR_ACCESS_KEYRate Limits
Requests to the API are rate-limited based on your current subscription plan:
| Subscription Plan | Rate Limit |
|---|---|
| Free | 2 Requests / Minute |
| Basic | 30 Requests / Minute |
| Professional | 45 Requests / Minute |
| Enterprise | 45 Requests / Minute |
Important: In order to ensure maximum API performance, we recommend Basic, Professional and Enterprise Plan users to limit their usage to a maximum of 1 API request per 2 seconds.
If your rate limit for a given minute has been exceeded, the API returns HTTP 429 (Too Many Requests).
API Error Codes
If your query fails, the Screenshotlayer API returns "success": false with a 3-digit error code, an internal error type, and a plain text "info" object containing suggestions for the user.
Common API errors
| Code | Type | Description |
|---|---|---|
| 103 | invalid_api_function | User requested a non-existent API Function. |
| 210 | invalid_url | User provided an invalid website URL. |
| 105 | function_access_restricted | Your plan does not include this feature, for example export on the Free plan. Returned with HTTP 403. |
| 310 | secret_key_required | User has to provide a secret key in order to access the requested resource. |
| 311 | invalid_secret_key | User provided an invalid secret key. |
| 410 | invalid_viewport_size | User provided invalid viewport dimensions (required format: width x height, e.g. 1440x900). |
| 411 | viewport_too_large | The provided viewport is too large (max. viewport dimensions: 5000x5000). |
| 420 | invalid_thumbnail_width | User provided an invalid thumbnail width (required format: integer). |
| 510 | invalid_css_url | User provided an invalid CSS file URL. |
| 511 | css_download_failed | System failed downloading the provided CSS file. |
| 512 | css_too_large | The provided CSS file is too large in size. (max-size: 100kB) |
| 610 | invalid_delay_time | User provided an invalid delay time. (required format: integer) |
| 611 | delay_time_too_long | The provided delay time is too long. (max. length: 20 seconds) |
| 620 | invalid_ttl | User provided an invalid TTL (required format: integer). |
| 620 | invalid_quality | quality is not an integer. |
| 621 | ttl_too_short | The provided TTL is too short (mininum: 300 seconds) |
| 622 | ttl_too_long | The provided TTL is too long (maximum: 2592000 seconds) |
| 622 | invalid_quality | quality is above 100. |
| 622 | invalid_quality_value | Your plan does not support the requested quality. On the Free plan any value above 70 returns this error. |
| 622 | scale_too_large | scale is above 2. |
| 622 | scale_access_restricted | Your plan does not support the requested scale. On the Free plan any scale value returns this error. |
| 710 | failed_loading_placeholder_img | System failed downloading the provided placeholder image. |
| 810 | invalid_export_path | User provided an invalid export path. (See AWS S3 & FTP Export) |
| 820 | invalid_output_format | The provided output format is invalid (available formats: PNG, JPG, WEBP). |
| 910 | failed_showing_screenshot | System failed displaying the requested screenshot. |
| 999 | unexpected_error | An unexpected error occurred. Also returned (HTTP 400, no info) for format=GIF, because GIF is not supported. |
Missing or invalid API keys (HTTP 401) and quota or rate limits (HTTP 429) are returned by the API gateway. See API Error Codes.