Playbooks
Playbook: screenshot a page
Capture a clean, full-page, retina screenshot and store it — in cURL, TypeScript and Python.
This playbook captures a production-quality screenshot: full page, lazy content loaded, cookie banners removed, retina resolution, saved as WebP.
The request
| Parameter | Why |
|---|---|
full_page=true |
Capture the whole document. |
full_page_scroll=true |
Scroll first so lazy-loaded images appear. |
remove_cookie_banners=true |
Hide consent popups. |
scale_factor=2 |
Retina output. |
format=webp, image_quality=85 |
Small files with good quality. |
cache=true |
Reuse the capture for repeated requests. |
Code
curl -G "http://localhost:4000/v1/capture" \
--data-urlencode "url=https://example.com" \
-d full_page=true -d full_page_scroll=true \
-d remove_cookie_banners=true \
-d scale_factor=2 -d format=webp -d image_quality=85 \
-d cache=true \
-H "x-api-key: $SNAPLENS_API_KEY" \
--fail-with-body -o example.webpVariations
- Mobile: add
device=iphone_14_pro(one of 18 devices). - One element:
selector=#pricinginstead offull_page. - PDF:
format=pdffor long documents. - Upload to your bucket: add the S3 parameters and
s3_url=true. - Slow page: add
is_async=trueand poll the job.
Troubleshooting
| Symptom | Fix |
|---|---|
| Blank or half-loaded page | wait_until=networkidle0 or wait_for_selector |
| Grey image placeholders | full_page_scroll=true, longer full_page_scroll_duration |
| Popup over content | remove_selectors=.popup,#modal |
| Bot challenge page | stealth=true, optionally with a proxy |
500 after 60 s |
Use is_async=true |