{
  "openapi": "3.0.1",
  "info": {
    "title": "Website Scraper — Web Page HTML, Text & Screenshot API",
    "description": "Website scraper that renders pages in a real browser engine: get the rendered HTML, visible text, page title and a PNG screenshot for every URL — including JavaScript-heavy pages that plain fetchers miss. Pay per delivered page; failed pages are never charged.",
    "version": "0.5",
    "x-build-id": "rEx1WIMiFTILDj0Rh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/agentxpro~web-page-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-agentxpro-web-page-scraper",
        "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/agentxpro~web-page-scraper/runs": {
      "post": {
        "operationId": "runs-sync-agentxpro-web-page-scraper",
        "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/agentxpro~web-page-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-agentxpro-web-page-scraper",
        "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": {
          "cookies": {
            "title": "Cookies",
            "type": "array",
            "description": "Cookies to set before loading each page: an array of objects like {\"name\": \"session\", \"value\": \"abc\", \"domain\": \".example.com\"}. The domain is optional — without it the cookie is set for the page URL being loaded."
          },
          "crawlDepth": {
            "title": "Crawl depth",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Follow links found on rendered pages and scrape those pages too, up to this many levels deep (0 = only the URLs you give, 1 = also every linked page, and so on; maximum 5). Discovered pages are charged the same per-page price. Combine with Max crawl pages and the same-domain switch to keep crawls bounded.",
            "default": 0
          },
          "crawlExcludePatterns": {
            "title": "Crawl: exclude URL patterns",
            "type": "array",
            "description": "Crawling: skip discovered URLs containing any of these text fragments (for example /login or .pdf).",
            "items": {
              "type": "string"
            }
          },
          "crawlIncludePatterns": {
            "title": "Crawl: include URL patterns",
            "type": "array",
            "description": "Crawling: only follow discovered URLs containing at least one of these text fragments (for example /products/). Leave empty to follow all links that pass the other crawl filters.",
            "items": {
              "type": "string"
            }
          },
          "crawlSameDomainOnly": {
            "title": "Crawl: same domain only",
            "type": "boolean",
            "description": "Crawling: only follow links on the same domain as the starting URL they were found from.",
            "default": true
          },
          "dismissCookieBanners": {
            "title": "Dismiss cookie banners",
            "type": "boolean",
            "description": "Remove common cookie-consent banners and overlays (OneTrust, Cookiebot, Didomi and similar) before extracting content and screenshots.",
            "default": false
          },
          "headers": {
            "title": "Extra HTTP headers",
            "type": "object",
            "description": "Extra HTTP headers sent with every page load, as a JSON object of header names to values, for example {\"Accept-Language\": \"en-US\", \"X-Custom\": \"1\"}."
          },
          "includeHtml": {
            "title": "Include rendered HTML",
            "type": "boolean",
            "description": "Return the full rendered HTML (after JavaScript) as the html field.",
            "default": true
          },
          "includeImages": {
            "title": "Include image list",
            "type": "boolean",
            "description": "Add an images field: every image on the page as {url, alt}.",
            "default": false
          },
          "includeLinks": {
            "title": "Include link list",
            "type": "boolean",
            "description": "Add a links field: every link on the page as {url, text} (absolute URLs, duplicates removed).",
            "default": false
          },
          "includeMarkdown": {
            "title": "Include Markdown",
            "type": "boolean",
            "description": "Add a markdown field: the page content converted to Markdown — the format AI tools and RAG pipelines read best. With Main content only on, the Markdown is built from the extracted main content.",
            "default": false
          },
          "includeMetadata": {
            "title": "Include metadata",
            "type": "boolean",
            "description": "Add a metadata field: page title, description, keywords, author, canonical URL, language, final URL after redirects, Open Graph and Twitter card tags, JSON-LD blocks, and a word count of the visible text.",
            "default": false
          },
          "includePdf": {
            "title": "Include PDF",
            "type": "boolean",
            "description": "Add a pdfBase64 field: the page printed to PDF by the browser engine, base64-encoded.",
            "default": false
          },
          "includeScreenshot": {
            "title": "Include screenshot",
            "type": "boolean",
            "description": "Capture a PNG screenshot of the rendered page (returned base64-encoded as screenshotBase64).",
            "default": true
          },
          "includeSubdomains": {
            "title": "Map: include subdomains",
            "type": "boolean",
            "description": "Map mode only: also collect URLs on subdomains of the site (for example docs.example.com when mapping example.com). Off keeps results on the site's own host.",
            "default": false
          },
          "includeText": {
            "title": "Include visible text",
            "type": "boolean",
            "description": "Return the visible page text as the text field.",
            "default": true
          },
          "mainContent": {
            "title": "Main content only",
            "type": "boolean",
            "description": "Extract the main content block of the page (the <main> or <article> element, or the largest text block): it is returned as contentHtml, and the text and Markdown fields are built from it instead of the whole page — navigation, sidebars and footers drop out.",
            "default": false
          },
          "mapMaxUrls": {
            "title": "Map: max URLs per site",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Map mode only: the maximum number of discovered URLs returned per site. The price is the same however many URLs come back — one flat page price per site.",
            "default": 1000
          },
          "mapSearch": {
            "title": "Map: only URLs containing",
            "type": "string",
            "description": "Map mode only: return only discovered URLs that contain this text (case-insensitive) — for example pricing, /docs/ or .pdf. Leave empty to return everything found."
          },
          "maxConcurrency": {
            "title": "Max parallel pages",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many pages to render in parallel. Default 3.",
            "default": 3
          },
          "maxPages": {
            "title": "Max crawl pages",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Crawling: the maximum total number of pages to process in one run, including the starting URLs. Only applies when Crawl depth is above 0.",
            "default": 25
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "scrape",
              "map"
            ],
            "type": "string",
            "description": "Scrape renders every URL in the list and returns its content. Map treats every URL as a site and discovers its URLs instead — from the site's sitemaps and the links on its pages — returning one row per discovered URL for one flat page price per site.",
            "default": "scrape"
          },
          "removeSelectors": {
            "title": "Remove elements",
            "type": "array",
            "description": "CSS selectors for elements to delete from the page before extracting content and screenshots — for example .popup, #paywall, div.ad-slot.",
            "items": {
              "type": "string"
            }
          },
          "screenshotFormat": {
            "title": "Screenshot format",
            "enum": [
              "png",
              "jpeg",
              "webp"
            ],
            "type": "string",
            "description": "Screenshot image format."
          },
          "screenshotFullPage": {
            "title": "Full-page screenshot",
            "type": "boolean",
            "description": "Capture the full scrollable page height in the screenshot instead of just the visible viewport.",
            "default": false
          },
          "scrollToBottom": {
            "title": "Scroll to bottom",
            "type": "boolean",
            "description": "Scroll to the bottom of the page before extracting content, so lazy-loaded images and text load first.",
            "default": false
          },
          "urls": {
            "title": "URLs to render",
            "type": "array",
            "description": "List of page URLs to render. Each URL is opened in a real browser engine, its JavaScript runs, and the rendered result is returned. Works on JavaScript-heavy pages that regular website scrapers return empty. In Map mode, each URL is treated as a site whose URLs you want discovered.",
            "items": {
              "type": "string"
            }
          },
          "viewportHeight": {
            "title": "Viewport height",
            "minimum": 100,
            "maximum": 4000,
            "type": "integer",
            "description": "Browser viewport height in pixels (set together with Viewport width), for example 1080 for desktop or 844 for a phone."
          },
          "viewportWidth": {
            "title": "Viewport width",
            "minimum": 100,
            "maximum": 4000,
            "type": "integer",
            "description": "Browser viewport width in pixels (set together with Viewport height), for example 1920 for desktop or 390 for a phone."
          },
          "waitForSelector": {
            "title": "Wait for selector",
            "type": "string",
            "description": "Wait until this CSS selector exists on the page before extracting content (up to ~15 seconds), for example .product-list or #results. Extraction continues either way after the timeout."
          },
          "waitMs": {
            "title": "Extra wait after load (ms)",
            "minimum": 0,
            "maximum": 30000,
            "type": "integer",
            "description": "How long to wait after the page load event before extracting content, so late JavaScript rendering can finish. Default 2000.",
            "default": 2000
          },
          "agentContext": {
            "title": "AI agent context (agentContext)",
            "type": "boolean",
            "description": "Add an agentContext object to every delivered row: the page content as clean Markdown text ready to paste into an LLM prompt, a source block (type, URL, title), a ready-to-paste citation, an estimated token count and the retrieval time. Modelled on the response style AI-agent APIs use. Off by default; never changes charges.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}