# Full-page, mobile, PDF, and video screenshot recipes

Practical ScreenshotEngine requests for full-page and mobile screenshots, CSS elements, dark mode, cookie banners, PDF, WebM video, and watermarks.

Source: https://www.screenshotengine.com/docs/capture-recipes

## Capture a full-page screenshot

Set height to "full" to capture beyond the initial viewport. The engine scrolls the page before capture to trigger scroll-based content. Sites with infinite scrolling or content loaded after long delays may need additional handling.

```bash
curl --fail-with-body --request POST 'https://api.screenshotengine.com/v1/screenshot' \
  --header "Authorization: Bearer $SCREENSHOTENGINE_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "https://example.com",
  "format": "png",
  "height": "full"
}' \
  --output screenshot.png
```

## Capture a mobile viewport

Set viewportDevice to a supported preset, such as iphone-15-pro. This sets the viewport to 393 × 852 CSS pixels. It does not switch to Safari or simulate a physical iPhone. For a full-page mobile image, use width: 393 and height: "full" without viewportDevice.

```bash
curl --fail-with-body --request POST 'https://api.screenshotengine.com/v1/screenshot' \
  --header "Authorization: Bearer $SCREENSHOTENGINE_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "https://example.com",
  "format": "png",
  "viewportDevice": "iphone-15-pro"
}' \
  --output mobile.png
```

## Capture a specific element

Set selector to a CSS selector. ScreenshotEngine waits for the first matching element to be attached and scrolls it into view. Use a selector that exists on the target page, such as h1 on example.com. An absent or non-visible element can cause the capture to fail.

```bash
curl --fail-with-body --request POST 'https://api.screenshotengine.com/v1/screenshot' \
  --header "Authorization: Bearer $SCREENSHOTENGINE_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "https://example.com",
  "format": "png",
  "selector": "h1",
  "waitFor": 1000
}' \
  --output element.png
```

## Request dark mode and remove cookie banners

darkMode asks the website to use its dark color scheme; the website must support that preference. blockBanners attempts to dismiss or remove cookie consent UI. These options do not guarantee every site changes theme or removes every banner.

waitFor adds a delay after page load. Use a small value for client-rendered content; increasing it also increases request duration.

```bash
curl --fail-with-body --request POST 'https://api.screenshotengine.com/v1/screenshot' \
  --header "Authorization: Bearer $SCREENSHOTENGINE_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "https://example.com",
  "format": "png",
  "darkMode": true,
  "blockBanners": true,
  "waitFor": 1500
}' \
  --output dark.png
```

## Convert a webpage URL to PDF

Set output to pdf and use pdfSettings for paper size and orientation. PDF output uses the page’s print styling with background graphics enabled. It may look different from a screenshot. The endpoint takes a URL; it does not accept raw HTML.

A4 portrait is the default. Omit watermark for PDF output. The format option only affects images.

```bash
curl --fail-with-body --request POST 'https://api.screenshotengine.com/v1/screenshot' \
  --header "Authorization: Bearer $SCREENSHOTENGINE_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "https://example.com",
  "output": "pdf",
  "pdfSettings": {
    "paperSize": "A4",
    "orientation": "portrait"
  }
}' \
  --output page.pdf
```

## Record a scrolling website video

Set output to scrolling_video to return a WebM file. Use a numeric height for the video viewport. Save the response as .webm; format does not convert video to PNG, GIF, or MP4. Watermarks are not applied to video output.

```bash
curl --fail-with-body --request POST 'https://api.screenshotengine.com/v1/screenshot' \
  --header "Authorization: Bearer $SCREENSHOTENGINE_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "https://example.com",
  "output": "scrolling_video",
  "width": 1280,
  "height": 720
}' \
  --output website.webm
```

## Add a text watermark to an image

Send a watermark object in a POST body. Use one of the supported named colors, with the exact capitalization shown. The example places white text on a black background in the bottom-right corner.

```bash
curl --fail-with-body --request POST 'https://api.screenshotengine.com/v1/screenshot' \
  --header "Authorization: Bearer $SCREENSHOTENGINE_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "https://example.com",
  "format": "png",
  "watermark": {
    "text": "Captured with ScreenshotEngine",
    "position": "bottom-right",
    "textColor": "White",
    "backgroundColor": "Black"
  }
}' \
  --output watermarked.png
```