{
  "openapi": "3.0.1",
  "info": {
    "title": "Universal Screenshot API",
    "description": "Batch website screenshot and PDF capture with full-page-by-default rendering, dark mode, ad/tracker/cookie-banner blocking, SSRF-safe URL validation, and an explicit error taxonomy.",
    "version": "0.0",
    "x-build-id": "12TTELoTz2Evzzfev"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/elab~universal-screenshot-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-elab-universal-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/elab~universal-screenshot-api/runs": {
      "post": {
        "operationId": "runs-sync-elab-universal-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/elab~universal-screenshot-api/run-sync": {
      "post": {
        "operationId": "run-sync-elab-universal-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",
        "required": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "URLs",
            "type": "array",
            "description": "Page URLs to capture. Each URL produces one dataset row per requested output type (screenshot and/or pdf). Max 100 URLs per run.",
            "default": [
              "https://apify.com"
            ],
            "items": {
              "type": "string"
            }
          },
          "outputs": {
            "title": "Outputs",
            "type": "array",
            "description": "What to produce for each URL. You are charged only for outputs that succeed.",
            "items": {
              "type": "string",
              "enum": [
                "screenshot",
                "pdf"
              ],
              "enumTitles": [
                "Screenshot (image)",
                "PDF"
              ]
            },
            "default": [
              "screenshot"
            ]
          },
          "format": {
            "title": "Image format",
            "enum": [
              "png",
              "jpeg",
              "webp"
            ],
            "type": "string",
            "description": "Image format when 'screenshot' is requested. PNG and JPEG are captured natively; WebP is produced by converting the PNG capture. Ignored for PDF output.",
            "default": "png"
          },
          "quality": {
            "title": "Image quality",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Compression quality 1-100 for jpeg/webp. Ignored for png.",
            "default": 80
          },
          "fullPage": {
            "title": "Full page",
            "type": "boolean",
            "description": "Capture the full scrollable page, not just the viewport. On by default (most competing tools default this off). Capture height is internally capped at 20,000px for cost/reliability safety (not a Chromium limit) - pages taller than that are captured up to the cap and the dataset row's 'fullPageHeightCapped' field is set to true.",
            "default": true
          },
          "device": {
            "title": "Device preset",
            "enum": [
              "desktop",
              "desktop_hd",
              "laptop",
              "tablet",
              "mobile",
              "iphone_15",
              "pixel_8",
              "ipad",
              "custom"
            ],
            "type": "string",
            "description": "Realistic viewport + pixel-density + user-agent preset. Use 'custom' with Viewport width/height below to override.",
            "default": "desktop"
          },
          "viewportWidth": {
            "title": "Viewport width",
            "minimum": 200,
            "maximum": 4000,
            "type": "integer",
            "description": "Used only when Device preset is 'custom'.",
            "default": 1280
          },
          "viewportHeight": {
            "title": "Viewport height",
            "minimum": 200,
            "maximum": 4000,
            "type": "integer",
            "description": "Used only when Device preset is 'custom' and Full page is false.",
            "default": 800
          },
          "deviceScaleFactor": {
            "title": "Device scale factor",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "Pixel density override: 2 or 3 for retina/high-DPI captures. Leave at the default (1) to use the selected device preset's own value.",
            "default": 1
          },
          "waitUntil": {
            "title": "Wait until",
            "enum": [
              "load",
              "domcontentloaded",
              "networkidle"
            ],
            "type": "string",
            "description": "Navigation readiness before capture. 'networkidle' is slower but far more reliable for JS-heavy pages than 'load'.",
            "default": "networkidle"
          },
          "waitForSelector": {
            "title": "Wait for selector",
            "type": "string",
            "description": "Optional CSS selector to wait for before capturing. If it never appears within Timeout, the page is still captured and 'waitForSelectorTimedOut' is set true in the output rather than failing the run.",
            "default": ""
          },
          "delayMs": {
            "title": "Extra delay (ms)",
            "minimum": 0,
            "maximum": 60000,
            "type": "integer",
            "description": "Extra wait (ms) after the page is ready, for animations or late content. Capped at 60000 ms.",
            "default": 0
          },
          "timeoutSecs": {
            "title": "Timeout (seconds)",
            "minimum": 1,
            "maximum": 120,
            "type": "integer",
            "description": "Max seconds to wait for navigation and rendering before this URL is reported as a timeout error. Capped at 120s.",
            "default": 30
          },
          "scrollToBottom": {
            "title": "Scroll to bottom",
            "type": "boolean",
            "description": "Auto-scroll through the page before capturing to trigger lazy-loaded images/sections, then scroll back to top.",
            "default": true
          },
          "colorScheme": {
            "title": "Color scheme",
            "enum": [
              "no-preference",
              "light",
              "dark"
            ],
            "type": "string",
            "description": "Emulate prefers-color-scheme. Set to 'dark' to force dark-mode rendering on sites that support it.",
            "default": "no-preference"
          },
          "selectorsToHide": {
            "title": "Selectors to hide",
            "type": "array",
            "description": "CSS selectors to hide (visibility:hidden) before capturing, e.g. for chat widgets or popups.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "blockAds": {
            "title": "Block ads",
            "type": "boolean",
            "description": "Block requests to a small, curated list of known ad-serving domains before capture.",
            "default": true
          },
          "blockTrackers": {
            "title": "Block trackers",
            "type": "boolean",
            "description": "Block requests to a small, curated list of known analytics/tracker domains before capture.",
            "default": true
          },
          "hideCookieBanners": {
            "title": "Hide cookie banners",
            "type": "boolean",
            "description": "Hide known cookie-consent banner overlays via CSS before capturing (visual cleanup only; does not grant consent).",
            "default": true
          },
          "stealthMode": {
            "title": "Stealth mode",
            "type": "boolean",
            "description": "Mask common automation fingerprints so target sites are less likely to block the request. Does not bypass CAPTCHAs or paywalls.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy configuration for the capture request.",
            "default": {
              "useApifyProxy": true
            }
          },
          "cookies": {
            "title": "Cookies",
            "type": "array",
            "description": "Session cookies for capturing your OWN authenticated/paywalled pages, e.g. [{ \"name\": \"session\", \"value\": \"...\", \"domain\": \"example.com\", \"path\": \"/\" }]. Supply only credentials you own or are authorized to use.",
            "default": []
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}