{
  "openapi": "3.0.1",
  "info": {
    "title": "HTML to PDF & URL to PDF Converter (Chromium)",
    "description": "Convert any webpage URL or raw HTML to PDF with headless Chromium. Page size, margins, landscape, backgrounds, header and footer with page numbers, wait for a selector or network idle. Invoices, reports, articles. $0.003 per PDF.",
    "version": "0.1",
    "x-build-id": "zab7GWX3tOMPgqYCq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/brasspage~html-to-pdf/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-brasspage-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/brasspage~html-to-pdf/runs": {
      "post": {
        "operationId": "runs-sync-brasspage-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/brasspage~html-to-pdf/run-sync": {
      "post": {
        "operationId": "run-sync-brasspage-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": "Page URLs",
            "type": "array",
            "description": "Public http or https webpages. Each one becomes one PDF. Private, local and cloud metadata addresses are blocked.",
            "items": {
              "type": "string"
            }
          },
          "html": {
            "title": "Raw HTML",
            "type": "string",
            "description": "Optional. Paste a full HTML document (an invoice, a report, an email) to turn it into one more PDF. Up to 5 MB. Images, CSS and fonts it links to are loaded from public http or https URLs only."
          },
          "pageFormat": {
            "title": "Page size",
            "enum": [
              "A4",
              "Letter",
              "Legal",
              "A3",
              "A5",
              "Tabloid"
            ],
            "type": "string",
            "description": "Paper size of every page: A4, Letter, Legal, A3, A5 or Tabloid.",
            "default": "A4"
          },
          "landscape": {
            "title": "Landscape",
            "type": "boolean",
            "description": "On: pages are wider than tall. Off (default): portrait.",
            "default": false
          },
          "printBackground": {
            "title": "Print backgrounds",
            "type": "boolean",
            "description": "On: keep background colors and images, like the page looks on screen.",
            "default": true
          },
          "marginTop": {
            "title": "Top margin",
            "type": "string",
            "description": "A number and a unit: mm, cm, in or px. For example 10mm.",
            "default": "1cm"
          },
          "marginRight": {
            "title": "Right margin",
            "type": "string",
            "description": "A number and a unit: mm, cm, in or px. For example 10mm.",
            "default": "1cm"
          },
          "marginBottom": {
            "title": "Bottom margin",
            "type": "string",
            "description": "A number and a unit: mm, cm, in or px. Make it bigger (2cm) if you add a footer.",
            "default": "1cm"
          },
          "marginLeft": {
            "title": "Left margin",
            "type": "string",
            "description": "A number and a unit: mm, cm, in or px. For example 10mm.",
            "default": "1cm"
          },
          "scale": {
            "title": "Scale",
            "type": "string",
            "description": "Zoom of the page content, from 0.1 to 2. Use 0.8 to fit wide pages.",
            "default": "1"
          },
          "headerTemplate": {
            "title": "Header HTML",
            "type": "string",
            "description": "Optional. HTML printed at the top of every page. These classes are filled in: date, title, url, pageNumber, totalPages. Example: <div style=\"font-size:9px;width:100%;text-align:center\"><span class=\"title\"></span></div>. Set a font-size; the default is tiny."
          },
          "footerTemplate": {
            "title": "Footer HTML",
            "type": "string",
            "description": "Optional. HTML printed at the bottom of every page. Example: <div style=\"font-size:9px;width:100%;text-align:center\">Page <span class=\"pageNumber\"></span> of <span class=\"totalPages\"></span></div>"
          },
          "waitUntil": {
            "title": "Wait until",
            "enum": [
              "load",
              "domcontentloaded",
              "networkidle"
            ],
            "type": "string",
            "description": "When to print. Use network idle for single page apps and charts.",
            "default": "load"
          },
          "waitForSelector": {
            "title": "Wait for selector",
            "type": "string",
            "description": "Optional. A CSS selector, for example #invoice-total. The PDF is made after it appears."
          },
          "cssMediaType": {
            "title": "CSS media type",
            "enum": [
              "print",
              "screen"
            ],
            "type": "string",
            "description": "Print uses the site's print CSS, which often hides menus and ads.",
            "default": "print"
          },
          "preferCssPageSize": {
            "title": "Use CSS page size",
            "type": "boolean",
            "description": "On: a CSS @page size in the HTML wins over Page size.",
            "default": false
          },
          "javascript": {
            "title": "Run JavaScript",
            "type": "boolean",
            "description": "Off: faster, and safer for HTML you did not write, but pages that build content with JavaScript come out empty.",
            "default": true
          },
          "timeoutSecs": {
            "title": "Timeout per page (seconds)",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "A page that takes longer fails, and is not charged.",
            "default": 60
          },
          "maxPages": {
            "title": "Max PDF pages",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Longer documents are cut at this many pages, and the item says so.",
            "default": 100
          },
          "maxPdfsPerRun": {
            "title": "Max PDFs per run",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Safety limit. On the Apify free plan a run creates up to 25 PDFs.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}