{
  "openapi": "3.0.1",
  "info": {
    "title": "HTML to PDF - Templates, Bulk Invoices, Merge & Page Numbers",
    "description": "Turn HTML, URLs or a template plus data rows into PDFs: bulk invoices and reports, headers and footers with page numbers, custom page sizes, watermark, merge into one PDF. $1.50 per 1,000 PDFs.",
    "version": "1.0",
    "x-build-id": "9GZcUJoR7e3fBJAQL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/digivibetech~html-to-pdf/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-digivibetech-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/digivibetech~html-to-pdf/runs": {
      "post": {
        "operationId": "runs-sync-digivibetech-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/digivibetech~html-to-pdf/run-sync": {
      "post": {
        "operationId": "run-sync-digivibetech-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": {
          "template": {
            "title": "HTML template (bulk mode)",
            "type": "string",
            "description": "HTML with {{ fields }}, {% for %} loops and filters (Jinja2 syntax, sandboxed, values HTML-escaped). One PDF is made per object in dataRows. Filter 'money' formats amounts: {{ total | money('EUR') }}."
          },
          "dataRows": {
            "title": "Data rows",
            "type": "array",
            "description": "One object per PDF, used to fill the template. Example: [{\"number\": \"2026-001\", \"customer\": \"Acme\", \"total\": 120}]."
          },
          "html": {
            "title": "Raw HTML (single document)",
            "type": "string",
            "description": "A complete HTML document to turn into one PDF. Images, fonts and styles may load from public URLs."
          },
          "urls": {
            "title": "Page URLs",
            "type": "array",
            "description": "Public web pages to save as PDF. robots.txt is respected; pages behind logins are not supported.",
            "items": {
              "type": "string"
            }
          },
          "documents": {
            "title": "Mixed documents",
            "type": "array",
            "description": "Advanced: [{\"html\": \"...\", \"fileName\": \"a\"}, {\"url\": \"https://...\"}, {\"html\": \"<p>{{ x }}</p>\", \"data\": {\"x\": 1}}]."
          },
          "pageFormat": {
            "title": "Page size",
            "enum": [
              "A4",
              "A3",
              "A5",
              "Letter",
              "Legal",
              "Tabloid",
              "custom"
            ],
            "type": "string",
            "description": "Paper size. 'custom' uses pageWidth and pageHeight. A CSS @page size in the HTML wins when 'Use CSS page size' is on.",
            "default": "A4"
          },
          "landscape": {
            "title": "Landscape",
            "type": "boolean",
            "description": "Rotate the page.",
            "default": false
          },
          "pageWidth": {
            "title": "Custom page width",
            "type": "string",
            "description": "For pageFormat custom, e.g. 100mm, 4in, 600px."
          },
          "pageHeight": {
            "title": "Custom page height",
            "type": "string",
            "description": "For pageFormat custom, e.g. 150mm, 6in, 900px."
          },
          "margin": {
            "title": "Margins",
            "type": "object",
            "description": "{\"top\": \"10mm\", \"right\": \"10mm\", \"bottom\": \"10mm\", \"left\": \"10mm\"}. Plain numbers are millimetres.",
            "default": {
              "top": "10mm",
              "right": "10mm",
              "bottom": "10mm",
              "left": "10mm"
            }
          },
          "scale": {
            "title": "Scale",
            "type": "number",
            "description": "Zoom from 0.1 to 2.",
            "default": 1
          },
          "headerTemplate": {
            "title": "Header HTML",
            "type": "string",
            "description": "Repeated on every page. Use <span class='pageNumber'></span>, <span class='totalPages'></span>, <span class='title'></span>, <span class='date'></span>. Leave room with the top margin."
          },
          "footerTemplate": {
            "title": "Footer HTML",
            "type": "string",
            "description": "Same as the header, for the bottom of every page. Example: Page <span class='pageNumber'></span> of <span class='totalPages'></span>."
          },
          "printBackground": {
            "title": "Print backgrounds",
            "type": "boolean",
            "description": "Include background colours and images.",
            "default": true
          },
          "preferCssPageSize": {
            "title": "Use CSS page size",
            "type": "boolean",
            "description": "Let a CSS @page size rule in the HTML decide the paper size.",
            "default": true
          },
          "media": {
            "title": "CSS media",
            "enum": [
              "print",
              "screen"
            ],
            "type": "string",
            "description": "Render with print styles (default) or screen styles.",
            "default": "print"
          },
          "pageRanges": {
            "title": "Page ranges",
            "type": "string",
            "description": "Keep only these pages, e.g. 1-3, 5. Empty keeps all."
          },
          "watermark": {
            "title": "Watermark text",
            "type": "string",
            "description": "Light diagonal text on every page, e.g. COPY or PAID. Max 60 characters."
          },
          "fileNameTemplate": {
            "title": "File name template",
            "type": "string",
            "description": "Name per PDF from the row data, e.g. invoice-{{ number }}. '.pdf' is added. Duplicates get -2, -3."
          },
          "fileName": {
            "title": "File name (raw HTML)",
            "type": "string",
            "description": "File name for the raw HTML document."
          },
          "mergeIntoOne": {
            "title": "Also merge into one PDF",
            "type": "boolean",
            "description": "Besides the separate files, save one combined PDF in input order. The merged file is free.",
            "default": false
          },
          "mergedFileName": {
            "title": "Merged file name",
            "type": "string",
            "description": "Name of the combined PDF.",
            "default": "merged.pdf"
          },
          "title": {
            "title": "PDF title",
            "type": "string",
            "description": "Document title stored in the PDF. Empty uses the HTML <title>."
          },
          "author": {
            "title": "PDF author",
            "type": "string",
            "description": "Author field stored in the PDF properties."
          },
          "baseUrl": {
            "title": "Base URL for relative links",
            "type": "string",
            "description": "Lets relative image and CSS paths in raw HTML load from your public site, e.g. https://yoursite.com/assets/."
          },
          "waitForSelector": {
            "title": "Wait for element",
            "type": "string",
            "description": "CSS selector to wait for before printing, for pages that draw charts with scripts."
          },
          "javaScript": {
            "title": "Run JavaScript",
            "type": "boolean",
            "description": "Turn off to print the HTML exactly as written.",
            "default": true
          },
          "delayMs": {
            "title": "Extra wait (ms)",
            "minimum": 0,
            "maximum": 30000,
            "type": "integer",
            "description": "Wait this long before printing (0-30000).",
            "default": 0
          },
          "pageTimeoutSecs": {
            "title": "Load timeout (s)",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "Maximum time to load one document (5-180).",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}