{
  "openapi": "3.0.1",
  "info": {
    "title": "Website Screenshot API — URL & HTML to PNG, JPEG, WebP, PDF",
    "description": "Turn any URL or raw HTML into a screenshot, PDF, or Open Graph card. Full-page & device capture, dark mode, ad/tracker/cookie-banner blocking, visual diffing, base64-to-image conversion, and DOM + console-error extraction — all through one fast API.",
    "version": "1.0",
    "x-build-id": "kRdf5bHHdZLiUzyEL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/moonweil~url-screenshot-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-moonweil-url-screenshot-api",
        "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/moonweil~url-screenshot-api/runs": {
      "post": {
        "operationId": "runs-sync-moonweil-url-screenshot-api",
        "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/moonweil~url-screenshot-api/run-sync": {
      "post": {
        "operationId": "run-sync-moonweil-url-screenshot-api",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "screenshot",
              "og",
              "diff",
              "decode"
            ],
            "type": "string",
            "description": "What to produce. screenshot: capture a URL or raw HTML. og: generate a 1200×630 Open Graph / social card (uses the OG fields below). diff: visually compare 'URL' against 'Compare URL' and return a highlighted diff image. decode: convert a base64 image string back to a raw image file.",
            "default": "screenshot"
          },
          "url": {
            "title": "URL",
            "type": "string",
            "description": "The page to capture. Must be http(s). Mutually exclusive with 'html'."
          },
          "html": {
            "title": "Raw HTML",
            "type": "string",
            "description": "Render this raw HTML instead of fetching a URL. Mutually exclusive with 'url'."
          },
          "format": {
            "title": "Output format",
            "enum": [
              "png",
              "jpeg",
              "webp",
              "pdf"
            ],
            "type": "string",
            "description": "Image/document format to return.",
            "default": "png"
          },
          "width": {
            "title": "Viewport width",
            "minimum": 100,
            "maximum": 3840,
            "type": "integer",
            "description": "100-3840 px. Ignored when 'device' is set.",
            "default": 1920
          },
          "height": {
            "title": "Viewport height",
            "minimum": 100,
            "maximum": 2160,
            "type": "integer",
            "description": "100-2160 px. Ignored when 'device' is set.",
            "default": 1080
          },
          "fullPage": {
            "title": "Full page",
            "type": "boolean",
            "description": "Capture the entire scrollable page instead of just the viewport.",
            "default": false
          },
          "device": {
            "title": "Device preset",
            "enum": [
              "",
              "iphone_14",
              "iphone_se",
              "pixel_7",
              "ipad_pro",
              "desktop"
            ],
            "type": "string",
            "description": "Overrides width/height/user-agent with a device emulation preset.",
            "default": ""
          },
          "quality": {
            "title": "Quality",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "0-100. Applies to jpeg/webp only.",
            "default": 85
          },
          "delay": {
            "title": "Delay before capture (seconds)",
            "minimum": 0,
            "maximum": 60,
            "type": "integer",
            "description": "0-60. Extra wait after the page load event.",
            "default": 2
          },
          "waitForSelector": {
            "title": "Wait for CSS selector",
            "type": "string",
            "description": "Wait until this element is visible before capturing."
          },
          "waitUntil": {
            "title": "Wait strategy",
            "enum": [
              "load",
              "networkidle",
              "complete"
            ],
            "type": "string",
            "description": "load: fire on the browser load event. networkidle: load, then settle for 2s. complete: wait for fonts and images to finish too.",
            "default": "load"
          },
          "darkMode": {
            "title": "Dark mode",
            "type": "boolean",
            "description": "Emulate prefers-color-scheme: dark.",
            "default": false
          },
          "blockAds": {
            "title": "Block ads",
            "type": "boolean",
            "description": "Block known ad-serving domains via CDP request blocking before capture.",
            "default": false
          },
          "blockTrackers": {
            "title": "Block trackers",
            "type": "boolean",
            "description": "Block known tracker/analytics domains via CDP request blocking before capture.",
            "default": false
          },
          "blockCookieBanners": {
            "title": "Block cookie banners",
            "type": "boolean",
            "description": "Removes common cookie-consent overlays before capture.",
            "default": false
          },
          "hide": {
            "title": "Hide selectors",
            "type": "string",
            "description": "Comma-separated CSS selectors to hide (display:none) before capture."
          },
          "blur": {
            "title": "Blur selectors",
            "type": "string",
            "description": "Comma-separated CSS selectors to blur before capture (useful for redacting PII)."
          },
          "customCss": {
            "title": "Custom CSS",
            "type": "string",
            "description": "Injected as a <style> tag before capture. Max 8192 chars."
          },
          "userAgent": {
            "title": "User agent override",
            "type": "string",
            "description": "Overrides the browser's User-Agent header/navigator.userAgent."
          },
          "timezone": {
            "title": "Timezone",
            "type": "string",
            "description": "IANA timezone, e.g. America/New_York."
          },
          "locale": {
            "title": "Locale",
            "type": "string",
            "description": "BCP-47 locale, e.g. fr-FR."
          },
          "scrollToLoad": {
            "title": "Scroll to load lazy content",
            "type": "boolean",
            "description": "Auto-scrolls the page before capture to trigger lazy-loaded images/sections.",
            "default": false
          },
          "extract": {
            "title": "Extract page data",
            "type": "array",
            "description": "Also return DOM data alongside the screenshot.",
            "items": {
              "type": "string",
              "enum": [
                "text",
                "links",
                "metadata"
              ]
            }
          },
          "captureConsole": {
            "title": "Capture console errors",
            "type": "boolean",
            "description": "Also return JS console errors/warnings encountered while loading the page.",
            "default": false
          },
          "ogTitle": {
            "title": "OG title",
            "type": "string",
            "description": "Card headline (required in og mode, max 120 chars)."
          },
          "ogSubtitle": {
            "title": "OG subtitle",
            "type": "string",
            "description": "Optional subheading under the title (max 200 chars)."
          },
          "ogLogoUrl": {
            "title": "OG logo URL",
            "type": "string",
            "description": "Optional public HTTP(S) URL of a logo shown above the title."
          },
          "ogTheme": {
            "title": "OG theme",
            "enum": [
              "dark",
              "light",
              "gradient"
            ],
            "type": "string",
            "description": "Card color theme.",
            "default": "dark"
          },
          "ogAccentColor": {
            "title": "OG accent color",
            "type": "string",
            "description": "Hex accent color for the title gradient, e.g. #6c63ff."
          },
          "compareUrl": {
            "title": "Compare URL",
            "type": "string",
            "description": "Second page to compare against 'URL' (required in diff mode)."
          },
          "diffThreshold": {
            "title": "Diff threshold (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Per-pixel color-distance threshold as a percentage (0-100). Pixels differing more than this count as changed. Default 10.",
            "default": 10
          },
          "diffHighlightColor": {
            "title": "Diff highlight color",
            "type": "string",
            "description": "Hex color used to mark changed pixels, e.g. #ff0000."
          },
          "diffStabilize": {
            "title": "Stabilize rendering",
            "type": "boolean",
            "description": "Deterministic rendering for reliable diffs: blocks ads/trackers/cookie banners, freezes animations, waits for network idle. Recommended.",
            "default": true
          },
          "base64Image": {
            "title": "Base64 image",
            "type": "string",
            "description": "Base64-encoded image — plain base64 or a data:image/...;base64,... URL. Format is sniffed from the bytes when not set explicitly via 'Output format'."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}