{
  "openapi": "3.0.1",
  "info": {
    "title": "HTML to PDF: web pages and raw HTML to PDF in bulk",
    "description": "Prints every URL or raw HTML document you list to PDF in headless Chrome, with page size, margins, landscape, backgrounds, scale, page numbers, and header and footer templates. Returns a download link for each PDF.",
    "version": "0.1",
    "x-build-id": "bANkhQgXNjB1Z3dKy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/examsens.ai~html-to-pdf/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-examsens.ai-html-to-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/examsens.ai~html-to-pdf/runs": {
      "post": {
        "operationId": "runs-sync-examsens.ai-html-to-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/examsens.ai~html-to-pdf/run-sync": {
      "post": {
        "operationId": "run-sync-examsens.ai-html-to-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": "Web pages to turn into PDFs.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "htmlDocuments": {
            "title": "Raw HTML documents",
            "type": "array",
            "description": "HTML you supply yourself, such as invoices or reports. Each entry is an object: {\"name\": \"invoice-1001\", \"html\": \"<h1>Invoice</h1>\"}. Add \"baseUrl\" when the HTML links images or stylesheets with relative paths."
          },
          "pageFormat": {
            "title": "Page size",
            "enum": [
              "Letter",
              "Legal",
              "Tabloid",
              "Ledger",
              "A0",
              "A1",
              "A2",
              "A3",
              "A4",
              "A5",
              "A6"
            ],
            "type": "string",
            "description": "Paper size. Ignored when page width and height are both set.",
            "default": "Letter"
          },
          "pageWidth": {
            "title": "Custom page width",
            "type": "string",
            "description": "A custom width with a unit, such as 8.5in, 210mm or 800px. Needs a custom height too."
          },
          "pageHeight": {
            "title": "Custom page height",
            "type": "string",
            "description": "A custom height with a unit, such as 11in, 297mm or 1200px. Needs a custom width too."
          },
          "landscape": {
            "title": "Sideways pages",
            "type": "boolean",
            "description": "Turn each page on its side, wider than tall.",
            "default": false
          },
          "marginTop": {
            "title": "Top margin",
            "type": "string",
            "description": "With a unit: in, cm, mm or px.",
            "default": "0.5in"
          },
          "marginRight": {
            "title": "Right margin",
            "type": "string",
            "description": "With a unit: in, cm, mm or px.",
            "default": "0.5in"
          },
          "marginBottom": {
            "title": "Bottom margin",
            "type": "string",
            "description": "With a unit: in, cm, mm or px.",
            "default": "0.5in"
          },
          "marginLeft": {
            "title": "Left margin",
            "type": "string",
            "description": "With a unit: in, cm, mm or px.",
            "default": "0.5in"
          },
          "printBackground": {
            "title": "Print backgrounds",
            "type": "boolean",
            "description": "Include background colors and images.",
            "default": true
          },
          "scale": {
            "title": "Scale",
            "minimum": 0.1,
            "maximum": 2,
            "type": "number",
            "description": "Zoom of the page content, from 0.1 to 2.",
            "default": 1
          },
          "pageNumbers": {
            "title": "Page numbers",
            "type": "boolean",
            "description": "Add a centered \"Page 1 of 3\" footer. Ignored when you write your own footer template.",
            "default": false
          },
          "headerTemplate": {
            "title": "Header template",
            "type": "string",
            "description": "HTML printed at the top of every page. These classes are filled in for you: date, title, url, pageNumber, totalPages, as in <span class=\"pageNumber\"></span>. Set a font size in the template, such as style=\"font-size:9px\", and leave a top margin big enough to hold it."
          },
          "footerTemplate": {
            "title": "Footer template",
            "type": "string",
            "description": "HTML printed at the bottom of every page, with the same classes as the header. Set a font size and leave a bottom margin big enough to hold it."
          },
          "pageRanges": {
            "title": "Page ranges",
            "type": "string",
            "description": "Print only some pages, such as 1-3 or 1,4. Leave empty for all pages."
          },
          "preferCssPageSize": {
            "title": "Use the page's own CSS page size",
            "type": "boolean",
            "description": "When the page sets its size with a CSS @page rule, use that size.",
            "default": false
          },
          "mediaType": {
            "title": "CSS media type",
            "enum": [
              "print",
              "screen"
            ],
            "type": "string",
            "description": "Print uses the page's print stylesheet. Screen makes the PDF look like the page on screen.",
            "default": "print"
          },
          "taggedPdf": {
            "title": "Tagged PDF",
            "type": "boolean",
            "description": "Add structure tags that help screen readers.",
            "default": true
          },
          "outline": {
            "title": "Bookmarks from headings",
            "type": "boolean",
            "description": "Add a document outline (bookmarks) built from the page headings.",
            "default": false
          },
          "waitUntil": {
            "title": "Wait until",
            "enum": [
              "load",
              "domcontentloaded",
              "networkidle"
            ],
            "type": "string",
            "description": "When the page counts as loaded: the load event, DOMContentLoaded, or no network traffic for 500 ms.",
            "default": "load"
          },
          "delayMs": {
            "title": "Extra delay (ms)",
            "minimum": 0,
            "maximum": 30000,
            "type": "integer",
            "description": "Wait this long after loading before printing, for scripts and late content.",
            "default": 500
          },
          "timeoutSecs": {
            "title": "Page timeout (seconds)",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "Give up on a page that does not load within this time.",
            "default": 60
          },
          "viewportWidth": {
            "title": "Viewport width (px)",
            "minimum": 320,
            "maximum": 3840,
            "type": "integer",
            "description": "Browser window width while the page loads. Affects pages whose layout depends on window width.",
            "default": 1280
          },
          "locale": {
            "title": "Browser language",
            "type": "string",
            "description": "The language the browser asks for, such as en-US, de-DE or ja-JP. Sites that serve several languages pick theirs from this.",
            "default": "en-US"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}