{
  "openapi": "3.0.1",
  "info": {
    "title": "Universal Web Printer",
    "description": "A powerful web rendering Actor that converts URLs and HTML to PDF, PNG, JPEG, or WebP. Features smart scroll-stitch for full-page captures, element-level extraction, reading mode, watermark and PDF merging.",
    "version": "0.0",
    "x-build-id": "AGODH1llU37miX6cQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/autofacts~universal-web-printer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-autofacts-universal-web-printer",
        "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/autofacts~universal-web-printer/runs": {
      "post": {
        "operationId": "runs-sync-autofacts-universal-web-printer",
        "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/autofacts~universal-web-printer/run-sync": {
      "post": {
        "operationId": "run-sync-autofacts-universal-web-printer",
        "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",
        "required": [
          "sourceType"
        ],
        "properties": {
          "sourceType": {
            "title": "Source Type",
            "enum": [
              "url",
              "html"
            ],
            "type": "string",
            "description": "Choose whether to render from URL(s) or raw HTML string",
            "default": "url"
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "List of URLs to render (required when Source Type is 'url')",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "htmlContent": {
            "title": "HTML Content",
            "type": "string",
            "description": "Raw HTML string to render (required when Source Type is 'html')"
          },
          "baseUrl": {
            "title": "Base URL",
            "type": "string",
            "description": "Base URL for resolving relative paths in HTML content"
          },
          "outputFormat": {
            "title": "Output Format",
            "enum": [
              "pdf",
              "png",
              "jpeg",
              "webp"
            ],
            "type": "string",
            "description": "Choose the output file format",
            "default": "pdf"
          },
          "viewMode": {
            "title": "View Mode",
            "enum": [
              "viewport",
              "full-page",
              "selector",
              "readability"
            ],
            "type": "string",
            "description": "How to capture the page: viewport only, full page with smart scroll, specific element, or reading mode",
            "default": "viewport"
          },
          "viewportWidth": {
            "title": "Viewport Width",
            "minimum": 320,
            "maximum": 6000,
            "type": "integer",
            "description": "Browser viewport width in pixels",
            "default": 1920
          },
          "viewportHeight": {
            "title": "Viewport Height",
            "minimum": 240,
            "maximum": 6000,
            "type": "integer",
            "description": "Browser viewport height in pixels",
            "default": 1080
          },
          "scaleFactor": {
            "title": "Scale Factor",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "Device Scale Factor (DPR) for higher quality screenshots (1=Standard, 2=Retina)",
            "default": 2
          },
          "imageQuality": {
            "title": "Image Quality",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Quality of the image (1-100) for JPEG/WebP formats",
            "default": 80
          },
          "paperFormat": {
            "title": "Paper Format",
            "enum": [
              "A4",
              "A3",
              "Letter",
              "Legal",
              "Tabloid"
            ],
            "type": "string",
            "description": "PDF paper size",
            "default": "A4"
          },
          "printBackground": {
            "title": "Print Background",
            "type": "boolean",
            "description": "Include background colors and images in PDF output",
            "default": true
          },
          "mergePdfs": {
            "title": "Merge PDFs",
            "type": "boolean",
            "description": "Merge all generated PDFs into a single file",
            "default": false
          },
          "pdfPassword": {
            "title": "PDF Password",
            "type": "string",
            "description": "Password to encrypt the PDF output"
          },
          "smartScroll": {
            "title": "Smart Scroll",
            "type": "boolean",
            "description": "Enable smart scrolling to trigger lazy-loaded content before capture",
            "default": true
          },
          "scrollDelay": {
            "title": "Scroll Delay (ms)",
            "minimum": 100,
            "maximum": 5000,
            "type": "integer",
            "description": "Wait time after each scroll step (in milliseconds)",
            "default": 500
          },
          "waitForSelector": {
            "title": "Wait For Selector",
            "type": "string",
            "description": "Wait for this CSS selector to appear before capturing"
          },
          "targetSelector": {
            "title": "Target Selector",
            "type": "string",
            "description": "CSS selector for the element to capture (required when View Mode is 'selector')"
          },
          "removeSelectors": {
            "title": "Remove Selectors",
            "type": "array",
            "description": "CSS selectors of elements to remove before capture (e.g., cookie banners, ads)",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "clickSelectors": {
            "title": "Click Selectors",
            "type": "array",
            "description": "CSS selectors of elements to click before capture (e.g., 'Load More' buttons)",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "hideFixedElements": {
            "title": "Hide Fixed Elements",
            "type": "boolean",
            "description": "Hide fixed/sticky positioned elements (navbars, floating buttons) during capture",
            "default": true
          },
          "customCss": {
            "title": "Custom CSS",
            "type": "string",
            "description": "Custom CSS to inject before rendering"
          },
          "watermark": {
            "title": "Watermark Configuration",
            "type": "object",
            "description": "Add watermark to output files",
            "properties": {
              "type": {
                "title": "Watermark Type",
                "type": "string",
                "enum": [
                  "text",
                  "image"
                ],
                "description": "Type of watermark"
              },
              "text": {
                "title": "Text Content",
                "type": "string",
                "description": "Text content for text watermark"
              },
              "imageUrl": {
                "title": "Image URL",
                "type": "string",
                "description": "URL for image watermark"
              },
              "opacity": {
                "title": "Opacity",
                "type": "integer",
                "minimum": 0,
                "maximum": 100,
                "description": "Opacity percentage (0-100)"
              },
              "color": {
                "title": "Text Color",
                "type": "string",
                "description": "Color for text watermark"
              },
              "size": {
                "title": "Size",
                "type": "integer",
                "description": "Font size for text or scale factor for image"
              },
              "position": {
                "title": "Position",
                "type": "string",
                "enum": [
                  "center",
                  "top-left",
                  "top-right",
                  "bottom-left",
                  "bottom-right",
                  "tile"
                ],
                "description": "Position of the watermark"
              },
              "rotation": {
                "title": "Rotation",
                "type": "integer",
                "description": "Rotation angle in degrees"
              }
            }
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Select proxies to be used by your crawler."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}