{
  "openapi": "3.0.1",
  "info": {
    "title": "Website Screenshot Scraper – Screenshot API, JPEG, URL to PDF",
    "description": "Website screenshot API to capture any public URL as JPEG, PNG or PDF — device presets, element capture, open graph image sizing, url to pdf and html to pdf rendering, plus raw HTML input. Full page screenshot, proxy, and viewport capture supported. Visual diff and screenshot comparison supported.",
    "version": "0.1",
    "x-build-id": "Ag5CVjFniwNXThHed"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fetchsmith~website-screenshot-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fetchsmith-website-screenshot-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/fetchsmith~website-screenshot-scraper/runs": {
      "post": {
        "operationId": "runs-sync-fetchsmith-website-screenshot-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/fetchsmith~website-screenshot-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-fetchsmith-website-screenshot-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "urls": {
            "title": "URLs",
            "type": "array",
            "description": "Public web pages to screenshot, e.g. https://example.com. Each becomes one charged result row (or one error row on failure, never both).",
            "default": [
              "https://example.com"
            ],
            "items": {
              "type": "string"
            }
          },
          "html": {
            "title": "Raw HTML (optional, single input)",
            "type": "string",
            "description": "Instead of fetching a URL, render this raw HTML string directly (e.g. an email template or OG-card markup you built yourself). If set, 'URLs' is ignored and this produces exactly one result row."
          },
          "format": {
            "title": "Output format",
            "enum": [
              "jpeg",
              "png",
              "pdf"
            ],
            "type": "string",
            "description": "JPEG is smaller than PNG for the same page with no visible quality loss at quality ~80 -- measured 15% smaller on a text-heavy page, 63% smaller on a photo-heavy one. Use PNG only if you need pixel-exact/lossless output, or PDF for a printable document.",
            "default": "jpeg"
          },
          "quality": {
            "title": "JPEG quality",
            "minimum": 10,
            "maximum": 100,
            "type": "integer",
            "description": "Ignored for PNG and PDF.",
            "default": 80
          },
          "fullPage": {
            "title": "Full page (not just the first screen)",
            "type": "boolean",
            "description": "Capture the entire scrollable page height, not just the visible viewport. Ignored for PDF, which is always full-document.",
            "default": true
          },
          "devicePreset": {
            "title": "Device preset",
            "enum": [
              "custom",
              "desktop",
              "iphone",
              "pixel",
              "ipad"
            ],
            "type": "string",
            "description": "Emulate a common device's viewport, pixel ratio and user agent. 'Custom' uses the Viewport width/height fields below instead.",
            "default": "desktop"
          },
          "viewportWidth": {
            "title": "Viewport width (custom preset only)",
            "minimum": 200,
            "maximum": 3840,
            "type": "integer",
            "description": "Browser viewport width in pixels. Only used when Device preset is 'custom'.",
            "default": 1920
          },
          "viewportHeight": {
            "title": "Viewport height (custom preset only)",
            "minimum": 200,
            "maximum": 3840,
            "type": "integer",
            "description": "Browser viewport height in pixels. Only used when Device preset is 'custom'.",
            "default": 1080
          },
          "selector": {
            "title": "Element selector (optional)",
            "type": "string",
            "description": "CSS selector of a single element to capture instead of the whole page, e.g. '#pricing-table' or '.hero'. Takes priority over Full page."
          },
          "ogCard": {
            "title": "Render as Open Graph card (1200x630)",
            "type": "boolean",
            "description": "Force a 1200x630 viewport screenshot sized for social-share previews, ignoring other viewport/fullPage settings.",
            "default": false
          },
          "waitUntil": {
            "title": "Wait condition before capture",
            "enum": [
              "load",
              "domcontentloaded",
              "networkidle"
            ],
            "type": "string",
            "description": "When to consider the page ready to capture.",
            "default": "load"
          },
          "delayMs": {
            "title": "Extra delay before capture (ms)",
            "minimum": 0,
            "maximum": 15000,
            "type": "integer",
            "description": "Wait this long after the page load condition is met, e.g. to let an animation or lazy-loaded image settle.",
            "default": 0
          },
          "waitForSelector": {
            "title": "Wait for element (optional, CSS selector)",
            "type": "string",
            "description": "Before capturing, wait up to 10s for this CSS selector to become visible, e.g. '.chart-loaded' or '#app-root img'. More reliable than 'Network idle' for SPAs that keep a background connection open after the content you actually want has rendered. If the selector never appears, the run returns an error row for that URL instead of a blank/partial capture."
          },
          "compareUrl": {
            "title": "Compare against this URL (optional — turns on visual diff mode)",
            "type": "string",
            "description": "Leave empty for normal screenshots. Set it to turn each URL above into a visual-diff/regression check: the Actor captures your URL and this one, pixel-diffs them, and returns the change percentage plus a highlighted diff image. Typical use: staging vs production, or a saved page vs its live version after a deploy. Compare mode always captures PNG (a lossy JPEG would invent differences that are not there), ignores the raw HTML input, and charges ONE event per comparison row even though it takes two captures."
          },
          "diffThreshold": {
            "title": "Diff sensitivity (compare mode only)",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Per-pixel colour-distance tolerance from 0 to 1. Lower is stricter: 0.02 flags faint antialiasing and font-rendering shifts, the 0.1 default ignores them but catches any real visual change, 0.3+ only flags large blocks of colour. Only used when a compare URL is set.",
            "default": 0.1
          },
          "diffRegionMinPixels": {
            "title": "Minimum region size in pixels (compare mode only)",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "How big a connected blob of changed pixels must be to count as one changed REGION in `diffRegions`. The default of 4 ignores isolated 1-3 pixel antialiasing speckle, which is what makes a raw diff percentage hard to act on: 'one 4% block moved' and '400 stray pixels all over the page' can produce the same percentage but very different region counts. Raise it to ignore larger cosmetic churn, or set it to 1 to count every blob. Blobs below the floor are reported separately as `diffSpecks`. Only used when a compare URL is set.",
            "default": 4
          },
          "colorScheme": {
            "title": "Color scheme",
            "enum": [
              "light",
              "dark",
              "no-preference"
            ],
            "type": "string",
            "description": "Emulate the browser's light/dark mode preference before capturing, so a page that reacts to `prefers-color-scheme` renders its dark variant instead of light.",
            "default": "light"
          },
          "hasTouch": {
            "title": "Touch support (optional override)",
            "type": "boolean",
            "description": "Whether the emulated device reports touch support. Leave unset to use the device preset's default (on for iPhone/Pixel/iPad, off for desktop/custom) or override it either way."
          },
          "locale": {
            "title": "Locale (optional)",
            "type": "string",
            "description": "BCP 47 locale to emulate, e.g. 'fr-FR' or 'ja-JP'. Affects `navigator.language`, number/date formatting, and any page content that branches on locale."
          },
          "timezoneId": {
            "title": "Timezone (optional)",
            "type": "string",
            "description": "IANA timezone to emulate, e.g. 'America/New_York' or 'Asia/Tokyo'. Affects any page content that renders times/dates in the visitor's local timezone."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Route the browser through a proxy. Off by default (captures come straight from the Apify datacenter, which is fine for most public pages). Turn it on when a target rate-limits repeated hits from one IP across a big URL list, or serves different content per country. A fresh proxy IP is drawn per URL, so a 100-URL list is spread across the pool instead of hammering one address; in compare mode BOTH captures of a pair deliberately share one IP, so a geo/IP difference can never show up as a false visual diff. You can also paste your own proxy URLs instead of using Apify Proxy.",
            "default": {
              "useApifyProxy": false
            }
          },
          "headers": {
            "title": "Extra HTTP headers (optional)",
            "type": "object",
            "description": "Custom headers sent with every request, e.g. {\"Authorization\": \"Bearer ...\", \"X-Api-Key\": \"...\"}. For reaching your own API-key-gated page or internal tool -- not for bypassing access controls on a site you don't have permission to access."
          },
          "cookies": {
            "title": "Cookies (optional)",
            "type": "array",
            "description": "Send your own session cookies so the browser loads a page the way you'd see it logged in, e.g. [{\"name\": \"session\", \"value\": \"...\"}]. Each entry needs \"name\" and \"value\"; add \"domain\"/\"path\" to scope a cookie to a specific host, otherwise it's scoped to the URL being captured. For pages you already have a legitimate login/session for -- this does not log in or bypass a paywall on your behalf."
          },
          "geolocation": {
            "title": "Geolocation (optional)",
            "type": "object",
            "description": "Emulate the browser GPS location, e.g. {\"latitude\": 48.8566, \"longitude\": 2.3522, \"accuracy\": 10}. Only takes effect on pages that call the Geolocation API themselves (navigator.geolocation) -- most pages never do, so this is for geo-aware sites/dashboards, not a general IP-geolocation override."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}