{
  "openapi": "3.0.1",
  "info": {
    "title": "Screenshot & HTML to PDF API",
    "description": "Screenshot or PDF any list of web pages, or turn your own HTML into a PDF. Full page, phone or desktop size, dark mode, cookie banners hidden, element capture. Direct file links. $0.004 per capture, charged only when it works.",
    "version": "1.0",
    "x-build-id": "nTdVr81DfIkrrZ0l0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ensorcelling_melilot~screenshot-pdf/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ensorcelling_melilot-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/ensorcelling_melilot~screenshot-pdf/runs": {
      "post": {
        "operationId": "runs-sync-ensorcelling_melilot-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/ensorcelling_melilot~screenshot-pdf/run-sync": {
      "post": {
        "operationId": "run-sync-ensorcelling_melilot-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": "Web page URLs",
            "type": "array",
            "description": "Pages to capture, one per line. Each page gives one file.",
            "items": {
              "type": "string"
            }
          },
          "html": {
            "title": "Or your own HTML",
            "type": "string",
            "description": "Optional. A full HTML document (or fragment) to render instead of, or as well as, the URLs. Handy for invoices, reports and certificates. It is rendered like a web page and cannot reach private networks."
          },
          "format": {
            "title": "Output format",
            "enum": [
              "png",
              "jpeg",
              "pdf"
            ],
            "type": "string",
            "description": "What to produce for every page: a PNG image, a smaller JPEG image, or a PDF document.",
            "default": "png"
          },
          "fullPage": {
            "title": "Full page",
            "type": "boolean",
            "description": "Capture the whole scrollable page, not just the first screen. Ignored for PDFs (PDFs always cover all pages). Very long pages are cut at 16,000 pixels high.",
            "default": true
          },
          "viewportWidth": {
            "title": "Viewport width (px)",
            "minimum": 200,
            "maximum": 3840,
            "type": "integer",
            "description": "Browser window width in pixels. 1280 is a laptop, 390 is a phone.",
            "default": 1280
          },
          "viewportHeight": {
            "title": "Viewport height (px)",
            "minimum": 200,
            "maximum": 4000,
            "type": "integer",
            "description": "Browser window height in pixels. For non-full-page screenshots this is the image height.",
            "default": 800
          },
          "deviceScaleFactor": {
            "title": "Pixel density",
            "minimum": 1,
            "maximum": 3,
            "type": "integer",
            "description": "1 is normal, 2 gives sharp images for retina screens (twice the pixels in each direction, bigger files).",
            "default": 1
          },
          "mobile": {
            "title": "Mobile mode",
            "type": "boolean",
            "description": "Pretend to be a phone: touch events and a mobile user agent. Combine with a narrow viewport width such as 390.",
            "default": false
          },
          "darkMode": {
            "title": "Dark mode",
            "type": "boolean",
            "description": "Ask pages for their dark colour scheme (prefers-color-scheme: dark), for sites that support it.",
            "default": false
          },
          "waitUntil": {
            "title": "Wait until",
            "enum": [
              "load",
              "domcontentloaded",
              "networkidle"
            ],
            "type": "string",
            "description": "When the page counts as loaded. 'load' is the default. 'networkidle' waits for the network to go quiet and suits slow single-page apps.",
            "default": "load"
          },
          "delaySeconds": {
            "title": "Extra wait (seconds)",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "Extra time to wait after loading before the capture, for animations and lazy content.",
            "default": 1
          },
          "waitForSelector": {
            "title": "Wait for element",
            "type": "string",
            "description": "Optional CSS selector, for example #chart. The capture waits (up to 15 seconds) until this element appears."
          },
          "hideCookieBanners": {
            "title": "Hide cookie banners and pop-ups",
            "type": "boolean",
            "description": "Hide common cookie consent bars and chat widgets before capturing. It covers the usual consent tools, not every site.",
            "default": true
          },
          "clipSelector": {
            "title": "Capture only this element",
            "type": "string",
            "description": "Optional CSS selector. For screenshots, only this element is captured instead of the whole page."
          },
          "pdfFormat": {
            "title": "PDF paper size",
            "enum": [
              "A4",
              "Letter",
              "Legal",
              "A3"
            ],
            "type": "string",
            "description": "Paper size for PDFs.",
            "default": "A4"
          },
          "pdfLandscape": {
            "title": "PDF landscape",
            "type": "boolean",
            "description": "Print PDFs sideways.",
            "default": false
          },
          "pdfPrintBackground": {
            "title": "PDF with backgrounds",
            "type": "boolean",
            "description": "Include background colours and images in PDFs.",
            "default": true
          },
          "extraHeaders": {
            "title": "Extra request headers",
            "type": "object",
            "description": "Optional headers sent with every page request, as JSON, for example {\"Accept-Language\": \"de\"}. Values are not stored or logged."
          },
          "maxConcurrency": {
            "title": "Pages at once",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many pages to render in parallel. Raise for long lists if you give the Actor more memory.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}