{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scrapenest-dev/json-schema/scrapenest-dev-screenshot-request-schema.json",
  "title": "ScreenshotRequest",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scrapenest-dev-openapi.json#/components/schemas/ScreenshotRequest",
  "properties": {
    "url": {
      "type": "string",
      "minLength": 1,
      "format": "uri",
      "title": "Url",
      "description": "Absolute http(s) URL to capture."
    },
    "viewport_width": {
      "type": "integer",
      "maximum": 3840.0,
      "minimum": 320.0,
      "title": "Viewport Width",
      "description": "Browser viewport width in CSS pixels.",
      "default": 1280
    },
    "viewport_height": {
      "type": "integer",
      "maximum": 2160.0,
      "minimum": 240.0,
      "title": "Viewport Height",
      "description": "Browser viewport height in CSS pixels.",
      "default": 720
    },
    "device_scale_factor": {
      "type": "number",
      "maximum": 3.0,
      "minimum": 1.0,
      "title": "Device Scale Factor",
      "description": "Pixel ratio of the image: 1 (default) returns exactly viewport_width x viewport_height pixels (or the full page at that width), 2 returns twice that in each dimension. Billed the same.",
      "default": 1.0
    },
    "full_page": {
      "type": "boolean",
      "title": "Full Page",
      "description": "If true, captures the entire scrollable page height instead of just the viewport.",
      "default": false
    },
    "selector": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 300
        },
        {
          "type": "null"
        }
      ],
      "title": "Selector",
      "description": "CSS selector. When set, captures only the bounding box of the first matching element (e.g. '#hero', '.product-card:first-child'). Overrides full_page. If the selector matches nothing, the capture is the full viewport at the requested tier and price (selector_applied=false); a stealth capture never crops to the selector. Returns 422 selector_not_found only when nothing can be rendered."
    },
    "render": {
      "type": "string",
      "enum": [
        "auto",
        "browser",
        "stealth"
      ],
      "title": "Render",
      "description": "`auto` lets the platform pick the right backend. `browser` forces the standard headless browser. `stealth` forces the anti-bot evasion backend for hardened targets (slower, billed at the stealth rate).",
      "default": "auto"
    },
    "format": {
      "type": "string",
      "enum": [
        "png",
        "jpeg"
      ],
      "title": "Format",
      "description": "Image encoding.",
      "default": "png"
    },
    "jpeg_quality": {
      "type": "integer",
      "maximum": 100.0,
      "minimum": 1.0,
      "title": "Jpeg Quality",
      "description": "JPEG quality 1-100; ignored when format=png.",
      "default": 85
    },
    "wait_extra_ms": {
      "type": "integer",
      "maximum": 10000.0,
      "minimum": 0.0,
      "title": "Wait Extra Ms",
      "description": "Additional wait after page load before capture, for late-loading content (e.g. SPAs with delayed content).",
      "default": 0
    },
    "cache_ttl_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 86400.0,
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Cache Ttl Seconds",
      "description": "Override the cache TTL for this screenshot. Defaults to off; set non-zero to dedupe repeat captures. A request that sends cookies, headers or session_id is never cached."
    },
    "cookies": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "maxProperties": 50
        },
        {
          "type": "null"
        }
      ],
      "title": "Cookies",
      "description": "Cookies to attach to the request, as a {name: value} mapping. Useful for screenshotting authenticated pages. Names must be HTTP tokens; values may not contain control characters or ';'. Anything else is refused with 422 validation_error."
    },
    "headers": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "maxProperties": 30
        },
        {
          "type": "null"
        }
      ],
      "title": "Headers",
      "description": "Extra HTTP request headers to send (e.g. User-Agent, Referer). Host/Content-Length are ignored. Max 30. Names must be HTTP tokens and values may not contain control characters other than tab; anything else is refused with 422 validation_error."
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 64,
          "pattern": "^[A-Za-z0-9_.\\-]+$"
        },
        {
          "type": "null"
        }
      ],
      "title": "Session Id",
      "description": "Reuse a sticky exit IP across requests (10-minute window). Useful when the target site personalizes by IP and you want the screenshot to match a previous /v1/scrape/url session."
    },
    "include_usage": {
      "type": "boolean",
      "title": "Include Usage",
      "description": "If true, include a `usage` block in the response with credit totals.",
      "default": false
    }
  },
  "type": "object",
  "required": [
    "url"
  ]
}