ScreenshotAPI

Full-Page Captures

Capture entire web pages including below-the-fold content with full-page screenshots.

Overview

Full-page screenshots capture the entire scrollable content of a web page as a single, tall image. This is useful for archiving pages, generating PDFs, visual regression testing, and creating long-form page previews.

When fullPage=true is set, ScreenshotAPI scrolls the entire page and stitches the result into one image. The height parameter is ignored — the screenshot height matches the page's full scroll height.

Basic Full-Page Capture

curl "https://screenshotapi.to/api/v1/screenshot?url=https://example.com&fullPage=true" \
  -H "x-api-key: $SCREENSHOTAPI_KEY" \
  --output fullpage.png
const params = new URLSearchParams({
  url: 'https://example.com',
  fullPage: 'true'
})

const response = await fetch(
  `https://screenshotapi.to/api/v1/screenshot?${params}`,
  { headers: { 'x-api-key': process.env.SCREENSHOTAPI_KEY! } }
)

const buffer = Buffer.from(await response.arrayBuffer())
await fs.promises.writeFile('fullpage.png', buffer)
import requests

response = requests.get(
    "https://screenshotapi.to/api/v1/screenshot",
    params={"url": "https://example.com", "fullPage": "true"},
    headers={"x-api-key": os.environ["SCREENSHOTAPI_KEY"]}
)

with open("fullpage.png", "wb") as f:
    f.write(response.content)
req, _ := http.NewRequest("GET",
    "https://screenshotapi.to/api/v1/screenshot?url=https://example.com&fullPage=true", nil)
req.Header.Set("x-api-key", os.Getenv("SCREENSHOTAPI_KEY"))

resp, err := http.DefaultClient.Do(req)
if err != nil {
    log.Fatal(err)
}
defer resp.Body.Close()

file, _ := os.Create("fullpage.png")
defer file.Close()
io.Copy(file, resp.Body)
require "net/http"
require "uri"

uri = URI("https://screenshotapi.to/api/v1/screenshot?url=https://example.com&fullPage=true")
req = Net::HTTP::Get.new(uri)
req["x-api-key"] = ENV["SCREENSHOTAPI_KEY"]

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http|
  http.request(req)
}

File.binwrite("fullpage.png", response.body)
$ch = curl_init();
curl_setopt_array($ch, [
    CURLOPT_URL => "https://screenshotapi.to/api/v1/screenshot?url=https://example.com&fullPage=true",
    CURLOPT_HTTPHEADER => ["x-api-key: " . getenv("SCREENSHOTAPI_KEY")],
    CURLOPT_RETURNTRANSFER => true,
]);

$image = curl_exec($ch);
curl_close($ch);
file_put_contents("fullpage.png", $image);

File Size Optimization

Full-page screenshots can produce large files, especially for long pages. Use these strategies to reduce file size:

Use WebP format

WebP typically produces 30–50% smaller files than PNG with minimal quality loss:

curl "https://screenshotapi.to/api/v1/screenshot?url=https://example.com&fullPage=true&type=webp&quality=85" \
  -H "x-api-key: $SCREENSHOTAPI_KEY" \
  --output fullpage.webp

Use JPEG for photographic content

If the page is mostly photos (not text/UI), JPEG can be even smaller:

curl "https://screenshotapi.to/api/v1/screenshot?url=https://example.com&fullPage=true&type=jpeg&quality=80" \
  -H "x-api-key: $SCREENSHOTAPI_KEY" \
  --output fullpage.jpg

Reduce viewport width

A narrower viewport produces a proportionally smaller image:

curl "https://screenshotapi.to/api/v1/screenshot?url=https://example.com&fullPage=true&width=800&type=webp&quality=85" \
  -H "x-api-key: $SCREENSHOTAPI_KEY" \
  --output fullpage-narrow.webp

Handling Lazy-Loaded Content

Many modern websites lazy-load images and content as the user scrolls. ScreenshotAPI handles this automatically in full-page mode by scrolling through the page before capturing. However, some sites may need additional waiting:

Wait for network idle

curl "https://screenshotapi.to/api/v1/screenshot?\
url=https://example.com&\
fullPage=true&\
waitUntil=networkidle0" \
  -H "x-api-key: $SCREENSHOTAPI_KEY" \
  --output fullpage.png

Add a delay for animations

curl "https://screenshotapi.to/api/v1/screenshot?\
url=https://example.com&\
fullPage=true&\
waitUntil=networkidle2&\
delay=2000" \
  -H "x-api-key: $SCREENSHOTAPI_KEY" \
  --output fullpage.png

Common Use Cases

Web Page Archival

Archive a full page for compliance or records:

async function archivePage(url: string, archiveDir: string) {
  const params = new URLSearchParams({
    url,
    fullPage: 'true',
    type: 'png',
    width: '1440'
  })

  const response = await fetch(
    `https://screenshotapi.to/api/v1/screenshot?${params}`,
    { headers: { 'x-api-key': process.env.SCREENSHOTAPI_KEY! } }
  )

  const buffer = Buffer.from(await response.arrayBuffer())
  const timestamp = new Date().toISOString().replace(/[:.]/g, '-')
  const filename = `${archiveDir}/archive-${timestamp}.png`

  await fs.promises.writeFile(filename, buffer)
  return filename
}

Visual Regression Testing

Capture full-page screenshots for comparison in CI:

import { existsSync } from 'node:fs'
import { readFile, writeFile } from 'node:fs/promises'

async function captureBaseline(url: string, name: string) {
  const params = new URLSearchParams({
    url,
    fullPage: 'true',
    width: '1440',
    type: 'png'
  })

  const response = await fetch(
    `https://screenshotapi.to/api/v1/screenshot?${params}`,
    { headers: { 'x-api-key': process.env.SCREENSHOTAPI_KEY! } }
  )

  const buffer = Buffer.from(await response.arrayBuffer())
  await writeFile(`__screenshots__/${name}.png`, buffer)
}

// In your CI pipeline:
// 1. Capture screenshots after deploy
// 2. Compare with baseline using pixelmatch or similar
// 3. Flag visual regressions for review

PDF Export

ScreenshotAPI supports native PDF export via the type=pdf parameter. This produces a real PDF document (not a screenshot wrapped in a PDF) with selectable text, working links, and proper page layout:

curl "https://screenshotapi.to/api/v1/screenshot?url=https://example.com&type=pdf" \
  -H "x-api-key: $SCREENSHOTAPI_KEY" \
  --output page.pdf
const params = new URLSearchParams({
  url: 'https://example.com',
  type: 'pdf'
})

const response = await fetch(
  `https://screenshotapi.to/api/v1/screenshot?${params}`,
  { headers: { 'x-api-key': process.env.SCREENSHOTAPI_KEY! } }
)

const buffer = Buffer.from(await response.arrayBuffer())
await fs.promises.writeFile('page.pdf', buffer)

PDF export uses 1 credit per request, just like image screenshots. The fullPage, width, and delay parameters work with PDF output. The quality parameter is ignored for PDFs.

Limitations

Full-page screenshots have a maximum height of 10,000 pixels. Pages taller than this will be truncated. For extremely long pages, consider capturing specific sections using viewport-based screenshots with scroll offsets.

  • Sticky/fixed elements — Headers and footers with position: fixed will appear once at their natural position, not repeated throughout the image.
  • Infinite scroll pages — Pages that load content endlessly (like social media feeds) will capture whatever has loaded at the time of capture. Add a delay to allow more content to load.
  • Very tall pages — Pages with thousands of pixels of scroll height may take longer to capture and produce very large files.

On this page