{
  "openapi": "3.0.1",
  "info": {
    "title": "HTML to PDF Converter",
    "description": "Convert HTML content or web pages to PDF documents. Supports raw HTML strings, single URLs, and bulk URL lists. Full control over page size, margins, orientation, headers, and footers.",
    "version": "0.1",
    "x-build-id": "0vaeLOdH2QXQ8Xv71"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automation-lab~html-to-pdf-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automation-lab-html-to-pdf-converter",
        "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/automation-lab~html-to-pdf-converter/runs": {
      "post": {
        "operationId": "runs-sync-automation-lab-html-to-pdf-converter",
        "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/automation-lab~html-to-pdf-converter/run-sync": {
      "post": {
        "operationId": "run-sync-automation-lab-html-to-pdf-converter",
        "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": {
          "inputType": {
            "title": "📥 Input type",
            "enum": [
              "html",
              "url",
              "urls"
            ],
            "type": "string",
            "description": "Select what to convert: raw HTML string, a single URL, or a list of URLs.",
            "default": "url"
          },
          "html": {
            "title": "HTML content",
            "type": "string",
            "description": "Paste the HTML content to convert to PDF. Used when Input type is 'HTML string'."
          },
          "url": {
            "title": "Page URL",
            "type": "string",
            "description": "URL of the web page to convert to PDF. Used when Input type is 'Single URL'."
          },
          "urls": {
            "title": "List of URLs",
            "maxItems": 20,
            "type": "array",
            "description": "List of up to 20 public HTTP(S) page URLs. Each input produces one dataset row and each successful URL becomes a separate PDF.",
            "items": {
              "type": "string"
            }
          },
          "pageFormat": {
            "title": "📐 Page format",
            "enum": [
              "A4",
              "A3",
              "A5",
              "Letter",
              "Legal",
              "Tabloid"
            ],
            "type": "string",
            "description": "Paper size for the PDF output.",
            "default": "A4"
          },
          "landscape": {
            "title": "Landscape orientation",
            "type": "boolean",
            "description": "Enable landscape (horizontal) orientation. Default is portrait (vertical).",
            "default": false
          },
          "marginTop": {
            "title": "Margin top",
            "type": "string",
            "description": "Top margin of the PDF page. Use CSS units: px, mm, cm, in (e.g. '10mm', '1cm', '0.5in').",
            "default": "10mm"
          },
          "marginBottom": {
            "title": "Margin bottom",
            "type": "string",
            "description": "Bottom margin of the PDF page. Use CSS units: px, mm, cm, in.",
            "default": "10mm"
          },
          "marginLeft": {
            "title": "Margin left",
            "type": "string",
            "description": "Left margin of the PDF page. Use CSS units: px, mm, cm, in.",
            "default": "10mm"
          },
          "marginRight": {
            "title": "Margin right",
            "type": "string",
            "description": "Right margin of the PDF page. Use CSS units: px, mm, cm, in.",
            "default": "10mm"
          },
          "printBackground": {
            "title": "Print background",
            "type": "boolean",
            "description": "Include background colors and images in the PDF. Disable for plain text output.",
            "default": true
          },
          "scale": {
            "title": "Scale",
            "minimum": 0.1,
            "maximum": 2,
            "type": "number",
            "description": "Scale factor for the web page rendering. 1 = 100% (default), 0.5 = 50%, 2 = 200%.",
            "default": 1
          },
          "headerTemplate": {
            "title": "📝 Header HTML",
            "type": "string",
            "description": "HTML template for page header. Use CSS classes: .pageNumber (current page), .totalPages (total pages), .date, .title, .url. Leave empty for no header.",
            "default": ""
          },
          "footerTemplate": {
            "title": "Footer HTML",
            "type": "string",
            "description": "HTML template for page footer. Use CSS classes: .pageNumber, .totalPages, .date, .title, .url. Leave empty for no footer.",
            "default": ""
          },
          "displayHeaderFooter": {
            "title": "Display header/footer",
            "type": "boolean",
            "description": "Show header and footer templates. Must be enabled for headerTemplate or footerTemplate to appear.",
            "default": false
          },
          "waitForSelector": {
            "title": "⏳ Wait for element",
            "type": "string",
            "description": "CSS selector to wait for before generating PDF. Useful for pages that load content dynamically. Leave empty to generate immediately.",
            "default": ""
          },
          "failOnSelectorTimeout": {
            "title": "Fail when selector is missing",
            "type": "boolean",
            "description": "When enabled, a missing waitForSelector fails that item instead of warning and continuing.",
            "default": false
          },
          "waitForTimeout": {
            "title": "Additional wait (ms)",
            "minimum": 0,
            "maximum": 30000,
            "type": "integer",
            "description": "Additional time to wait after readiness and selector checks before generating the PDF.",
            "default": 0
          },
          "waitUntil": {
            "title": "Page readiness",
            "enum": [
              "domcontentloaded",
              "load",
              "networkidle"
            ],
            "type": "string",
            "description": "Navigation milestone required before selector and additional waits begin. Default load waits for the page load event without requiring background requests to stop. Choose networkidle explicitly only for pages whose network activity becomes idle; use waitForSelector for dynamic content.",
            "default": "load"
          },
          "navigationTimeoutSecs": {
            "title": "Navigation timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum time for each URL or HTML document to reach the selected readiness milestone.",
            "default": 60
          },
          "maxConcurrency": {
            "title": "Batch concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Maximum number of isolated pages converted at once. Applies to URL batches.",
            "default": 2
          },
          "outputFileName": {
            "title": "Output filename prefix",
            "type": "string",
            "description": "Prefix for the PDF filename stored in key-value store. Files are named {prefix}-{index}.pdf or {prefix}.pdf for single items.",
            "default": "output"
          },
          "fullPage": {
            "title": "Full page height",
            "type": "boolean",
            "description": "Set PDF height to full scrollable page height instead of fixed page format size.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}