{
  "openapi": "3.0.1",
  "info": {
    "title": "Website Screenshot & PDF: Mobile, Dark Mode, Markdown",
    "description": "Website screenshot and PDF capture for supplied public URLs and viewports. Optionally extract Markdown; save files with links and capture metadata in JSON dataset rows.",
    "version": "0.1",
    "x-build-id": "q1XVSLGPe95FhHRDX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/grit-77~website-screenshot-pdf-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-grit-77-website-screenshot-pdf-markdown",
        "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/grit-77~website-screenshot-pdf-markdown/runs": {
      "post": {
        "operationId": "runs-sync-grit-77-website-screenshot-pdf-markdown",
        "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/grit-77~website-screenshot-pdf-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-grit-77-website-screenshot-pdf-markdown",
        "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"
        ],
        "properties": {
          "urls": {
            "title": "URLs",
            "type": "array",
            "description": "Pages to capture. Plain URLs (https:// optional) or {\"url\": ...} objects.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "formats": {
            "title": "Formats",
            "type": "array",
            "description": "One load of the page can produce several files. PDF uses print layout (see pdfMedia).",
            "items": {
              "type": "string",
              "enum": [
                "png",
                "jpeg",
                "webp",
                "pdf"
              ]
            },
            "default": [
              "png"
            ]
          },
          "viewports": {
            "title": "Viewport presets",
            "type": "array",
            "description": "desktop 1440 px, laptop 1280 px, tablet 768 px (iPad emulation), mobile 390 px (iPhone emulation: touch, mobile user agent). Each preset is a separate capture.",
            "items": {
              "type": "string",
              "enum": [
                "desktop",
                "laptop",
                "tablet",
                "mobile"
              ]
            },
            "default": [
              "desktop"
            ]
          },
          "colorScheme": {
            "title": "Color scheme",
            "enum": [
              "light",
              "dark"
            ],
            "type": "string",
            "description": "Sets prefers-color-scheme. Dark only changes sites that ship a dark stylesheet. Choose several via colorSchemes in JSON input.",
            "default": "light"
          },
          "fullPage": {
            "title": "Full page",
            "type": "boolean",
            "description": "Capture the whole scrollable page instead of just the first screen. Ignored for clipSelector.",
            "default": true
          },
          "deviceScaleFactor": {
            "title": "Device scale factor",
            "minimum": 0.5,
            "maximum": 3,
            "type": "number",
            "description": "Pixel density: 1 = normal, 2 = retina (4x the pixels and a bigger file).",
            "default": 1
          },
          "maxHeight": {
            "title": "Maximum image height (CSS px)",
            "minimum": 500,
            "maximum": 32000,
            "type": "integer",
            "description": "Taller pages are cut at this height and flagged truncated=true. Chromium cannot render beyond ~16000 device pixels, so the cap is also limited by deviceScaleFactor.",
            "default": 16000
          },
          "imageQuality": {
            "title": "JPEG / WebP quality",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "1-100.",
            "default": 80
          },
          "returnMarkdown": {
            "title": "Return page text as Markdown",
            "type": "boolean",
            "description": "Adds the main text of the page (headings, paragraphs, lists, tables, links) as Markdown next to the screenshot - ready for LLM context. Billed as the 'markdown' event.",
            "default": false
          },
          "waitUntil": {
            "title": "Wait until",
            "enum": [
              "commit",
              "domcontentloaded",
              "load",
              "networkidle"
            ],
            "type": "string",
            "description": "Navigation event to wait for. 'networkidle' waits until the network is quiet for 500 ms and can be slow on chatty sites.",
            "default": "load"
          },
          "delayMs": {
            "title": "Extra delay (ms)",
            "minimum": 0,
            "maximum": 120000,
            "type": "integer",
            "description": "Wait this long after load (and after scrolling) before capturing, for animations and late widgets.",
            "default": 0
          },
          "waitForSelector": {
            "title": "Wait for selector",
            "type": "string",
            "description": "CSS selector that must appear before capturing."
          },
          "scrollToBottom": {
            "title": "Scroll to bottom first",
            "type": "boolean",
            "description": "Scrolls the page in steps so lazy-loaded images and infinite sections render before a full-page capture.",
            "default": false
          },
          "clipSelector": {
            "title": "Clip to element (CSS selector)",
            "type": "string",
            "description": "Capture only this element (first match) instead of the page. PNG / JPEG / WebP only."
          },
          "hideSelectors": {
            "title": "Hide elements (CSS selectors)",
            "type": "array",
            "description": "Elements matching these selectors get display:none before capture, e.g. .chat-widget, #promo-bar.",
            "items": {
              "type": "string"
            }
          },
          "blockCookieBanners": {
            "title": "Hide cookie banners",
            "type": "boolean",
            "description": "Hides common consent banners and overlays (OneTrust, Cookiebot, Didomi, Usercentrics, Quantcast, generic patterns). They are only hidden, never clicked, so no consent is given.",
            "default": true
          },
          "blockAds": {
            "title": "Block ads and trackers",
            "type": "boolean",
            "description": "Aborts requests to common ad and tracker domains. Faster loads and no ad slots; some layouts leave blank space where ads were.",
            "default": false
          },
          "pdfFormat": {
            "title": "PDF paper size",
            "enum": [
              "A4",
              "A3",
              "A5",
              "Letter",
              "Legal",
              "Tabloid"
            ],
            "type": "string",
            "description": "Paper size for PDF output.",
            "default": "A4"
          },
          "pdfMedia": {
            "title": "PDF stylesheet",
            "enum": [
              "print",
              "screen"
            ],
            "type": "string",
            "description": "'print' uses the site's print CSS (usual for articles). 'screen' keeps the on-screen look.",
            "default": "print"
          },
          "timeoutSecs": {
            "title": "Timeout per page (s)",
            "minimum": 5,
            "maximum": 300,
            "type": "integer",
            "description": "Navigation and selector timeout.",
            "default": 60
          },
          "maxItems": {
            "title": "Max URLs",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Only the first N URLs are processed. Each URL x viewport x color scheme is one page load; each requested format is one billed file.",
            "default": 100
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Pages captured in parallel (each uses roughly 200-400 MB). 3 is safe on 1 GB, use 6-8 with 4 GB.",
            "default": 3
          },
          "maxRetries": {
            "title": "Retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Extra attempts with exponential backoff for timeouts, network errors, 429 and 5xx. 404 and other client errors are not retried.",
            "default": 2
          },
          "locale": {
            "title": "Browser language",
            "type": "string",
            "description": "e.g. en-US, de-DE. Sets Accept-Language and navigator.language."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Leave off unless a site blocks datacenter IPs."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}