#What the Screenshot API does
The Screenshot API turns any URL or HTML into a high-quality image or PDF. It handles viewport emulation, device presets, ad/cookie blocking, CSS/JS injection, watermarks, and more — so you don't have to manage browser infrastructure yourself.
- 20+ device presets — iPhone, iPad, Pixel, Galaxy, MacBook, desktop resolutions.
- Sync & async modes — get results immediately or queue jobs and poll for status.
- Visual monitoring — schedule captures and get email alerts when pages change visually.
- Webhooks — receive POST notifications when async jobs complete.
#Endpoints & actions
| Endpoint | Description |
|---|---|
capture | URL screenshot (PNG/JPG/WebP) with device emulation, blocking, watermarks. |
capture-html | Render custom HTML as an image. |
capture-pdf | Generate PDF from URL or HTML with page settings. |
bulk | Capture multiple URLs (up to 50) in one request. |
schedule-* | Create/update/delete/list/run scheduled captures. |
diff | Pixel-level visual comparison between two screenshots. |
metrics | Core Web Vitals (LCP, FCP, CLS, TTI). |
status / download | Check job status or download the output file. |
devices | List all available device presets. |
#Quick start examples
#Basic screenshot
curl -s -X POST "https://captions.yeb.to/v1/screenshot/capture" \
-H "X-API-Key: YOUR_KEY" \
-d "url=https://example.com&format=png"
#Mobile device screenshot
curl -s -X POST "https://captions.yeb.to/v1/screenshot/capture" \
-H "X-API-Key: YOUR_KEY" \
-d "url=https://example.com&device=iphone-15&full_page=true"
#Clean capture with blocking
curl -s -X POST "https://captions.yeb.to/v1/screenshot/capture" \
-H "X-API-Key: YOUR_KEY" \
-d "url=https://news-site.com&block_ads=true&block_cookie_banners=true&block_chat_widgets=true&block_tracking=true"
#Async capture with webhook
curl -s -X POST "https://captions.yeb.to/v1/screenshot/capture" \
-H "X-API-Key: YOUR_KEY" \
-d "url=https://example.com&async=true&webhook_url=https://yoursite.com/webhook"
# Response: {"success":true,"job_id":12345,"status":"queued"}
# Your webhook will receive a POST when the job completes.
#Key parameters explained
#Viewport & device
viewport_width/viewport_height— Set exact dimensions (320-3840 x 200-2160).device— Use a preset likeiphone-15to auto-set viewport, pixel density, and user agent. Overrides manual viewport settings.full_page— Capture the entire scrollable page, not just the visible viewport. Adds 0.03 credits.retina— Render at 2x pixel density for sharp images. Adds 0.03 credits.
#Blocking options
block_ads— Blocks requests to known ad networks (Google Ads, DoubleClick, etc.).block_cookie_banners— Removes common cookie consent overlays (OneTrust, CookieBot, etc.).block_chat_widgets— Hides Intercom, Drift, Zendesk, and other chat widgets.block_tracking— Blocks analytics and tracking scripts (Google Analytics, Facebook Pixel, etc.).
#Element targeting
selector— Capture only a specific CSS element (e.g.#hero-section).click_selectors— Click elements before capture (accept cookies, close popups).blur_selectors— Apply CSS blur to sensitive content.remove_selectors— Remove elements entirely from the DOM.
#Output format
- Images:
png(default, lossless),jpg(smaller),webp(best compression). - Documents:
pdf— with page format, orientation, margins, headers/footers. quality— 1-100 for JPG/WebP (default: 80). Higher = larger file, better quality.thumbnail_width— Auto-generate a thumbnail (50-800px wide).
#Async mode & webhooks
For heavy operations (bulk jobs, PDF generation), use async=true to queue the job.
You have two options to get the result:
- Polling: Call
/statuswith thejob_idevery 2-5 seconds untilstatusiscompletedorfailed. - Webhook: Set
webhook_urland your server will receive a POST with the full result when the job finishes. Includes retry logic (3 attempts).
// Webhook payload example
{
"event": "screenshot.completed",
"job_id": 12345,
"status": "completed",
"url": "https://cdn.yeb.to/.../screenshot.png",
"file_size": 245678,
"timestamp": "2026-02-06T12:00:03Z"
}
#Bulk screenshot processing
Send up to 50 URLs in a single /bulk request. Each URL can have individual
settings, plus you can set default_settings applied to all. URLs are processed in parallel.
curl -s -X POST "https://captions.yeb.to/v1/screenshot/bulk" \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"urls": [
{"url": "https://site1.com", "device": "iphone-15"},
{"url": "https://site2.com", "format": "jpg", "quality": 90},
{"url": "https://site3.com"}
],
"default_settings": {
"block_ads": true,
"full_page": true
}
}'
#Scheduled captures & visual monitoring
Create automated schedules to capture pages at any frequency. Enable change detection to compare each capture with the previous one. When the visual difference exceeds your threshold, you get an email alert.
curl -s -X POST "https://captions.yeb.to/v1/screenshot/schedule-create" \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Daily Homepage Check",
"url": "https://mysite.com",
"cron_expression": "daily",
"timezone": "Europe/Sofia",
"detect_changes": true,
"change_threshold": 5.0,
"notify_on_change": true,
"notify_email": "[email protected]",
"screenshot_settings": {
"full_page": true,
"block_ads": true
}
}'
#Visual diff comparison
Compare any two completed screenshot jobs. The API generates a diff image highlighting changed pixels in red, and returns the difference percentage and bounding boxes of changed regions.
difference_percent— 0.00 means identical, 100.00 means completely different.diff_regions— Array of{x, y, width, height}bounding boxes for changed areas.diff_image_url— A PNG overlay showing changes in red against a dimmed background.
#Credit pricing breakdown
Each action has a base credit cost. Modifiers like full_page, retina, and 4K viewports
add to the base. Check the endpoint documentation for exact pricing. Status, device list, and schedule list
endpoints are free.
#Troubleshooting & tips
- Timeouts: Increase
timeout_msfor slow pages (max 60000). Usedelay_msto wait for lazy-loaded content. - Blank screenshots: Some SPAs need
delay_ms=2000or more. Trylazy_load=truefor infinite scroll pages. - Cookie walls: Use
click_selectors=["#accept-cookies"]to auto-accept consent dialogs before capture. - Large pages: Full-page captures of very long pages may take 10+ seconds. Use
async=truefor reliability. - Watermarks: Add text watermarks via the
watermarkparameter with custom position and opacity. - Rate limits: Default burst is 10 req/s. For bulk operations, use the
/bulkendpoint instead of parallel single requests.
#API Changelog
capture, capture-html,
capture-pdf, bulk, schedule,
diff, metrics,
status, download, and devices endpoints.