{
  "openapi": "3.0.1",
  "info": {
    "title": "Stealth Scraper MD - blocks to Markdown/JSON/CSV",
    "description": "Auto-escalating web scraper for anti-bot protected pages (Cloudflare/Turnstile/Akamai/DataDome). Clean Markdown, HTML, JSON or CSV with pagination, CSS-selectors, caching, webhooks. HTTP->dynamic->stealth, no proxy setup.",
    "version": "2.1",
    "x-build-id": "Kj5ieputRzFggz6Qk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/enheartening_loam~stealth-scraper-md/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-enheartening_loam-stealth-scraper-md",
        "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/enheartening_loam~stealth-scraper-md/runs": {
      "post": {
        "operationId": "runs-sync-enheartening_loam-stealth-scraper-md",
        "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/enheartening_loam~stealth-scraper-md/run-sync": {
      "post": {
        "operationId": "run-sync-enheartening_loam-stealth-scraper-md",
        "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",
        "properties": {
          "urls": {
            "title": "URLs to scrape",
            "type": "array",
            "description": "List of page URLs to fetch. You can also provide a single 'url' field instead.",
            "items": {
              "type": "string"
            }
          },
          "url": {
            "title": "Single URL (alternative to urls)",
            "type": "string",
            "description": "Minimal input: one URL. If both url and urls are provided, urls wins."
          },
          "preset": {
            "title": "Preset / template",
            "enum": [
              "none",
              "ecommerce_product",
              "article_llm",
              "table",
              "seo_audit",
              "reviews"
            ],
            "type": "string",
            "description": "Ready-made profile. ecommerce_product = product card JSON; article_llm = clean markdown for LLM/RAG; table = extract tables; seo_audit = SEO fields; reviews = generic reviews.",
            "default": "none"
          },
          "discoverSitemap": {
            "title": "Discover URLs from sitemap",
            "type": "boolean",
            "description": "Expand the URL list automatically from the first URL's robots.txt/sitemap.xml. Great for catalogues and e-commerce — given one homepage it finds many product/article pages. Capped by 'max items to scrape'.",
            "default": false
          },
          "mode": {
            "title": "Fetch mode",
            "enum": [
              "auto",
              "stealth",
              "dynamic",
              "http",
              "fast",
              "standard",
              "max"
            ],
            "type": "string",
            "description": "auto/standard = try cheap HTTP first, escalate if blocked; http/fast = plain HTTP only; dynamic = JS browser; stealth/max = strongest anti-bot bypass.",
            "default": "auto"
          },
          "cssSelector": {
            "title": "CSS selector (optional)",
            "type": "string",
            "description": "Extract only matching elements, e.g. article or .main-content. Leave empty for whole page."
          },
          "maxUrls": {
            "title": "Max start URLs per run",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Safety cap on how many input URLs are processed in one run.",
            "default": 50
          },
          "maxResults": {
            "title": "Max results (rows)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on successful result rows. 0 means use quota/promo default.",
            "default": 0
          },
          "maxOutputBytes": {
            "title": "Max output bytes",
            "minimum": 0,
            "maximum": 2147483648,
            "type": "integer",
            "description": "Stop after total output exceeds this many bytes. 0 means default 512 MB.",
            "default": 0
          },
          "timeoutSeconds": {
            "title": "Timeout (seconds)",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "Per-request timeout. Browser stealth may internally use a larger budget derived from this value.",
            "default": 30
          },
          "maxCostUnits": {
            "title": "Max estimated cost units",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "If the pre-run estimate exceeds this value, the actor will not start scraping. 0 disables the guard.",
            "default": 0
          },
          "simulate": {
            "title": "Simulate / cost preview",
            "type": "boolean",
            "description": "If enabled, actor validates input and returns cost estimate without scraping.",
            "default": false
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "markdown",
              "html",
              "json"
            ],
            "type": "string",
            "description": "markdown = clean markdown; html = full HTML; json = structured fields from jsonStructure/tables.",
            "default": "markdown"
          },
          "jsonStructure": {
            "title": "JSON structure (field → selector or typed spec)",
            "type": "object",
            "description": "Used when outputFormat=json. Supports simple selectors ({\"title\":\"h1\"}) or typed specs ({\"price\":{\"selector\":\".price\",\"type\":\"price\",\"required\":true}}). Types: string, integer, number, price, bool, url, list."
          },
          "tables": {
            "title": "Parse tables (optional, JSON mode)",
            "type": "object",
            "description": "When outputFormat=json, extract HTML tables as lists of row dicts. Format: {\"name\": \"css-selector-of-table\"}."
          },
          "includeMetadata": {
            "title": "Include metadata",
            "type": "boolean",
            "description": "Add metadata dict with title, description, canonical, og tags, author, publishedAt, lang, JSON-LD snippet.",
            "default": false
          },
          "seoAudit": {
            "title": "SEO audit fields",
            "type": "boolean",
            "description": "Add SEO diagnostics: h1/h2, text length, links count, images missing alt, canonical, meta description.",
            "default": false
          },
          "pagination": {
            "title": "Follow pagination",
            "type": "boolean",
            "description": "Walk each input URL as a chain of pages via next links. Respects mode escalation. Stops at last page, maxUrls, maxResults, or output limit.",
            "default": false
          },
          "useProxy": {
            "title": "Route through Apify Proxy",
            "type": "boolean",
            "description": "When enabled, requests are chained through Apify Proxy after local SSRF filtering. Requires APIFY_PROXY_* env.",
            "default": false
          },
          "proxyCountry": {
            "title": "Proxy country (ISO-2, optional)",
            "type": "string",
            "description": "e.g. US, DE, FR. Only used when useProxy=true."
          },
          "proxyGroups": {
            "title": "Proxy groups (optional)",
            "type": "string",
            "description": "e.g. RESIDENTIAL. Only used when useProxy=true."
          },
          "userAgent": {
            "title": "Custom User-Agent (optional)",
            "type": "string",
            "description": "Override default User-Agent for HTTP and browser modes."
          },
          "headers": {
            "title": "Custom headers (optional)",
            "type": "object",
            "description": "Extra HTTP headers, e.g. {\"Accept-Language\": \"en-US\"}."
          },
          "cookies": {
            "title": "Cookies (optional)",
            "type": "string",
            "description": "Cookie header string or JSON object for authorized pages. Sensitive: not logged."
          },
          "webhookUrl": {
            "title": "Webhook URL (optional)",
            "type": "string",
            "description": "POST compact run summary to this URL after finish."
          },
          "webhookToken": {
            "title": "Webhook auth token (optional)",
            "type": "string",
            "description": "Sent as Authorization: Bearer <token>. Sensitive."
          },
          "cache": {
            "title": "Result cache (optional)",
            "type": "object",
            "description": "Disk cache for repeat requests. Disabled by default. Only high-quality successful rows are cached."
          },
          "unblocker": {
            "title": "Managed unblocker (optional object)",
            "type": "object",
            "description": "External anti-bot service config: {\"provider\": \"zenrows\" | \"webunlocker\", \"apiKey\": \"...\", \"zone\": \"...\"}. Alternatively use top-level unblockerProvider/unblockerApiKey/unblockerZone."
          },
          "unblockerProvider": {
            "title": "Unblocker provider (optional)",
            "enum": [
              "",
              "zenrows",
              "webunlocker"
            ],
            "type": "string",
            "description": "zenrows or webunlocker.",
            "default": ""
          },
          "unblockerApiKey": {
            "title": "Unblocker API key (optional)",
            "type": "string",
            "description": "Sensitive key for external unblocker."
          },
          "unblockerZone": {
            "title": "Unblocker zone (optional)",
            "type": "string",
            "description": "Required only for webunlocker (Bright Data zone)."
          },
          "promoCode": {
            "title": "Promo / beta code (optional)",
            "maxLength": 40,
            "type": "string",
            "description": "Promo code increases free result cap for this run."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}