Features Full Page Screenshot Wait for Selector & Delay Block Cookie Banners Custom Viewport & Device Website to PDF HTML to Image Dark Mode Image Format & Quality MCP Server Webhook Pricing Docs Blog Log In Sign Up

Screenshot Options

This is the complete reference for all parameters you can pass when capturing a screenshot. Parameters work with both the sync (GET /capture) and async (POST /screenshots) endpoints. For endpoint details, see Screenshots.

Note

Some parameters are only available on certain plans. If you use a feature not included in your plan, the API returns a 422 error. See the Feature Availability table for details.

Source

Every screenshot needs a source — what to capture. You have three options: a live URL, raw HTML, or Markdown. Provide exactly one of these.

ParameterTypeDescription
urlstringThe URL to capture. Must start with http:// or https://. Max 2,048 characters.
htmlstringRaw HTML to render as a screenshot. The HTML is loaded directly in the browser — no live URL needed. Great for generating images from templates, invoices, or reports. Max 500,000 characters.
markdownstringMarkdown content to render. Converted to styled HTML automatically with clean typography and table formatting. Max 500,000 characters.

Example: Capture a URL

bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.screenshotrun.com/v1/screenshots/capture?url=https://example.com" \
  -o screenshot.png

Example: Render HTML

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots/capture \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<html><body style=\"padding:40px;font-family:sans-serif\"><h1>Hello World</h1><p>Rendered from raw HTML</p></body></html>",
    "width": 800,
    "height": 600
  }' \
  -o screenshot.png

Example: Render Markdown

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots/capture \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "markdown": "# Monthly Report\n\n## Key Metrics\n\n| Metric | Value |\n|--------|-------|\n| Users | 1,234 |\n| Revenue | $5,678 |\n\n> Data as of June 2026",
    "width": 800,
    "height": 600
  }' \
  -o report.png

Viewport & Device

Control the browser window size and device emulation. By default, screenshots use a 1280×800 desktop viewport. You can set a custom size, pick a device preset, or enable retina resolution.

ParameterTypeDefaultDescription
widthinteger1280Viewport width in pixels. Range: 320–3840.
heightinteger800Viewport height in pixels. Range: 200–2160.
devicestringdesktopDevice preset: desktop (1280×800), mobile (375×812, iPhone user-agent), or tablet (768×1024, iPad user-agent). Sets both viewport size and User-Agent string.
retinabooleanfalseCapture at 2× resolution for sharper images (Retina display). The output image will be twice the viewport dimensions.

Example: Mobile screenshot

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "device": "mobile",
    "format": "png"
  }'

Example: Custom viewport

bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.screenshotrun.com/v1/screenshots/capture?url=https://example.com&width=1920&height=1080&retina=true" \
  -o screenshot.png

Image Output

Choose the output format and control image quality. ScreenshotRun supports six formats, each suited for different use cases.

ParameterTypeDefaultDescription
formatstringpngOutput format: png, jpeg, webp, avif, tiff, or pdf.
qualityinteger80Compression quality for JPEG, WebP, and AVIF. Range: 1–100. Higher values mean better quality but larger file sizes. Has no effect on PNG or TIFF.
resize_widthintegerResize the output image to this width (16–3840). Aspect ratio is preserved. The image will not be enlarged beyond its original size.
resize_heightintegerResize the output image to this height (16–2160). Aspect ratio is preserved.
Note

When both resize_width and resize_height are provided, the image fits inside the given dimensions while maintaining aspect ratio. Resize only applies to image formats, not PDF.

Which format to choose?

  • PNG — lossless quality, best for screenshots with text and sharp edges. Larger file sizes.
  • WebP — modern format with excellent compression. 30–50% smaller than PNG at similar quality. Best all-around choice.
  • JPEG — smallest files for photographic content. May show artifacts on text and sharp edges.
  • AVIF — next-generation format with the best compression ratio. Not yet supported by all browsers.
  • TIFF — archival format for maximum quality. Very large files.
  • PDF — document format. See PDF Options below.

Example: WebP thumbnail

bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.screenshotrun.com/v1/screenshots/capture?url=https://example.com&format=webp&quality=60&resize_width=320" \
  -o thumbnail.webp

Full Page

By default, the API captures only the visible viewport (what you would see in the browser without scrolling). To capture the entire scrollable page from top to bottom, set full_page=true.

ParameterTypeDefaultDescription
full_pagebooleanfalseCapture the entire scrollable page instead of just the viewport.

Example

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "full_page": true,
    "format": "webp"
  }'

Timing & Page Loading

Some pages need extra time to load. Maybe they use JavaScript to render content (like React or Vue apps), load images lazily, or have animations that need to finish. These parameters let you control when exactly the screenshot is taken.

ParameterTypeDefaultDescription
delayinteger0Wait this many seconds after the page loads before capturing. Range: 0–10. Useful for animations or lazy-loaded images.
timeoutinteger30Maximum time in seconds to wait for the page to load. Range: 5–60. If the page doesn't load within this time, the screenshot fails with a TIMEOUT error.
wait_for_selectorstringCSS selector to wait for before capturing. The API waits until this element appears in the DOM (up to 10 seconds). Perfect for SPAs and dynamically loaded content. Max 500 characters.

Example: Wait for a chart to render

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/dashboard",
    "wait_for_selector": ".chart-container canvas",
    "delay": 1
  }'

This first waits for the chart canvas to appear, then waits an extra second for the animation to finish.

Element Selection & Interaction

Instead of capturing the full page, you can target a specific element. You can also click elements, scroll to sections, or hide distracting parts of the page before the screenshot is taken.

ParameterTypeDescription
selectorstringCSS selector of a specific element to capture. Only that element is cropped and returned. Max 500 characters.
click_selectorstringCSS selector of an element to click before capturing. Useful for dismissing modals, expanding content, or accepting cookie consent. Max 500 characters.
scroll_tostringCSS selector of an element to scroll into view before capturing. Combine with selector to capture a specific section. Max 500 characters.
hide_selectorsarrayArray of CSS selectors to hide (display: none) before capturing. Useful for removing popups, banners, or ads. Max 20 selectors.

Example: Capture a specific element

bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.screenshotrun.com/v1/screenshots/capture?url=https://example.com&selector=.hero-section" \
  -o hero.png

Example: Click before capture

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "click_selector": "#accept-cookies"
  }'

Example: Hide elements

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "hide_selectors": [".cookie-banner", "#newsletter-popup", ".ads-container"]
  }'

Example: Scroll to a section

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "scroll_to": "#pricing-section"
  }'

Blocking & Filtering

Clean up screenshots by blocking cookie banners, ads, and chat widgets. These elements often clutter screenshots and aren't relevant to the content you want to capture.

ParameterTypeDefaultDescription
block_cookiesbooleantrueBlock cookie consent banners. Blocks consent scripts (OneTrust, CookieBot, etc.), hides banner elements, and attempts to click "Accept" buttons. Enabled by default.
block_adsbooleanfalseBlock ads and trackers before capturing.
block_chatsbooleanfalseBlock chat widgets (Intercom, Crisp, Tawk, Drift, etc.) before capturing.

Example: Clean screenshot without distractions

bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.screenshotrun.com/v1/screenshots/capture?url=https://example.com&block_ads=true&block_chats=true" \
  -o clean.png

Custom Injection

Inject custom CSS or JavaScript into the page before the screenshot is taken. You can also set custom HTTP headers and cookies to access authenticated or localized content.

ParameterTypeDescription
cssstringCustom CSS injected into the page. Use it to change fonts, hide elements, or adjust layout. Max 10,000 characters.
jsstringCustom JavaScript executed on the page. Use it to modify the DOM, pause videos, fill forms, or trigger UI changes. Max 10,000 characters.
headersobjectCustom HTTP headers sent with the page request. Max 20 headers, each value max 2,048 characters. Example: {"X-Custom": "value"}
cookiesarrayCookies set before loading the page. Array of objects with name, value, and optional domain. Max 20 cookies.

Example: Inject custom CSS

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "css": "body { font-family: Arial, sans-serif; } .sidebar { display: none; } .main-content { width: 100%; }"
  }'

Example: Execute JavaScript

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "js": "document.querySelectorAll(\"video\").forEach(v => v.pause()); document.querySelector(\"#banner\")?.remove();"
  }'

Example: Custom headers and cookies

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/dashboard",
    "headers": {
      "X-Custom-Auth": "token123",
      "Accept-Language": "de-DE"
    },
    "cookies": [
      {"name": "session_id", "value": "abc123", "domain": "example.com"},
      {"name": "theme", "value": "dark"}
    ]
  }'

Browser Emulation

Control how the browser behaves when loading the page. You can emulate dark mode, set a custom User-Agent, change the timezone, fake the geolocation, or route requests through a proxy.

ParameterTypeDefaultDescription
dark_modebooleanfalseEmulate prefers-color-scheme: dark. Websites that support CSS dark mode will render in their dark theme.
reduced_motionbooleanfalseEmulate prefers-reduced-motion: reduce. Disables CSS animations and transitions for cleaner captures.
user_agentstringCustom User-Agent string. Overrides the device preset User-Agent. Max 500 characters.
stealthbooleanfalseEnable stealth mode. Hides browser automation signals (WebDriver flag, headless Chrome indicators, plugin counts, WebGL vendor) to bypass bot detection.
timezonestringIANA timezone for the browser (e.g. America/New_York, Europe/Berlin, Asia/Tokyo). Affects Date and Intl APIs on the page.
geolocationobjectEmulate browser geolocation. Object with latitude (-90 to 90), longitude (-180 to 180), and optional accuracy in meters. Business plan only.
proxystringHTTP/SOCKS proxy URL (e.g. http://user:pass@proxy:8080). A dedicated browser is launched per proxy request. Business plan only. Max 2,048 characters.

Example: Dark mode

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "full_page": true,
    "dark_mode": true,
    "format": "webp"
  }'

Example: Stealth mode

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "stealth": true
  }'

Example: Custom timezone

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/dashboard",
    "timezone": "Asia/Tokyo"
  }'

Example: Geolocation

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://maps.google.com",
    "geolocation": {
      "latitude": 48.8566,
      "longitude": 2.3522,
      "accuracy": 100
    }
  }'

Example: Proxy

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "proxy": "http://user:[email protected]:8080"
  }'

PDF Options

When format is set to pdf, you can control the page layout with these additional parameters. They only apply to PDF output.

ParameterTypeDefaultDescription
pdf_landscapebooleanfalseGenerate PDF in landscape orientation.
pdf_page_formatstringA4Page size: A3, A4, A5, Letter, Legal, or Tabloid.
pdf_margin_topstring10mmTop margin. Accepts CSS units: 10mm, 1in, 0.
pdf_margin_rightstring10mmRight margin.
pdf_margin_bottomstring10mmBottom margin.
pdf_margin_leftstring10mmLeft margin.

Example: Landscape PDF with custom margins

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/report",
    "format": "pdf",
    "pdf_landscape": true,
    "pdf_page_format": "A3",
    "pdf_margin_top": "20mm",
    "pdf_margin_bottom": "20mm",
    "pdf_margin_left": "15mm",
    "pdf_margin_right": "15mm"
  }'

Advanced

Additional parameters for specific use cases.

ParameterTypeDefaultDescription
omit_backgroundbooleanfalseCapture with transparent background. Only works with PNG and WebP formats. Useful for capturing logos or UI components without a page background.
extract_metadatabooleanfalseExtract page metadata (title, description, Open Graph tags, Twitter Card, favicon URL) and include it in the screenshot response.
cache_ttlinteger0Cache duration in seconds (0–86400). If a matching screenshot exists within this period, it is returned without re-rendering. See Caching for details.
webhook_urlstringHTTPS URL to receive a POST notification when the screenshot is ready. See Webhooks.
response_typestringvariesControls the response format. image waits and returns the binary file directly. json returns a 202 Accepted response with the screenshot object. GET /capture defaults to image; POST /screenshots defaults to json.

Example: Transparent background

bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.screenshotrun.com/v1/screenshots/capture?url=https://example.com&selector=.logo&omit_background=true&format=png" \
  -o logo.png

Example: Extract metadata

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "extract_metadata": true
  }'

Example: Synchronous response from POST

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "format": "png",
    "response_type": "image"
  }' \
  -o screenshot.png
Tip

When response_type is image, the API waits for the screenshot to complete and returns the binary file directly. No polling needed. The GET /v1/screenshots/capture endpoint uses this mode by default.