Screenshot
Capture a full-page browser screenshot as base64 or an uploaded public URL, with optional viewport sizing and cookie-banner blocking.
Capture a full-page browser screenshot and receive it as a base64-encoded JPEG in the response, or have it uploaded to a public URL.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
screenshot |
boolean | Yes | Enables full-page screenshot capture and returns base64 in the response. |
screenshotUpload |
boolean | No | Also uploads the screenshot to DigitalOcean Spaces and returns a public URL. |
screenshotWidth |
number | No | Width of the viewport before capture (in pixels). Default: 1280. |
screenshotHeight |
number | No | Height of the viewport before capture (in pixels). Default: 1024. |
fullPage |
boolean | No | Captures the full scrollable page height. Default: false. |
abortOnDetection |
array | No | List of URL patterns to block before page load (e.g. cookie-banner scripts). |
abortOnPostRequest |
boolean | No | When true, only POST requests matching abortOnDetection are blocked. |
Notes:
- Full-page capture is always used regardless of the resolution you set.
- Screenshots are produced as JPEG with quality 80.
Request
Full-page base64 only:
Full-page base64 + upload to Spaces:
Blocking cookie banners for a clean screenshot:
If any network request URL contains one of the specified values, it will be aborted before loading.
Response
| Field | Type | Description |
|---|---|---|
solution.screenshot |
string | Base64-encoded JPEG of the full page. |
solution.screenshotUrl |
string | Public URL in Spaces, present only when screenshotUpload: true. Filenames include a prefix with dimensions: screenshots/{width}x{height}_{random}.jpg. |
abortOnDetectionResponse |
array | List of blocked requests, each with URL, headers, and payload. Present when abortOnDetection is used. |
Response snippet when screenshotUpload: true:
Blocking Cookie Banners
Many websites show cookie or GDPR consent banners that can cover content and appear in screenshots. Use abortOnDetection to block the network requests these banners depend on before the page loads.
The browser intercepts all network requests while loading the page. If a request URL matches a pattern you specify, that request is blocked. Cookie banners often fail to load when their consent or tracking scripts are blocked, preventing the banner from ever appearing.
Common providers whose URLs you may want to block:
- Cookiebot
- OneTrust
- Quantcast
- TrustArc
- Cookie Law Info
- Custom GDPR or consent endpoints
Their request URLs often contain keywords like: cookie, consent, gdpr, privacy.
By default, all matching requests are blocked. Set abortOnPostRequest: true to restrict blocking to POST requests only.
After the page loads, blocked requests are available in abortOnDetectionResponse. Each entry includes the request URL, headers, and payload (if present) β useful for debugging or fine-tuning which patterns you block.
Tips
- Base64 payloads can be large. If response size is a concern, prefer
screenshotUpload: true. - Choose
screenshotWidth/screenshotHeightto influence layout before capture. - JPEG is used to optimize size.
- Blocking cookie banners improves screenshot consistency across sites.
- For a full session recording instead of a single still, use Record Video.
Related concepts
Go deeper in the Scrappey knowledge base:
- Headless browser β what renders the page you capture
- Headless browsers β driving a real browser to scrape