Skip to main content
GET
/
screenshot
Take a screenshot
curl --request GET \
  --url https://api.prefetch.io/screenshot \
  --header 'X-API-Key: <api-key>'
{
  "success": true,
  "data": {
    "url": "https://stripe.com",
    "screenshot_url": "https://assets.prefetch.io/screenshots/stripe-1440x900.jpg",
    "viewport": {
      "width": 1440,
      "height": 900
    },
    "format": "jpeg",
    "full_page": false,
    "captured_at": "2026-03-19T14:22:05.000Z"
  },
  "meta": {
    "requestId": "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
    "durationMs": 2540
  }
}

Documentation Index

Fetch the complete documentation index at: https://prefetch.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Overview

/screenshot opens a URL in a headless Chrome browser and captures a screenshot. The image is stored in cloud storage and a public URL is returned. You can configure:
  • Viewport size — width and height of the browser window
  • Full page — capture the entire scrollable content instead of just the viewport
  • Format — JPEG (smaller), PNG (lossless), or WebP (best compression)

Example requests

curl "https://api.prefetch.io/screenshot?url=https://stripe.com" \
  -H "X-API-Key: $PREFETCH_API_KEY"

Example response

{
  "success": true,
  "data": {
    "url": "https://stripe.com",
    "screenshot_url": "https://assets.prefetch.io/screenshots/stripe-1440x900-abc123.jpg",
    "viewport": {
      "width": 1440,
      "height": 900
    },
    "format": "jpeg",
    "full_page": false,
    "captured_at": "2026-03-19T14:22:05.000Z"
  },
  "meta": {
    "requestId": "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
    "durationMs": 2540
  }
}

Format comparison

FormatBest forNotes
jpegGeneral use, thumbnailsSmallest file size, lossy compression
pngLogos, UI elements, transparencyLossless, larger files
webpWeb displayBest compression-to-quality ratio

Parameter limits

ParameterDefaultMinMax
width14403205000
height9003205000
formatjpeg
full_pagefalse

Authorizations

X-API-Key
string
header
required

Your Prefetch API key. Obtain one from the dashboard.

Query Parameters

url
string
required

The website URL to process. http:// is prepended automatically if no protocol is provided. Maximum 2048 characters.

Example:

"https://stripe.com"

width
integer
default:1440

Viewport width in pixels. Range: 320–5000. Default: 1440.

Required range: 320 <= x <= 5000
height
integer
default:900

Viewport height in pixels. Range: 320–5000. Default: 900.

Required range: 320 <= x <= 5000
format
enum<string>
default:jpeg

Image format. Default: jpeg.

Available options:
jpeg,
png,
webp
full_page
boolean
default:false

Capture full scrollable page height. Default: false.

Response

Screenshot result.

success
enum<boolean>
required
Available options:
true
data
object
required
meta
object
required