Raw schema
{
"type": "object",
"properties": {
"url": {
"type": "string",
"format": "uri",
"description": "The webpage URL to capture (a schemeless host like 'example.com' is accepted). Mutually exclusive with 'html' and 'markdown'."
},
"html": {
"type": "string",
"maxLength": 5242880,
"description": "Raw HTML to render and capture. Mutually exclusive with 'url' and 'markdown'. Great for invoices, social cards, email templates, OG images."
},
"markdown": {
"type": "string",
"maxLength": 5242880,
"description": "Markdown to render to an image or PDF. Mutually exclusive with 'url' and 'html'. The server converts it to HTML before rendering. Great for reports, release notes, README snapshots, documentation cards."
},
"format": {
"type": "string",
"enum": [
"png",
"jpeg",
"webp",
"pdf"
],
"default": "png",
"description": "Output format β png (lossless), jpeg (smaller), webp (smallest), or pdf (document). Use pdf for invoices, reports, archival."
},
"fullPage": {
"type": "boolean",
"default": false,
"description": "Capture the full scrollable page instead of just the viewport"
},
"darkMode": {
"type": "boolean",
"default": false,
"description": "Emulate dark color scheme (prefers-color-scheme: dark)"
},
"width": {
"type": "integer",
"minimum": 320,
"maximum": 3840,
"default": 1280,
"description": "Viewport width in pixels (320-3840)"
},
"height": {
"type": "integer",
"minimum": 240,
"maximum": 2160,
"default": 800,
"description": "Viewport height in pixels (240-2160)"
},
"quality": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"description": "Image quality 1-100 (JPEG/WebP only, ignored for PNG/PDF)"
},
"delay": {
"type": "integer",
"minimum": 0,
"maximum": 10000,
"default": 0,
"description": "Milliseconds to wait after page load before capture (useful for JS-rendered content)"
},
"blockAds": {
"type": "boolean",
"default": true,
"description": "Block ads and trackers before capture"
},
"blockResourceTypes": {
"type": "array",
"items": {
"type": "string",
"enum": [
"font",
"image",
"media",
"stylesheet",
"other"
]
},
"description": "Block specific resource types to speed up capture. E.g. ['font', 'image'] for text-only screenshots."
},
"deviceScaleFactor": {
"type": "number",
"minimum": 1,
"maximum": 3,
"default": 2,
"description": "Device pixel ratio (1 = standard, 2 = retina). Defaults to 2Γ Retina."
},
"device": {
"type": "string",
"enum": [
"desktop",
"iphone_15",
"iphone_se",
"pixel_8",
"ipad",
"ipad_pro"
],
"description": "Device preset that sets viewport, scale factor, and user agent in one shot. E.g. 'iphone_15' for a mobile screenshot. Overrides width/height/deviceScaleFactor/userAgent."
},
"timeout": {
"type": "integer",
"minimum": 5,
"maximum": 60,
"default": 30,
"description": "Maximum seconds to wait for page load (5-60). Cloudflare has a 60s hard cap."
},
"waitUntil": {
"type": "string",
"enum": [
"load",
"domcontentloaded",
"networkidle0",
"networkidle2"
],
"default": "networkidle2",
"description": "Page readiness event. networkidle2 (default) is best for most sites. Use domcontentloaded for speed, networkidle0 for completeness."
},
"waitForSelector": {
"type": "string",
"maxLength": 500,
"description": "CSS selector to wait for before capture. Essential for SPAs (e.g. '.main-content', '#app-loaded')"
},
"bestAttempt": {
"type": "boolean",
"default": true,
"description": "If true (default), capture whatever is rendered on timeout instead of failing. Set to false to get a hard error on timeout."
},
"selector": {
"type": "string",
"maxLength": 500,
"description": "CSS selector of a specific element to capture instead of the full page. Useful for OG images, component extraction (e.g. '#hero', '.pricing-card')"
},
"hideSelectors": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 50,
"description": "CSS selectors to hide (display:none) before capture. E.g. ['.modal', '#newsletter-popup'] to remove overlays. Max 50 selectors."
},
"blockCookieBanners": {
"type": "boolean",
"description": "Hide common cookie/consent walls (GDPR/CCPA banners) before capture. A curated selector list, lighter than custom hideSelectors."
},
"resizeWidth": {
"type": "integer",
"minimum": 16,
"maximum": 3840,
"description": "Downscale the captured image to this width in pixels (16-3840). Aspect ratio is preserved if resizeHeight is omitted. Ignored for PDF."
},
"resizeHeight": {
"type": "integer",
"minimum": 16,
"maximum": 2160,
"description": "Downscale the captured image to this height in pixels (16-2160). Aspect ratio is preserved if resizeWidth is omitted. Ignored for PDF."
},
"css": {
"type": "string",
"maxLength": 51200,
"description": "Custom CSS to inject into the page before capture. Hide cookie banners, add watermarks, override styles. Max 50KB."
},
"js": {
"type": "string",
"maxLength": 51200,
"description": "Custom JavaScript to execute in the page before capture. Runs in the browser sandbox. Max 50KB."
},
"cookies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Cookie name"
},
"value": {
"type": "string",
"description": "Cookie value"
},
"domain": {
"type": "string",
"description": "Cookie domain (must match target URL domain)"
},
"path": {
"type": "string",
"description": "Cookie path"
},
"httpOnly": {
"type": "boolean",
"description": "HTTP-only flag"
},
"secure": {
"type": "boolean",
"description": "Secure flag"
},
"sameSite": {
"type": "string",
"enum": [
"Strict",
"Lax",
"None"
],
"description": "SameSite attribute"
},
"expires": {
"type": "number",
"description": "Expiry as Unix timestamp"
}
},
"required": [
"name",
"value"
],
"additionalProperties": false
},
"maxItems": 50,
"description": "Cookies to set before capture. Useful for authenticated pages. Max 50 cookies."
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Custom HTTP headers to send with the page request. Cannot override Host, Connection, Content-Length, or Transfer-Encoding."
},
"userAgent": {
"type": "string",
"maxLength": 512,
"description": "Override the browser user agent string."
},
"pdfFormat": {
"type": "string",
"enum": [
"A4",
"Letter",
"Legal",
"Tabloid",
"A3"
],
"description": "PDF page size. Only used when format='pdf'. Default: A4"
},
"pdfLandscape": {
"type": "boolean",
"description": "PDF landscape orientation. Only used when format='pdf'."
},
"pdfPrintBackground": {
"type": "boolean",
"description": "Print background colors/images in PDF. Default: true"
},
"pdfScale": {
"type": "number",
"minimum": 0.1,
"maximum": 2,
"description": "PDF scale factor (0.1-2). Default: 1"
},
"pdfMargin": {
"type": "object",
"properties": {
"top": {
"type": "string",
"description": "Top margin (CSS value, e.g. '1cm', '20px')"
},
"right": {
"type": "string",
"description": "Right margin"
},
"bottom": {
"type": "string",
"description": "Bottom margin"
},
"left": {
"type": "string",
"description": "Left margin"
}
},
"additionalProperties": false,
"description": "PDF page margins. Only used when format='pdf'. Accepts CSS values."
},
"data": {
"type": "object",
"additionalProperties": {},
"description": "Key-value data object for Mustache templating. When provided, the 'html' or 'markdown' string is rendered as a logic-less Mustache template before capture β {{var}} inserts HTML-escaped, {{{var}}} inserts raw, {{#items}}...{{/items}} iterates arrays, {{a.b}} accesses nested fields. Not valid with 'url'. Max 256KB serialized."
},
"geo": {
"type": "string",
"minLength": 2,
"maxLength": 2,
"description": "ISO 3166-1 alpha-2 country code for geo-targeted capture (e.g., 'US', 'DE', 'JP'). Renders the page as seen from that country. Pro/Enterprise only. Note: CSS/JS injection, cookies, element capture, dark mode, and some other features are not available with geo-targeting."
},
"geoCity": {
"type": "string",
"maxLength": 100,
"description": "City for more precise geo-targeting (e.g., 'Berlin', 'New York'). Requires 'geo'."
},
"geoState": {
"type": "string",
"maxLength": 100,
"description": "State or region for more precise geo-targeting (e.g., 'California'). Requires 'geo'."
},
"expiresIn": {
"type": "integer",
"minimum": 60,
"maximum": 2592000,
"description": "Seconds until the signed URL expires (60β2592000). Defaults to the server's TTL."
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}