{
  "openapi": "3.0.1",
  "info": {
    "title": "URL to PDF Converter - Web Pages and HTML",
    "description": "Convert public web pages or your own HTML documents to PDF. Set page size, margins, orientation, scale, page ranges, headers and footers. Get a download link, page count and file size for each PDF.",
    "version": "0.0",
    "x-build-id": "nNzyRf1TOMCtKfpmF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/bite-sized-insights~url-to-pdf-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-bite-sized-insights-url-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/bite-sized-insights~url-to-pdf-converter/runs": {
      "post": {
        "operationId": "runs-sync-bite-sized-insights-url-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/bite-sized-insights~url-to-pdf-converter/run-sync": {
      "post": {
        "operationId": "run-sync-bite-sized-insights-url-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": {
          "urls": {
            "title": "Web page URLs",
            "maxItems": 100,
            "type": "array",
            "description": "Public pages to convert, one PDF each. Domain or full URL. Empty it to convert only HTML.",
            "items": {
              "type": "string",
              "maxLength": 2048
            },
            "default": [
              "https://example.com"
            ]
          },
          "htmlDocuments": {
            "title": "HTML documents",
            "maxItems": 20,
            "type": "array",
            "description": "Complete HTML documents, one PDF each. Images and styles: inline or public absolute URLs.",
            "items": {
              "type": "string",
              "maxLength": 1000000
            },
            "default": []
          },
          "pageFormat": {
            "title": "Page format",
            "enum": [
              "A4",
              "A3",
              "A5",
              "A6",
              "A2",
              "A1",
              "A0",
              "Letter",
              "Legal",
              "Tabloid",
              "Ledger"
            ],
            "type": "string",
            "description": "Paper size of the PDF. Ignored when a custom width and height are set.",
            "default": "A4"
          },
          "pageWidth": {
            "title": "Custom page width",
            "pattern": "^(0|\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm))$",
            "maxLength": 12,
            "type": "string",
            "description": "Width with a unit, e.g. <code>100mm</code>. Set with the height; replaces the format."
          },
          "pageHeight": {
            "title": "Custom page height",
            "pattern": "^(0|\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm))$",
            "maxLength": 12,
            "type": "string",
            "description": "Height with a unit, e.g. <code>150mm</code>. Set together with the width."
          },
          "landscape": {
            "title": "Landscape orientation",
            "type": "boolean",
            "description": "Print pages in landscape instead of portrait.",
            "default": false
          },
          "marginTop": {
            "title": "Top margin",
            "pattern": "^(0|\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm))$",
            "maxLength": 12,
            "type": "string",
            "description": "Margin on the top with a unit, e.g. <code>10mm</code> or <code>1in</code>.",
            "default": "10mm"
          },
          "marginRight": {
            "title": "Right margin",
            "pattern": "^(0|\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm))$",
            "maxLength": 12,
            "type": "string",
            "description": "Margin on the right with a unit, e.g. <code>10mm</code> or <code>1in</code>.",
            "default": "10mm"
          },
          "marginBottom": {
            "title": "Bottom margin",
            "pattern": "^(0|\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm))$",
            "maxLength": 12,
            "type": "string",
            "description": "Margin on the bottom with a unit, e.g. <code>10mm</code> or <code>1in</code>.",
            "default": "10mm"
          },
          "marginLeft": {
            "title": "Left margin",
            "pattern": "^(0|\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm))$",
            "maxLength": 12,
            "type": "string",
            "description": "Margin on the left with a unit, e.g. <code>10mm</code> or <code>1in</code>.",
            "default": "10mm"
          },
          "scale": {
            "title": "Scale",
            "minimum": 0.1,
            "maximum": 2,
            "type": "number",
            "description": "Zoom factor of the page content, from 0.1 (10%) to 2 (200%).",
            "default": 1
          },
          "pageRanges": {
            "title": "Page ranges",
            "pattern": "^\\d{1,4}(-\\d{1,4})?(,\\s?\\d{1,4}(-\\d{1,4})?)*$",
            "maxLength": 100,
            "type": "string",
            "description": "Keep only these pages, e.g. <code>1-3, 5</code>. Leave empty to keep all pages."
          },
          "printBackground": {
            "title": "Print backgrounds",
            "type": "boolean",
            "description": "Include background colors and images. Turn off for a plain print.",
            "default": true
          },
          "preferCssPageSize": {
            "title": "Prefer the page's own size",
            "type": "boolean",
            "description": "Use the page size set by the page's own print styles (<code>@page</code>), if any.",
            "default": false
          },
          "mediaType": {
            "title": "Stylesheet type",
            "enum": [
              "print",
              "screen"
            ],
            "type": "string",
            "description": "<b>Print</b> applies the page's print styles; <b>screen</b> keeps the on-screen look.",
            "default": "print"
          },
          "headerHtml": {
            "title": "Header (HTML)",
            "maxLength": 10000,
            "type": "string",
            "description": "HTML at the top of every page. Needs an inline font size and a big enough top margin."
          },
          "footerHtml": {
            "title": "Footer (HTML)",
            "maxLength": 10000,
            "type": "string",
            "description": "HTML at the bottom of every page, e.g. page numbers. Needs a big enough bottom margin."
          },
          "waitUntil": {
            "title": "Wait until",
            "enum": [
              "load",
              "domcontentloaded",
              "networkidle"
            ],
            "type": "string",
            "description": "When a page counts as loaded. Network idle also waits for content that loads late.",
            "default": "load"
          },
          "waitForSelector": {
            "title": "Wait for element",
            "maxLength": 200,
            "type": "string",
            "description": "CSS selector (e.g. <code>#content</code>) that must be on the page before it is converted."
          },
          "waitMs": {
            "title": "Extra wait (ms)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Pause in milliseconds after the page is ready, for animations or late content.",
            "default": 0
          },
          "timeoutSeconds": {
            "title": "Time limit per document (s)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum seconds per document, including loading and waiting. Timeouts are not charged.",
            "default": 30
          },
          "failOnHttpError": {
            "title": "Fail on page errors",
            "type": "boolean",
            "description": "Skip the PDF when the page answers with an error status such as 404 or 500.",
            "default": true
          },
          "viewportWidth": {
            "title": "Window width (px)",
            "minimum": 200,
            "maximum": 4000,
            "type": "integer",
            "description": "Width of the virtual window the page is laid out in. Responsive pages react to it.",
            "default": 1280
          },
          "viewportHeight": {
            "title": "Window height (px)",
            "minimum": 200,
            "maximum": 4000,
            "type": "integer",
            "description": "Height of the virtual window the page is laid out in.",
            "default": 1024
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}