Screenshot API
Endpoint
POST /v1/screenshot
Parameters
| Parameter | Type | Default | Description |
|---|
url | string | — | URL to capture (must be a valid URL) |
html | string | — | Raw HTML to render (max 5MB) |
| Parameter | Type | Default | Description |
|---|
format | "png" | "jpeg" | "webp" | "png" | Image format |
quality | number (1-100) | 80 | Image quality (JPEG/WebP only) |
response_type | "binary" | "base64" | "url" | "binary" | Response format |
Viewport
| Parameter | Type | Default | Description |
|---|
viewport.width | number (320-3840) | 1920 | Viewport width in pixels |
viewport.height | number (240-2160) | 1080 | Viewport height in pixels |
viewport.device_scale_factor | number (1-3) | 1 | Device pixel ratio |
device | "desktop" | "mobile" | "tablet" | — | Device preset (overrides viewport) |
full_page | boolean | false | Capture the full scrollable page |
Device Presets
| Preset | Width | Height | Scale |
|---|
desktop | 1920 | 1080 | 1x |
mobile | 390 | 844 | 2x |
tablet | 768 | 1024 | 2x |
Wait Strategies
| Parameter | Type | Default | Description |
|---|
wait_for | "load" | "networkidle" | "selector" | "load" | When to capture |
wait_selector | string | — | CSS selector to wait for (required if wait_for is "selector") |
wait_timeout | number (1000-30000) | 30000 | Timeout in milliseconds |
delay_ms | number (0-10000) | 0 | Additional delay after wait condition |
Clipping
| Parameter | Type | Default | Description |
|---|
clip.x | number | — | X offset in pixels |
clip.y | number | — | Y offset in pixels |
clip.width | number | — | Width in pixels |
clip.height | number | — | Height in pixels |
Page Modifications
| Parameter | Type | Default | Description |
|---|
dark_mode | boolean | false | Emulate dark color scheme |
block_ads | boolean | false | Block common ad networks |
block_cookie_banners | boolean | false | Hide cookie consent banners |
hide_selectors | string[] | [] | CSS selectors to hide (max 20) |
custom_css | string | — | CSS to inject (max 50KB) |
custom_js | string | — | JavaScript to execute (max 50KB) |
Caching
| Parameter | Type | Default | Description |
|---|
cache_ttl | number (0-604800) | 86400 | Cache duration in seconds (max 7 days) |
no_cache | boolean | false | Skip cache for this request |
Response
Binary (default)
Returns the image directly with appropriate Content-Type header.
Base64
{
"success": true,
"data": {
"base64": "iVBORw0KGgo...",
"format": "png",
"width": 1920,
"height": 1080,
"size_bytes": 245000,
"cached": false,
"render_time_ms": 1250
},
"request_id": "req_abc123"
}
URL
{
"success": true,
"data": {
"url": "https://api.rendershot.dev/files/abc-123-def",
"format": "png",
"width": 1920,
"height": 1080,
"size_bytes": 245000,
"cached": false,
"render_time_ms": 1250
},
"request_id": "req_abc123"
}
| Header | Description |
|---|
X-Request-Id | Unique request identifier |
X-Cache | HIT or MISS |
X-Render-Time | Render time in milliseconds |
X-RateLimit-Limit | Requests per minute allowed |
X-RateLimit-Remaining | Requests remaining this minute |
X-Credits-Used | Credits used this month |
X-Credits-Remaining | Credits remaining this month |