{
  "openapi": "3.0.1",
  "info": {
    "title": "HTML to PDF API: HTML or URL to PDF, A4 / Letter",
    "description": "Turn HTML or public URLs into PDF files: A4, Letter and more, margins, header and footer, page numbers, background printing. Each PDF is stored with a signed link. Empty input = free demo. $0.008 per PDF; failed conversions are not charged.",
    "version": "0.1",
    "x-build-id": "IvCOfBi9qRdYkhUEM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ucchiii~html-to-pdf/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ucchiii-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/ucchiii~html-to-pdf/runs": {
      "post": {
        "operationId": "runs-sync-ucchiii-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/ucchiii~html-to-pdf/run-sync": {
      "post": {
        "operationId": "run-sync-ucchiii-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": {
          "html": {
            "title": "HTML",
            "type": "string",
            "description": "A complete HTML document or fragment to turn into one PDF (up to 2,000,000 characters). Inline CSS works; external images and fonts are loaded only from public http(s) addresses. Leave HTML, HTML documents and URLs all empty for a free demo (a sample invoice, not charged)."
          },
          "htmlDocuments": {
            "title": "More HTML documents",
            "type": "array",
            "description": "Optional. A JSON array of HTML strings, one PDF each, for example [\"<h1>A</h1>\", \"<h1>B</h1>\"]. Counted together with HTML and URLs toward the 50-item limit per run."
          },
          "urls": {
            "title": "Public page URLs",
            "type": "array",
            "description": "Public http(s) pages to save as PDF, one PDF each. No login, cookies or custom headers. At most 50 items per run (HTML and URLs together). Social networks (Facebook, Instagram, X/Twitter, TikTok, LinkedIn, Threads) and internal addresses are refused.",
            "items": {
              "type": "string"
            }
          },
          "paperFormat": {
            "title": "Paper size",
            "enum": [
              "A4",
              "Letter",
              "Legal",
              "A3",
              "A5"
            ],
            "type": "string",
            "description": "Paper size of every page: 'A4' (default), 'Letter', 'Legal', 'A3' or 'A5'. Ignored when 'Use the page's own size' is on and the page sets @page size.",
            "default": "A4"
          },
          "landscape": {
            "title": "Landscape",
            "type": "boolean",
            "description": "Print pages sideways (wide instead of tall). Default off (portrait).",
            "default": false
          },
          "marginTopMm": {
            "title": "Top margin (mm)",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Top margin in millimetres, 0 to 50 (default 15). If a header is set, at least 15 is used so the header does not overlap the text.",
            "default": 15
          },
          "marginRightMm": {
            "title": "Right margin (mm)",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Right margin in millimetres, 0 to 50 (default 15).",
            "default": 15
          },
          "marginBottomMm": {
            "title": "Bottom margin (mm)",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Bottom margin in millimetres, 0 to 50 (default 15). If a footer or page numbers are set, at least 15 is used so the footer does not overlap the text.",
            "default": 15
          },
          "marginLeftMm": {
            "title": "Left margin (mm)",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Left margin in millimetres, 0 to 50 (default 15).",
            "default": 15
          },
          "headerTemplate": {
            "title": "Header",
            "type": "string",
            "description": "Optional text printed at the top of every page. Plain text can use {page}, {pages}, {date}, {title} and {url}, for example 'Quarterly report - {date}'. You can also pass small HTML (inline styles, data: images; no scripts). Up to 5,000 characters."
          },
          "footerTemplate": {
            "title": "Footer",
            "type": "string",
            "description": "Optional text printed at the bottom of every page, with the same {page}, {pages}, {date}, {title} and {url} placeholders, for example 'Page {page} of {pages}'. Overrides the Page numbers option. Up to 5,000 characters."
          },
          "pageNumbers": {
            "title": "Page numbers",
            "type": "boolean",
            "description": "Print 'Page 1 of 3' centered in the footer. Ignored when you set your own footer.",
            "default": false
          },
          "printBackground": {
            "title": "Print backgrounds",
            "type": "boolean",
            "description": "Print background colors and background images. On by default; turn off for plain black-on-white output that saves ink.",
            "default": true
          },
          "mediaType": {
            "title": "CSS media type",
            "enum": [
              "print",
              "screen"
            ],
            "type": "string",
            "description": "Which CSS rules apply: 'print' (default) uses @media print rules like a browser's Print dialog; 'screen' keeps the on-screen look.",
            "default": "print"
          },
          "scale": {
            "title": "Scale",
            "minimum": 0.1,
            "maximum": 2,
            "type": "number",
            "description": "Zoom of the page content, 0.1 to 2 (default 1). Use 0.8 to fit wide pages onto the paper.",
            "default": 1
          },
          "preferCssPageSize": {
            "title": "Use the page's own size",
            "type": "boolean",
            "description": "Use the paper size from the page's CSS (@page { size: ... }) instead of the Paper size option, when the page sets one. Default off.",
            "default": false
          },
          "pageRanges": {
            "title": "Page ranges",
            "type": "string",
            "description": "Optional. Keep only some pages, for example '1-3' or '1,3,5-7'. Empty (default) keeps all pages. A value that is not a valid range is ignored."
          },
          "waitUntil": {
            "title": "Wait until",
            "enum": [
              "load",
              "domcontentloaded",
              "networkidle"
            ],
            "type": "string",
            "description": "When the page counts as loaded: 'load' (default), 'domcontentloaded' (fastest) or 'networkidle' (slowest, for late content). Each item has a 45 second limit.",
            "default": "load"
          },
          "delayMs": {
            "title": "Extra delay (ms)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Wait this long after loading before printing, 0 to 10000 ms. Useful for charts and animations.",
            "default": 0
          },
          "blockAds": {
            "title": "Block ads and trackers",
            "type": "boolean",
            "description": "Block requests to a small built-in list of common ad and tracking domains. Not a complete filter.",
            "default": false
          },
          "hideCookieBanners": {
            "title": "Hide cookie banners",
            "type": "boolean",
            "description": "Hide common consent pop-ups (OneTrust, Cookiebot, Didomi, Quantcast, TrustArc, Usercentrics, CookieYes, Osano and generic cookie banners) with CSS. Nothing is clicked or accepted.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}