{
  "openapi": "3.0.1",
  "info": {
    "title": "HTML to PDF: Web Pages, HTML & Invoice Templates in Bulk",
    "description": "Turn web pages, HTML documents or an HTML template plus JSON rows (invoices, certificates, reports) into PDFs. Page size, margins, landscape, headers, footers and page numbers. Cookie banners hidden. You only pay for PDFs that succeed.",
    "version": "1.0",
    "x-build-id": "AFmgeCojf2v6Oqqob"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/blueberry_rainstorm~html-to-pdf/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-blueberry_rainstorm-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/blueberry_rainstorm~html-to-pdf/runs": {
      "post": {
        "operationId": "runs-sync-blueberry_rainstorm-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/blueberry_rainstorm~html-to-pdf/run-sync": {
      "post": {
        "operationId": "run-sync-blueberry_rainstorm-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": "Public pages to save as PDF, one PDF per URL. You can also (or instead) give an HTML document or an HTML template below.",
            "default": [
              {
                "url": "https://en.wikipedia.org/wiki/PDF"
              }
            ],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "html": {
            "title": "HTML document",
            "type": "string",
            "description": "A full HTML document (with inline CSS, images by URL or data URI) to turn into one PDF."
          },
          "fileName": {
            "title": "File name for the HTML document",
            "type": "string",
            "description": "Name of the PDF made from the HTML document, e.g. report-2026-11. Default: document.pdf."
          },
          "template": {
            "title": "HTML template (one PDF per data row)",
            "type": "string",
            "description": "Handlebars template, e.g. <h1>Invoice {{number}}</h1>{{#each items}}<p>{{name}}: {{formatNumber (multiply qty price)}}</p>{{/each}}. Helpers: multiply, add, sum, sumProduct, formatNumber, uppercase, date, eq. Use {{{field}}} for raw HTML."
          },
          "data": {
            "title": "Data rows",
            "type": "array",
            "description": "JSON array of objects. Each object fills the template once and gives one PDF, e.g. [{\"number\": \"INV-001\", \"items\": [{\"name\": \"Design\", \"qty\": 2, \"price\": 150}]}]."
          },
          "fileNameTemplate": {
            "title": "File name template",
            "type": "string",
            "description": "Name of each PDF made from the template, e.g. invoice-{{number}}. {{_index}} is the row number. Default: document-{{_index}}."
          },
          "pageFormat": {
            "title": "Page size",
            "enum": [
              "A4",
              "Letter",
              "Legal",
              "A3",
              "A5",
              "Tabloid"
            ],
            "type": "string",
            "description": "Paper size of every page.",
            "default": "A4"
          },
          "landscape": {
            "title": "Landscape",
            "type": "boolean",
            "description": "Turn pages sideways (wide tables, dashboards).",
            "default": false
          },
          "margin": {
            "title": "Margins",
            "type": "string",
            "description": "CSS style: \"10mm\", \"10mm 15mm\" (top/bottom, left/right) or four values. Units mm, cm, in or px. Empty = 10 mm, or 18 mm top/bottom when there is a header or footer."
          },
          "printBackground": {
            "title": "Print background colors and images",
            "type": "boolean",
            "description": "Keep background colors and images, like Chrome's \"Background graphics\" option.",
            "default": true
          },
          "scale": {
            "title": "Scale",
            "minimum": 0.1,
            "maximum": 2,
            "type": "number",
            "description": "1 = 100%. Lower it to fit wide pages.",
            "default": 1
          },
          "pageNumbers": {
            "title": "Add page numbers (\"3 / 12\") in the footer",
            "type": "boolean",
            "description": "Adds a small \"3 / 12\" footer. Ignored when you give your own Footer HTML.",
            "default": false
          },
          "headerTemplate": {
            "title": "Header HTML",
            "type": "string",
            "description": "Printed at the top of every page. Use classes pageNumber, totalPages, date, title, url, e.g. <div style=\"font-size:9px;margin-left:10mm\"><span class=\"title\"></span></div>. Set a font-size: the default is tiny."
          },
          "footerTemplate": {
            "title": "Footer HTML",
            "type": "string",
            "description": "Printed at the bottom of every page (same classes as the header). Overrides the page numbers option."
          },
          "cssMediaType": {
            "title": "CSS media",
            "enum": [
              "print",
              "screen"
            ],
            "type": "string",
            "description": "Print uses the page's print styles. Screen keeps the on-screen look.",
            "default": "print"
          },
          "hideCookieBanners": {
            "title": "Hide cookie banners (URLs)",
            "type": "boolean",
            "description": "Hides common cookie and consent popups (OneTrust, Cookiebot, Didomi and more) before printing web pages.",
            "default": true
          },
          "hideSelectors": {
            "title": "Hide these elements",
            "type": "string",
            "description": "CSS selectors to hide before printing, e.g. .chat-widget, header nav"
          },
          "waitUntil": {
            "title": "Wait until",
            "enum": [
              "load",
              "domcontentloaded",
              "networkidle"
            ],
            "type": "string",
            "description": "When the page counts as ready to print.",
            "default": "load"
          },
          "waitForSelector": {
            "title": "Wait for selector",
            "type": "string",
            "description": "Wait until this CSS selector appears before printing."
          },
          "delaySecs": {
            "title": "Extra delay (seconds)",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "Extra wait before printing, for animations or charts.",
            "default": 0
          },
          "timeoutSecs": {
            "title": "Timeout per document (seconds)",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "A document that takes longer fails (and is free).",
            "default": 45
          },
          "maxConcurrency": {
            "title": "Parallel documents",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many documents are printed at the same time.",
            "default": 4
          },
          "maxDocuments": {
            "title": "Max documents",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many PDFs.",
            "default": 10000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}