{
  "openapi": "3.0.1",
  "info": {
    "title": "HTML to PDF & URL to PDF Converter - Bulk, Headless Chrome",
    "description": "Turn web page links or raw HTML into PDF files in bulk with headless Chrome: A4/Letter, margins, landscape, backgrounds, header and footer with page numbers. Results are files with public links.",
    "version": "0.1",
    "x-build-id": "O2wV7c9RuWbM9Vo6o"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/northbell~html-to-pdf/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-northbell-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/northbell~html-to-pdf/runs": {
      "post": {
        "operationId": "runs-sync-northbell-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/northbell~html-to-pdf/run-sync": {
      "post": {
        "operationId": "run-sync-northbell-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 links",
            "type": "array",
            "description": "Web pages to turn into PDF (http or https). Or leave empty and give HTML or a Dataset ID. Pages that need a login, and private or local network addresses, come back as errors, free.",
            "items": {
              "type": "string"
            }
          },
          "html": {
            "title": "Raw HTML",
            "type": "string",
            "description": "Optional. HTML text to turn into one PDF (up to 5 MB). Scripts do not run in it unless you tick Allow scripts. Links in it (images, styles) are fetched like any page request."
          },
          "datasetId": {
            "title": "Dataset ID",
            "type": "string",
            "description": "Read page links from this Apify dataset (e.g. the dataset of a scraper run). Use {{resource.defaultDatasetId}} when you connect this Actor as an integration after another Actor."
          },
          "urlField": {
            "title": "Link field in the dataset",
            "type": "string",
            "description": "Name of the field that holds the page link. A dotted path works (page.url). The field may hold one link or a list of links; every link is converted.",
            "default": "url"
          },
          "format": {
            "title": "Paper size",
            "enum": [
              "A4",
              "Letter",
              "Legal",
              "A3"
            ],
            "type": "string",
            "description": "Page size of the PDF.",
            "default": "A4"
          },
          "landscape": {
            "title": "Landscape",
            "type": "boolean",
            "description": "Turn the pages sideways.",
            "default": false
          },
          "margins": {
            "title": "Margins",
            "type": "object",
            "description": "Page margins as lengths in mm, cm, in or px: top, right, bottom, left. Leave room at the bottom for a footer. A single text such as \"12mm\" in the JSON also works and sets all four sides.",
            "default": {
              "top": "15mm",
              "right": "12mm",
              "bottom": "18mm",
              "left": "12mm"
            }
          },
          "printBackground": {
            "title": "Print background colours and images",
            "type": "boolean",
            "description": "Without it, Chrome leaves out background colours and background images, as when printing.",
            "default": true
          },
          "mediaType": {
            "title": "CSS media",
            "enum": [
              "print",
              "screen"
            ],
            "type": "string",
            "description": "Which CSS rules apply. Print is what Chrome's Save as PDF uses; screen keeps the on-screen look of pages without a print style.",
            "default": "print"
          },
          "waitForSelector": {
            "title": "Wait for selector",
            "type": "string",
            "description": "Optional CSS selector. The PDF is made after this element is on the page (for pages that load their content with JavaScript). If it does not show up within the page timeout, the row is an error."
          },
          "waitMs": {
            "title": "Extra wait (ms)",
            "minimum": 0,
            "maximum": 30000,
            "type": "integer",
            "description": "Wait this long after the page has loaded (and after the selector), 0 to 30000.",
            "default": 0
          },
          "headerTemplate": {
            "title": "Header template",
            "type": "string",
            "description": "Optional HTML for the top of every page. Chrome fills in the classes date, title, url, pageNumber and totalPages, for example <span class=\"pageNumber\"></span>. Set a font-size in the style (Chrome's default is tiny) and keep the top margin large enough."
          },
          "footerTemplate": {
            "title": "Footer template",
            "type": "string",
            "description": "Optional HTML for the bottom of every page, same classes as the header. The prefilled footer prints \"page / total pages\". Empty: no footer (and no header unless you give one)."
          },
          "extraCss": {
            "title": "Extra CSS",
            "type": "string",
            "description": "Optional CSS added to every page before the PDF is made. Use it to hide cookie banners and pop-ups, for example #cookie-banner, .cc-window { display: none !important; }."
          },
          "onlyChanged": {
            "title": "Only changed",
            "type": "boolean",
            "description": "For scheduled runs. Keeps a hash of each page's visible text in a key-value store named html-to-pdf-seen in your account. A page whose text is the same as last time is skipped (free); a page that is new or changed gets a new dated PDF, and changed is true when it differs from last time. Applies to links, not to raw HTML.",
            "default": false
          },
          "allowScripts": {
            "title": "Allow scripts",
            "type": "boolean",
            "description": "Leave it as it is: JavaScript runs on pages from a link (most pages need it) and does not run in raw HTML. Tick or untick to set it for every input."
          },
          "lazyLoadScroll": {
            "title": "Scroll to load images",
            "type": "boolean",
            "description": "Scrolls each page down once (up to about 3 seconds) so images that load while scrolling are in the PDF. Needs scripts.",
            "default": true
          },
          "maxItems": {
            "title": "Max PDFs per run",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Cap on inputs per run, counting links, HTML and dataset together (unchanged pages count too, because the page is opened to compare). Inputs over the cap are left for the next run.",
            "default": 200
          },
          "maxPages": {
            "title": "Max pages per PDF",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "A longer page is cut off after this many PDF pages (up to 200).",
            "default": 200
          },
          "concurrency": {
            "title": "Pages at the same time",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "How many pages are open in parallel (1 to 5). Each one uses memory; the default 2 fits 2048 MB.",
            "default": 2
          },
          "timeoutSeconds": {
            "title": "Timeout per page (seconds)",
            "minimum": 5,
            "maximum": 300,
            "type": "integer",
            "description": "A page that has not loaded in this time becomes an error row (free) and the run goes on. 5 to 300.",
            "default": 60
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}