{
  "openapi": "3.0.1",
  "info": {
    "title": "Page to PDF & Screenshot: URL or HTML to PDF, PNG",
    "description": "Turn a list of web pages or your own HTML into PDF files and full-page PNG screenshots in one run. A4 or Letter, wait and timeout controls, hide cookie banners by CSS selector. $0.003 per file created; failed pages are not charged.",
    "version": "0.3",
    "x-build-id": "7zPtHuOL3grALWFig"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/starlitdesk~page-to-pdf-screenshot/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-starlitdesk-page-to-pdf-screenshot",
        "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/starlitdesk~page-to-pdf-screenshot/runs": {
      "post": {
        "operationId": "runs-sync-starlitdesk-page-to-pdf-screenshot",
        "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/starlitdesk~page-to-pdf-screenshot/run-sync": {
      "post": {
        "operationId": "run-sync-starlitdesk-page-to-pdf-screenshot",
        "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": "Page URLs",
            "type": "array",
            "description": "Web pages to capture (http or https), up to 1,000. Only these pages are opened; no links are followed. Leave empty if you only use raw HTML.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "html": {
            "title": "Raw HTML (optional)",
            "type": "array",
            "description": "Your own HTML to render, as a list of {\"name\": \"invoice-1\", \"html\": \"<h1>...</h1>\"}. Rendered offline: the tool blocks every network request it would make, so inline CSS and use data: URLs for images. Up to 100 items."
          },
          "outputs": {
            "title": "Files to create",
            "type": "array",
            "description": "PDF, PNG or both for every page. Each file created is one paid event.",
            "items": {
              "type": "string",
              "enum": [
                "pdf",
                "png"
              ],
              "enumTitles": [
                "PDF",
                "PNG screenshot"
              ]
            },
            "default": [
              "pdf",
              "png"
            ]
          },
          "pageFormat": {
            "title": "PDF page size",
            "enum": [
              "A4",
              "Letter"
            ],
            "type": "string",
            "description": "Paper size of the PDF.",
            "default": "A4"
          },
          "landscape": {
            "title": "Landscape PDF",
            "type": "boolean",
            "description": "Print the PDF in landscape orientation.",
            "default": false
          },
          "printBackground": {
            "title": "Print backgrounds",
            "type": "boolean",
            "description": "Include background colours and images in the PDF.",
            "default": true
          },
          "marginMm": {
            "title": "PDF margin (mm)",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Margin on all four sides of each PDF page, 0 to 50 mm.",
            "default": 10
          },
          "viewportWidth": {
            "title": "Browser width (px)",
            "minimum": 320,
            "maximum": 3840,
            "type": "integer",
            "description": "Width of the browser window, 320 to 3,840 px. Also the PNG width.",
            "default": 1280
          },
          "viewportHeight": {
            "title": "Browser height (px)",
            "minimum": 200,
            "maximum": 2160,
            "type": "integer",
            "description": "Height of the browser window, 200 to 2,160 px. Used as the PNG height when Full page is off.",
            "default": 800
          },
          "fullPage": {
            "title": "Full-page PNG",
            "type": "boolean",
            "description": "Capture the whole page height (cut at 16,000 px) instead of only the visible window.",
            "default": true
          },
          "waitUntil": {
            "title": "Wait until",
            "enum": [
              "load",
              "domcontentloaded",
              "networkidle"
            ],
            "type": "string",
            "description": "When a page counts as loaded: 'load' (all resources), 'domcontentloaded' (HTML parsed) or 'networkidle' (no network traffic for 0.5 s).",
            "default": "load"
          },
          "delayMs": {
            "title": "Extra delay (ms)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Wait this long after loading before capturing, 0 to 10,000 ms (for animations or late content).",
            "default": 0
          },
          "timeoutSecs": {
            "title": "Timeout per page (seconds)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Give up on a page after this many seconds, 1 to 60. Pages that time out are not charged.",
            "default": 30
          },
          "hideSelectors": {
            "title": "Hide elements (CSS selectors)",
            "type": "array",
            "description": "Elements to hide before capturing, e.g. a cookie banner on your own site: '#cookie-banner'. Up to 50.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}