{
  "openapi": "3.0.1",
  "info": {
    "title": "Website Screenshot API + Markdown · AgentShot",
    "description": "Website screenshot API for AI agents and developers: capture any URL as a full-page or viewport screenshot (PNG, JPEG, WebP), plus an optional PDF and clean markdown with page metadata, in one call. Mobile presets, element capture, cookie banners hidden. Pay only for successful captures.",
    "version": "1.0",
    "x-build-id": "l41N0TmghGA201aBA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/roosch~agentshot/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-roosch-agentshot",
        "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/roosch~agentshot/runs": {
      "post": {
        "operationId": "runs-sync-roosch-agentshot",
        "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/roosch~agentshot/run-sync": {
      "post": {
        "operationId": "run-sync-roosch-agentshot",
        "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, one per item. Each item may be a string URL (e.g. \"https://example.com\" or \"stripe.com/pricing\") or an object with a \"url\" field (as some crawlers emit). https:// is added if missing. Duplicates are removed. Private/local addresses are refused. Max 1,000 per run by default (see maxUrls). The Console list editor accepts strings; objects work via the API.",
            "items": {
              "type": "string"
            },
            "default": [
              "https://apify.com"
            ]
          },
          "receipt": {
            "title": "Capture receipt",
            "type": "boolean",
            "description": "Add a 'receipt' object to each successful row: capture time (UTC), the settings that shaped the capture, and the SHA-256 hash and size of every saved file (screenshot, PDF, markdown). Useful as an audit trail, or to check a file still matches what this run saved. Self-reported by the run, not a signed timestamp. Free.",
            "default": false
          },
          "snapshot": {
            "title": "Agent snapshot (markdown + metadata)",
            "type": "boolean",
            "description": "Also return the page's main content as clean markdown plus metadata (title, description, canonical URL, language, Open Graph/Twitter tags, headings, link counts, word count) in the same dataset row. Best for AI agents and RAG: one call gives you what the page looks like and what it says. Adds the 'snapshot' event ($0.002) only when extraction succeeds.",
            "default": false
          },
          "maxMarkdownChars": {
            "title": "Max markdown characters in the dataset",
            "minimum": 1000,
            "maximum": 200000,
            "type": "integer",
            "description": "Caps the 'markdown' field so it fits an LLM context window (30,000 chars ≈ 7–8k tokens). The full text is always saved and linked via 'markdownUrl'.",
            "default": 30000
          },
          "markdownImages": {
            "title": "Keep images in markdown",
            "type": "boolean",
            "description": "Include ![alt](url) image links in the markdown. Off by default to keep text compact.",
            "default": false
          },
          "devicePreset": {
            "title": "Device preset",
            "enum": [
              "none",
              "desktop-1080p",
              "desktop-1440",
              "laptop-1366",
              "desktop-retina",
              "iphone-15",
              "iphone-se",
              "pixel-7",
              "galaxy-s9",
              "ipad-pro",
              "ipad-mini"
            ],
            "type": "string",
            "description": "Emulate a device: viewport, pixel ratio, mobile user agent and touch. 'none' uses width/height. Example: 'iphone-15' for a mobile view.",
            "default": "none"
          },
          "width": {
            "title": "Width (px)",
            "minimum": 200,
            "maximum": 3840,
            "type": "integer",
            "description": "Viewport width in px when devicePreset is 'none'. Example: 1440.",
            "default": 1280
          },
          "height": {
            "title": "Height (px)",
            "minimum": 200,
            "maximum": 8000,
            "type": "integer",
            "description": "Viewport height in px when devicePreset is 'none'. The image is exactly this tall unless fullPage is true. Example: 900.",
            "default": 800
          },
          "fullPage": {
            "title": "Full page",
            "type": "boolean",
            "description": "Capture the whole scrollable page: stitched, lazy content loaded, sticky headers shown once. Adds the 'full-page' event ($0.002).",
            "default": false
          },
          "maxFullPageHeight": {
            "title": "Max full-page height (px)",
            "minimum": 500,
            "maximum": 30000,
            "type": "integer",
            "description": "Safety cap for infinite-scroll pages. Taller pages are cut and flagged as truncated.",
            "default": 15000
          },
          "fixStickyElements": {
            "title": "Show sticky/fixed headers only once",
            "type": "boolean",
            "description": "In full-page mode, fixed and sticky elements (headers, chat bubbles, bottom bars) appear at the top only instead of repeating down the image.",
            "default": true
          },
          "selector": {
            "title": "Capture only this element (CSS selector)",
            "type": "string",
            "description": "Optional CSS selector. Screenshot only the first visible matching element, e.g. 'main', '#pricing', 'table.infobox'."
          },
          "format": {
            "title": "Image format",
            "enum": [
              "png",
              "jpeg",
              "webp"
            ],
            "type": "string",
            "description": "Image format. png = lossless (default), jpeg = small files, webp = smallest (max 16,383 px tall).",
            "default": "png"
          },
          "quality": {
            "title": "JPEG/WebP quality",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "JPEG/WebP quality 1–100. Ignored for PNG.",
            "default": 85
          },
          "pdf": {
            "title": "Also save a PDF",
            "type": "boolean",
            "description": "Render the page to PDF as well (screen styles, backgrounds on). Adds the 'pdf' event.",
            "default": false
          },
          "pdfFormat": {
            "title": "PDF paper size",
            "enum": [
              "A4",
              "Letter",
              "A3",
              "Legal",
              "Tabloid"
            ],
            "type": "string",
            "description": "Paper size for the PDF.",
            "default": "A4"
          },
          "waitUntil": {
            "title": "Wait until",
            "enum": [
              "networkidle",
              "load",
              "domcontentloaded"
            ],
            "type": "string",
            "description": "networkidle = wait until the network is quiet (capped at 10 s, then continues instead of failing). load = page load event. domcontentloaded = fastest.",
            "default": "networkidle"
          },
          "navigationTimeoutSecs": {
            "title": "Page timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "If the page has not finished loading by then, the Actor captures what has rendered and adds a warning instead of failing.",
            "default": 30
          },
          "waitForSelector": {
            "title": "Wait for element (CSS selector)",
            "type": "string",
            "description": "Optional. Wait until this element is visible before capturing. If it never appears, the URL fails and is not charged."
          },
          "delayMs": {
            "title": "Extra delay before capture (ms)",
            "minimum": 0,
            "maximum": 30000,
            "type": "integer",
            "description": "Extra wait in milliseconds after the page has loaded, before capture. Example: 2000 for pages with animations.",
            "default": 0
          },
          "scrollToBottom": {
            "title": "Scroll to load lazy content",
            "type": "boolean",
            "description": "Scroll through the page first so lazy-loaded images and sections render.",
            "default": true
          },
          "hideCookieBanners": {
            "title": "Hide cookie/consent banners",
            "type": "boolean",
            "description": "Hides 30+ common consent tools (OneTrust, Cookiebot, Quantcast, Didomi, Usercentrics…) plus consent-looking overlays. Nothing is clicked or accepted.",
            "default": true
          },
          "hideSelectors": {
            "title": "Hide these elements",
            "type": "array",
            "description": "Optional CSS selectors to hide (chat widgets, promo bars…).",
            "items": {
              "type": "string"
            }
          },
          "customCss": {
            "title": "Custom CSS",
            "type": "string",
            "description": "Optional CSS injected before capture."
          },
          "darkMode": {
            "title": "Dark mode",
            "type": "boolean",
            "description": "Emulate prefers-color-scheme: dark.",
            "default": false
          },
          "blockAds": {
            "title": "Block ad networks",
            "type": "boolean",
            "description": "Abort requests to common ad/tracking networks for cleaner, faster shots.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Parallel pages",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "How many pages to render at once. Leave empty (or 0) for automatic: 2 per GB of memory (4 at the default 2 GB). Higher values need more memory."
          },
          "maxRetries": {
            "title": "Retries per URL",
            "minimum": 0,
            "maximum": 3,
            "type": "integer",
            "description": "Retries for a URL that fails (timeouts, network errors). Failed URLs are never charged.",
            "default": 1
          },
          "maxUrls": {
            "title": "Max URLs per run",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Safety cap. URLs beyond this are skipped (and not charged). Hard limit 10,000.",
            "default": 1000
          },
          "maxRequestsPerMinute": {
            "title": "Max pages per minute",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "Rate limit across the whole run, to stay polite to the sites you capture. Hard limit 300.",
            "default": 60
          },
          "sameDomainDelaySecs": {
            "title": "Delay between pages on the same site (seconds)",
            "minimum": 0,
            "maximum": 60,
            "type": "integer",
            "description": "Spacing between requests to the same domain. Useful for long lists from one site.",
            "default": 0
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "PNG screenshots over this size are saved as JPEG instead; anything still larger fails (not charged). Hard limit 50.",
            "default": 25
          },
          "stopOnHighFailureRate": {
            "title": "Stop if most URLs fail",
            "type": "boolean",
            "description": "After 20 URLs, stop the run if 80% or more have failed (usually a block or outage). Remaining URLs are not attempted or charged.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Apify datacenter proxy or your own proxy URLs, for geo-specific or bot-protected pages. Residential proxy is not supported."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}