{
  "openapi": "3.0.1",
  "info": {
    "title": "Website Screenshot & HTML to Image / PDF",
    "description": "Website screenshot API: capture URLs or your own HTML page as PNG, JPEG or PDF. Full page or one element, desktop, tablet or mobile, dark mode, common cookie banners hidden. Up to 1,000 URLs per run; dataset with file links. $0.003 per screen, $0.005 per full page or PDF; failed pages free.",
    "version": "0.1",
    "x-build-id": "5E8dt7bseyF0iRUq8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/klarto~website-screenshot-pdf/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-klarto-website-screenshot-pdf",
        "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/klarto~website-screenshot-pdf/runs": {
      "post": {
        "operationId": "runs-sync-klarto-website-screenshot-pdf",
        "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/klarto~website-screenshot-pdf/run-sync": {
      "post": {
        "operationId": "run-sync-klarto-website-screenshot-pdf",
        "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": "Pages to capture, one per line (up to 1,000 per run). Only pages you own or may capture. Pages that the site's robots.txt does not allow get status 'blocked' and are not charged.",
            "items": {
              "type": "string"
            }
          },
          "html": {
            "title": "HTML",
            "type": "string",
            "description": "Optional: one HTML document of your own (up to 2 MB), e.g. an Open Graph card, invoice or report. It is rendered once per run (fileIndex 0), next to any URLs. Images and styles it links to must be on public URLs."
          },
          "format": {
            "title": "Format",
            "enum": [
              "png",
              "jpeg",
              "pdf"
            ],
            "type": "string",
            "description": "PNG (sharp, larger), JPEG (smaller) or PDF (printable pages).",
            "default": "png"
          },
          "fullPage": {
            "title": "Full page",
            "type": "boolean",
            "description": "Capture the whole scrollable page, not just the first screen, cut at 'Max full-page height'. For PNG and JPEG the page is first scrolled down one screen at a time (0.15 s per step) so lazy images can start loading; images that load slower may be missing. PDF always prints the whole page.",
            "default": false
          },
          "device": {
            "title": "Device",
            "enum": [
              "desktop",
              "laptop",
              "full-hd",
              "tablet",
              "mobile"
            ],
            "type": "string",
            "description": "Screen size and type: desktop 1280×800, laptop 1440×900, full HD 1920×1080, tablet 820×1180 (2×), mobile 390×844 (3×).",
            "default": "desktop"
          },
          "selector": {
            "title": "Capture one element (CSS selector)",
            "type": "string",
            "description": "Optional: capture only the first element matching this CSS selector, e.g. 'main' or '#pricing'. It must become visible within 10 s. Ignored for PDF."
          },
          "hideCookieBanners": {
            "title": "Hide cookie banners",
            "type": "boolean",
            "description": "Hide 29 common cookie-consent banner containers with CSS. Nothing is clicked or accepted; banners with other markup stay visible.",
            "default": true
          },
          "darkMode": {
            "title": "Dark mode",
            "type": "boolean",
            "description": "Ask the page for its dark color scheme (only pages that support it change).",
            "default": false
          },
          "waitForSelector": {
            "title": "Wait for element (CSS selector)",
            "type": "string",
            "description": "Optional: wait until this element is visible before capturing, within the page timeout. If it does not appear, the page fails with status 'error' and is not charged."
          },
          "delayMs": {
            "title": "Extra delay (ms)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Wait this long after the page has loaded (0-10,000 ms), e.g. for animations. Shortened if the page timeout runs out.",
            "default": 0
          },
          "pageTimeoutSecs": {
            "title": "Page timeout (s)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Time budget to load and prepare a page, 5-120 s. A page that does not load, or whose 'Wait for element' does not appear, in time fails with status 'error' and is not charged; network quiet, 'Extra delay' and scrolling are cut short. Taking the capture has its own limit (at least 30 s).",
            "default": 30
          },
          "maxHeight": {
            "title": "Max full-page height (px)",
            "minimum": 800,
            "maximum": 16000,
            "type": "integer",
            "description": "Full-page captures are cut at this height in CSS pixels (800-16,000). The image is larger by the pixel density: on mobile (3x) 1,000 gives an image 3,000 px tall. Pages without a mobile viewport tag are laid out 980 CSS px wide on tablet and mobile, and the whole width is kept.",
            "default": 10000
          },
          "viewportWidth": {
            "title": "Custom viewport width (px)",
            "minimum": 0,
            "maximum": 3840,
            "type": "integer",
            "description": "Optional: override the device width (200-3,840 px; 0 = device default).",
            "default": 0
          },
          "viewportHeight": {
            "title": "Custom viewport height (px)",
            "minimum": 0,
            "maximum": 2160,
            "type": "integer",
            "description": "Optional: override the device height (200-2,160 px; 0 = device default).",
            "default": 0
          },
          "scale": {
            "title": "Pixel density",
            "minimum": 0,
            "maximum": 3,
            "type": "integer",
            "description": "Device pixel ratio 1-3 (2 = retina-sharp, 4× the pixels); 0 = device default.",
            "default": 0
          },
          "jpegQuality": {
            "title": "JPEG quality",
            "minimum": 10,
            "maximum": 100,
            "type": "integer",
            "description": "10-100 (only for JPEG).",
            "default": 80
          },
          "pdfFormat": {
            "title": "PDF page size",
            "enum": [
              "A4",
              "Letter",
              "Legal",
              "A3",
              "A5"
            ],
            "type": "string",
            "description": "Paper size for PDF output.",
            "default": "A4"
          },
          "respectRobotsTxt": {
            "title": "Respect robots.txt",
            "type": "boolean",
            "description": "Read each site's robots.txt (user agent 'KlartoScreenshot') before opening a page. Pages it does not allow, or sites whose robots.txt fails (5xx, no answer, broken answer), get status 'blocked' and are free. After a redirect to another site, that site's robots.txt is checked and a disallowed capture is discarded. Turn off only for sites you own.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Parallel tabs",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Pages captured at the same time (1-10). Default: run memory / 700 MB for screens and elements, / 1,400 MB for full pages and PDF, rounded down, 1-6 (2 GB: 2 screen tabs or 1 full-page tab)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}