{
  "openapi": "3.0.1",
  "info": {
    "title": "HTML to PDF Converter – URL to PDF & Raw HTML, Bulk",
    "description": "Convert HTML to PDF in bulk: web page URLs, raw HTML strings (invoices, receipts, reports) and HTML files to print-quality PDFs with headless Chrome. A4/Letter, margins, header/footer page numbers, cookie banners hidden, merge into one PDF. $4 per 1,000 PDFs.",
    "version": "0.1",
    "x-build-id": "AFXmhRFdognt7TUHe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~html-to-pdf/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-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/gazidev~html-to-pdf/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-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/gazidev~html-to-pdf/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-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": "Web page URLs",
            "type": "array",
            "description": "Web pages (or links to .html files) to convert to PDF, one per line. `https://` is added if missing; duplicates are skipped. Leave empty if you only convert raw HTML below.",
            "items": {
              "type": "string"
            }
          },
          "htmlItems": {
            "title": "Raw HTML documents",
            "type": "array",
            "description": "HTML strings to convert, e.g. invoices, receipts, reports, certificates. Each item is either an object `{\"name\": \"invoice-1001\", \"html\": \"<html>...</html>\"}` or a plain HTML string. Optional per item: `baseUrl` (so relative image/CSS links resolve) or `url` instead of `html` (an HTML file link). CSS, web fonts and inline/remote images are supported."
          },
          "pageFormat": {
            "title": "Paper size",
            "enum": [
              "A4",
              "Letter",
              "Legal",
              "A3",
              "A5",
              "Tabloid",
              "custom"
            ],
            "type": "string",
            "description": "Paper format of the PDF. `custom` uses the width and height below.",
            "default": "A4"
          },
          "customWidth": {
            "title": "Custom width",
            "type": "string",
            "description": "Only for paper size `custom`. Units: mm, cm, in or px, e.g. `100mm` or `4in`.",
            "default": ""
          },
          "customHeight": {
            "title": "Custom height",
            "type": "string",
            "description": "Only for paper size `custom`, e.g. `150mm` or `6in`.",
            "default": ""
          },
          "landscape": {
            "title": "Landscape",
            "type": "boolean",
            "description": "Rotate the paper to landscape orientation.",
            "default": false
          },
          "margins": {
            "title": "Margins",
            "type": "object",
            "description": "Page margins as CSS lengths (mm, cm, in, px). Header/footer templates are printed inside the top/bottom margin, so those are raised to at least 15mm when a template is used.",
            "default": {
              "top": "10mm",
              "right": "10mm",
              "bottom": "10mm",
              "left": "10mm"
            }
          },
          "printBackground": {
            "title": "Print background colors and images",
            "type": "boolean",
            "description": "Keep CSS background colors and images (recommended for invoices and designed pages).",
            "default": true
          },
          "scale": {
            "title": "Scale",
            "minimum": 0.1,
            "maximum": 2,
            "type": "number",
            "description": "Zoom of the page content, 0.1 to 2. Use 0.8 to fit wide pages.",
            "default": 1
          },
          "pageRanges": {
            "title": "Page ranges",
            "type": "string",
            "description": "Only print these pages, e.g. `1-3, 5`. Empty = all pages.",
            "default": ""
          },
          "preferCssPageSize": {
            "title": "Use CSS @page size",
            "type": "boolean",
            "description": "If the HTML defines `@page { size: ... }`, use it instead of the paper size above.",
            "default": false
          },
          "headerTemplate": {
            "title": "Header template (HTML)",
            "type": "string",
            "description": "HTML printed at the top of every page. Chromium fills these classes: `pageNumber`, `totalPages`, `date`, `title`, `url`, e.g. `<span class=\"title\"></span>`. Set a font size inline (default is tiny), e.g. `<div style=\"font-size:9px;width:100%;text-align:center\">...</div>`. Images must be data: URIs. Empty = no header.",
            "default": ""
          },
          "footerTemplate": {
            "title": "Footer template (HTML)",
            "type": "string",
            "description": "HTML printed at the bottom of every page, same classes as the header. The prefilled example prints `Page 1 of 3`. Empty = no footer.",
            "default": ""
          },
          "emulateMedia": {
            "title": "CSS media type",
            "enum": [
              "print",
              "screen"
            ],
            "type": "string",
            "description": "`print` uses the site's print stylesheet (cleaner, usually no menus/ads). `screen` makes the PDF look like the page in the browser.",
            "default": "print"
          },
          "waitUntil": {
            "title": "Wait until",
            "enum": [
              "load",
              "domcontentloaded",
              "networkidle",
              "commit"
            ],
            "type": "string",
            "description": "When the page counts as loaded. `load` (default) also waits up to 2 s for network idle. Use `networkidle` for single-page apps.",
            "default": "load"
          },
          "waitForSelector": {
            "title": "Wait for CSS selector",
            "type": "string",
            "description": "Optional. Wait until this element exists before printing, e.g. `#chart canvas` or `.invoice-ready`. If it never appears, that document gets a free error row.",
            "default": ""
          },
          "delayMs": {
            "title": "Extra delay (ms)",
            "minimum": 0,
            "maximum": 30000,
            "type": "integer",
            "description": "Wait this long after loading, before printing (charts, animations). 0–30000.",
            "default": 0
          },
          "hideCookieBanners": {
            "title": "Hide cookie banners",
            "type": "boolean",
            "description": "Hide cookie/consent popups on web pages (nothing is clicked or accepted).",
            "default": true
          },
          "blockAds": {
            "title": "Block ads and trackers",
            "type": "boolean",
            "description": "Block common ad and analytics domains. Faster and cleaner PDFs.",
            "default": true
          },
          "scrollToLoad": {
            "title": "Load lazy images",
            "type": "boolean",
            "description": "Scroll through web pages and switch lazy images to eager so they appear in the PDF.",
            "default": true
          },
          "navigationTimeoutSecs": {
            "title": "Page load timeout",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "Seconds to wait for a page to load. Slow pages are printed as rendered so far.",
            "default": 45
          },
          "convertErrorPages": {
            "title": "Convert HTTP error pages",
            "type": "boolean",
            "description": "By default, pages that answer HTTP 4xx/5xx (404 Not Found, 403 bot walls, 500 errors) are not converted and get a free error row. Turn on to print them anyway (charged).",
            "default": false
          },
          "mergeIntoOnePdf": {
            "title": "Also merge everything into one PDF",
            "type": "boolean",
            "description": "Additionally create one combined PDF of all documents, in input order (URLs first, then HTML items). Charged as one extra `merged-pdf` event.",
            "default": false
          },
          "mergedFileName": {
            "title": "Merged PDF file name",
            "type": "string",
            "description": "File name of the merged PDF (without .pdf).",
            "default": "merged"
          },
          "fileNameTemplate": {
            "title": "File name template",
            "type": "string",
            "description": "File name for each PDF in the key-value store. Placeholders: `{index}`, `{name}` (HTML item name or URL slug), `{title}` (document title), `{host}`, `{date}`. `.pdf` is added.",
            "default": "{index}-{name}"
          },
          "maxItems": {
            "title": "Max documents",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many documents (0 = no limit).",
            "default": 0
          },
          "maxConcurrency": {
            "title": "Parallel pages",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Documents converted at the same time. Lowered automatically to fit the run's memory.",
            "default": 3
          },
          "maxRetries": {
            "title": "Retries per document",
            "minimum": 0,
            "maximum": 3,
            "type": "integer",
            "description": "Retries after a load error or timeout.",
            "default": 1
          },
          "ignoreHttpsErrors": {
            "title": "Ignore HTTPS certificate errors",
            "type": "boolean",
            "description": "Convert pages with self-signed or expired certificates.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}