{
  "openapi": "3.0.1",
  "info": {
    "title": "HTML to PDF, URL to PDF & Markdown to PDF (Bulk, Templates)",
    "description": "Turn web pages, HTML or Markdown into PDFs in bulk with headless Chrome: A4/Letter, margins, landscape, backgrounds, page numbers. Fill one HTML template from your data to make hundreds of invoices, certificates or tickets. Pay per PDF.",
    "version": "0.0",
    "x-build-id": "oM3eZ8mE9qZbMPsxO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/toowl~html-to-pdf/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-toowl-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/toowl~html-to-pdf/runs": {
      "post": {
        "operationId": "runs-sync-toowl-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/toowl~html-to-pdf/run-sync": {
      "post": {
        "operationId": "run-sync-toowl-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": "Pages to save as PDF, exactly as Chrome prints them (one PDF per URL).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "markdown": {
            "title": "Markdown",
            "type": "string",
            "description": "One Markdown document (GitHub flavour: tables, task lists, code). Becomes a clean paper-style PDF."
          },
          "html": {
            "title": "HTML",
            "type": "string",
            "description": "One full HTML document, CSS included. Remote images and fonts are loaded."
          },
          "documents": {
            "title": "Documents (bulk)",
            "type": "array",
            "description": "Many documents at once: [{ \"html\": \"…\", \"name\": \"invoice-1042\" }, { \"markdown\": \"# Hi\" }, { \"url\": \"https://…\" }]. The name becomes the file name."
          },
          "template": {
            "title": "HTML template",
            "type": "string",
            "description": "Mail-merge: one PDF per object in Records. {{field}} is replaced by that record's value (HTML-escaped), {{{field}}} inserts raw HTML, {{customer.name}} reaches nested values."
          },
          "records": {
            "title": "Records",
            "type": "array",
            "description": "Data for the template, one object per PDF. A fileName (or name / id) field names the file."
          },
          "format": {
            "title": "Paper 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 (good for wide tables and dashboards).",
            "default": false
          },
          "marginMm": {
            "title": "Margin (mm)",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Blank border around every page.",
            "default": 12
          },
          "pageNumbers": {
            "title": "Page numbers",
            "type": "boolean",
            "description": "Adds \"1 / 5\" at the bottom of every page.",
            "default": false
          },
          "printBackground": {
            "title": "Print backgrounds",
            "type": "boolean",
            "description": "Keep background colours and images (off = what a browser prints by default).",
            "default": true
          },
          "scale": {
            "title": "Scale",
            "type": "string",
            "description": "Zoom of the content, 0.1–2 (e.g. 0.8 fits wide pages).",
            "default": "1"
          },
          "font": {
            "title": "Markdown font",
            "enum": [
              "sans",
              "serif"
            ],
            "type": "string",
            "description": "Typeface for Markdown documents.",
            "default": "sans"
          },
          "preferCssPageSize": {
            "title": "Use the page's own @page size",
            "type": "boolean",
            "description": "If the HTML sets @page { size: … }, use that instead of Paper size.",
            "default": false
          },
          "media": {
            "title": "CSS media",
            "enum": [
              "print",
              "screen"
            ],
            "type": "string",
            "description": "print uses the site's print stylesheet; screen makes the PDF look like the page on screen.",
            "default": "print"
          },
          "waitUntil": {
            "title": "Wait until",
            "enum": [
              "networkidle",
              "load",
              "domcontentloaded"
            ],
            "type": "string",
            "description": "When the page counts as loaded. Network idle waits for late images and scripts.",
            "default": "networkidle"
          },
          "waitMs": {
            "title": "Extra wait (ms)",
            "minimum": 0,
            "maximum": 30000,
            "type": "integer",
            "description": "Wait this long after loading, for animations or charts.",
            "default": 0
          },
          "hideSelectors": {
            "title": "Hide elements (CSS selectors)",
            "type": "array",
            "description": "Cookie banners, chat bubbles, ads… e.g. #cookie-banner, .intercom-launcher",
            "items": {
              "type": "string"
            }
          },
          "viewportWidth": {
            "title": "Viewport width (px)",
            "minimum": 320,
            "maximum": 3840,
            "type": "integer",
            "description": "Window width the page is laid out in before printing (affects responsive sites).",
            "default": 1280
          },
          "locale": {
            "title": "Browser language",
            "type": "string",
            "description": "Accept-Language sent to web pages (e.g. id-ID), for sites that switch language.",
            "default": "en-US"
          },
          "timeoutSecs": {
            "title": "Timeout per document (s)",
            "minimum": 10,
            "maximum": 180,
            "type": "integer",
            "description": "A document that takes longer fails (and is not charged).",
            "default": 60
          },
          "zip": {
            "title": "Bundle into one ZIP",
            "type": "boolean",
            "description": "With more than one PDF, also saves pdfs.zip.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}