{
  "openapi": "3.0.1",
  "info": {
    "title": "Screenshot & PDF API",
    "description": "Use this when you need bulk website screenshots or PDFs of any URL as PNG, JPEG, WebP or PDF. Supports full-page, element and mobile viewports, plus cookie-banner hiding. Input a list of URLs. Failed captures are not billed. $2 per 1,000 successful captures. Not a text or product scraper.",
    "version": "1.0",
    "x-build-id": "iwd5BJmSZLaMKE6f7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/henryklimes~screenshot-pdf/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-henryklimes-screenshot-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/henryklimes~screenshot-pdf/runs": {
      "post": {
        "operationId": "runs-sync-henryklimes-screenshot-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/henryklimes~screenshot-pdf/run-sync": {
      "post": {
        "operationId": "run-sync-henryklimes-screenshot-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",
        "required": [
          "urls",
          "outputFormats"
        ],
        "properties": {
          "urls": {
            "title": "URLs",
            "minItems": 1,
            "type": "array",
            "description": "List of URLs to capture as screenshots or PDFs",
            "items": {
              "type": "string"
            }
          },
          "outputFormats": {
            "title": "Output Formats",
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "Capture formats (at least one required)",
            "items": {
              "type": "string",
              "enum": [
                "png",
                "jpeg",
                "webp",
                "pdf"
              ]
            }
          },
          "viewportPreset": {
            "title": "Viewport Preset",
            "enum": [
              "desktop",
              "tablet",
              "mobile",
              "custom"
            ],
            "type": "string",
            "description": "Device viewport preset (use this or custom width/height)",
            "default": "desktop"
          },
          "viewportWidth": {
            "title": "Viewport Width (custom)",
            "minimum": 320,
            "maximum": 3840,
            "type": "integer",
            "description": "Custom viewport width in pixels (only used if preset is 'custom')",
            "default": 1920
          },
          "viewportHeight": {
            "title": "Viewport Height (custom)",
            "minimum": 240,
            "maximum": 2160,
            "type": "integer",
            "description": "Custom viewport height in pixels (only used if preset is 'custom')",
            "default": 1080
          },
          "fullPage": {
            "title": "Full Page",
            "type": "boolean",
            "description": "Capture the entire page (scroll down) or just viewport",
            "default": true
          },
          "waitStrategy": {
            "title": "Wait Strategy",
            "enum": [
              "load",
              "networkidle",
              "delay",
              "selector"
            ],
            "type": "string",
            "description": "When to take the screenshot",
            "default": "load"
          },
          "waitDelay": {
            "title": "Wait Delay (ms)",
            "minimum": 0,
            "maximum": 30000,
            "type": "integer",
            "description": "Fixed delay in milliseconds before capture (used when waitStrategy is 'delay')",
            "default": 2000
          },
          "waitSelector": {
            "title": "Wait for Selector",
            "type": "string",
            "description": "CSS selector to wait for before capture (used when waitStrategy is 'selector')"
          },
          "captureSelector": {
            "title": "Capture Selector (optional)",
            "type": "string",
            "description": "CSS selector to capture only a specific element (instead of full page)"
          },
          "hideCookieBanners": {
            "title": "Hide Cookie Banners",
            "type": "boolean",
            "description": "Best-effort attempt to hide common cookie consent banners",
            "default": true
          },
          "darkMode": {
            "title": "Dark Mode",
            "type": "boolean",
            "description": "Emulate dark mode (prefers-color-scheme: dark)",
            "default": false
          },
          "customCss": {
            "title": "Custom CSS (optional)",
            "type": "string",
            "description": "Inject custom CSS before capture"
          },
          "customJavaScript": {
            "title": "Custom JavaScript (optional)",
            "type": "string",
            "description": "Execute custom JavaScript before capture (function body)"
          },
          "scrollToTriggerLazyLoad": {
            "title": "Scroll to Trigger Lazy Load",
            "type": "boolean",
            "description": "Slowly scroll down the page to trigger lazy-loaded images",
            "default": false
          },
          "blockResources": {
            "title": "Block Heavy Resources",
            "type": "boolean",
            "description": "Block fonts and video/audio to speed up capture (keeps images)",
            "default": true
          },
          "imageQuality": {
            "title": "Image Quality",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "JPEG/WebP quality (1-100, PNG ignores this)",
            "default": 90
          },
          "pdfFormat": {
            "title": "PDF Page Format",
            "enum": [
              "A4",
              "Letter",
              "Legal"
            ],
            "type": "string",
            "description": "PDF page size (only used when PDF is in outputFormats)",
            "default": "A4"
          },
          "pdfLandscape": {
            "title": "PDF Landscape",
            "type": "boolean",
            "description": "Use landscape orientation for PDFs",
            "default": false
          },
          "pdfPrintBackground": {
            "title": "PDF Print Background",
            "type": "boolean",
            "description": "Include background graphics in PDFs",
            "default": true
          },
          "pdfMargin": {
            "title": "PDF Margin (optional)",
            "type": "string",
            "description": "PDF margin (e.g., '10mm', '0.5in')"
          },
          "timeout": {
            "title": "Timeout per URL (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum time to wait for each URL before failing",
            "default": 30
          },
          "maxConcurrency": {
            "title": "Max Concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum number of concurrent browser pages",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration (optional)",
            "type": "object",
            "description": "Apify Proxy configuration (leave empty for no proxy)"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}