{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fastcrw-com/json-schema/fastcrw-com-scrape-request-schema.json",
  "title": "ScrapeRequest",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fastcrw-com-openapi.json#/components/schemas/ScrapeRequest",
  "type": "object",
  "required": [
    "url"
  ],
  "properties": {
    "url": {
      "type": "string",
      "format": "uri"
    },
    "formats": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/OutputFormat"
      },
      "default": [
        "markdown"
      ]
    },
    "onlyMainContent": {
      "type": "boolean",
      "default": true,
      "description": "Strip navigation, ads, and boilerplate; keep main article content only"
    },
    "renderJs": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "null = auto-detect, true = force JS rendering, false = skip JS rendering"
    },
    "waitFor": {
      "type": "integer",
      "minimum": 0,
      "description": "Milliseconds to wait after JS rendering before extracting content"
    },
    "includeTags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": [],
      "description": "CSS selectors / HTML tags to include in extraction"
    },
    "excludeTags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": [],
      "description": "CSS selectors / HTML tags to remove before extraction"
    },
    "jsonSchema": {
      "type": "object",
      "additionalProperties": true,
      "description": "JSON Schema describing the structured output shape for the 'json' format"
    },
    "basis": {
      "type": "boolean",
      "default": false,
      "description": "Return per-field evidence alongside the 'json' format: each top-level scalar schema property comes back as a Basis with an honest status. Requires a JSON schema; off by default, and when off the request sent to the model is unchanged."
    },
    "headers": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Custom HTTP request headers forwarded to the target URL"
    },
    "cssSelector": {
      "type": "string",
      "description": "CSS selector to narrow content extraction to a specific element"
    },
    "xpath": {
      "type": "string",
      "description": "XPath expression to narrow content extraction to a specific element"
    },
    "chunkStrategy": {
      "$ref": "#/$defs/ChunkStrategy",
      "description": "Strategy for chunking the extracted markdown"
    },
    "query": {
      "type": "string",
      "description": "Query string for BM25/cosine chunk filtering (used with chunkStrategy)"
    },
    "filterMode": {
      "type": "string",
      "enum": [
        "bm25",
        "cosine"
      ],
      "description": "Filtering algorithm to rank chunks against query"
    },
    "topK": {
      "type": "integer",
      "minimum": 1,
      "description": "Number of top chunks to return after filtering (default: 5)"
    },
    "proxy": {
      "type": "string",
      "description": "Per-request proxy URL (http/https/socks5). Overrides global config."
    },
    "proxyList": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": [],
      "description": "Per-request proxy pool to rotate among (BYOP). Takes precedence over proxy and server config."
    },
    "proxyRotation": {
      "type": "string",
      "enum": [
        "round_robin",
        "random",
        "sticky_per_host"
      ],
      "description": "Rotation strategy for proxyList (default: sticky_per_host)"
    },
    "country": {
      "type": "string",
      "description": "2-letter ISO 3166-1 alpha-2 country code for residential proxy egress (e.g. 'us', 'gb')"
    },
    "stealth": {
      "type": "boolean",
      "description": "Override stealth mode for this request (null = use global config)"
    },
    "actions": {
      "type": "object",
      "additionalProperties": true,
      "description": "Unsupported Firecrawl parameter — returns a clear error if supplied"
    },
    "extract": {
      "$ref": "#/$defs/ExtractOptions",
      "description": "Firecrawl-compatible extract object (e.g. { schema: {...} })"
    },
    "llmApiKey": {
      "type": "string",
      "description": "BYOK: LLM provider API key for structured extraction (overrides server key)"
    },
    "llmProvider": {
      "type": "string",
      "enum": [
        "anthropic",
        "openai",
        "deepseek",
        "azure",
        "openai-compatible",
        "openai-responses"
      ],
      "description": "Per-request LLM provider override"
    },
    "llmModel": {
      "type": "string",
      "description": "Per-request LLM model identifier override"
    },
    "baseUrl": {
      "type": "string",
      "description": "Per-request LLM base URL override for Chat Completions-compatible or Responses-compatible providers (e.g. https://api.deepseek.com/v1)"
    },
    "summaryPrompt": {
      "type": "string",
      "maxLength": 500,
      "description": "User-supplied instructions appended to the summary system prompt (capped at 500 chars)"
    },
    "maxContentChars": {
      "type": "integer",
      "minimum": 1,
      "description": "Maximum bytes of scraped content sent to LLM for 'summary' format (capped at 200 KB)"
    },
    "renderer": {
      "type": "string",
      "enum": [
        "auto",
        "lightpanda",
        "chrome",
        "chrome_proxy",
        "playwright",
        "camoufox",
        "impersonated-http"
      ],
      "description": "Pin this request to a specific renderer. A non-auto browser tier implies renderJs:true unless renderJs:false is set. impersonated-http is a JS-less tier that presents a real Chrome TLS fingerprint; it never implies renderJs, and combining it with renderJs:true is rejected."
    },
    "deadlineMs": {
      "type": "integer",
      "minimum": 1,
      "maximum": 60000,
      "description": "End-to-end deadline budget in milliseconds (default: 8000, max: 60000)"
    },
    "debug": {
      "type": "boolean",
      "description": "When true, response includes debugExtraction trace with every candidate the extractor considered"
    },
    "changeTracking": {
      "$ref": "#/$defs/ChangeTrackingOptions",
      "description": "Activated when formats includes 'changeTracking'. The format entry is the plain string; options ride on this sibling field."
    },
    "goal": {
      "type": "string",
      "maxLength": 2048,
      "description": "Plain-language monitor goal for the meaningful-change judge"
    },
    "judgeEnabled": {
      "type": "boolean",
      "description": "Run the LLM meaningful-change judge on a changed page (requires goal)"
    },
    "parsers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ParserSpec"
      },
      "description": "Document parser directives. Omit = auto-parse PDFs. Empty array = disable parsing."
    },
    "screenshotFullPage": {
      "type": "boolean",
      "default": false,
      "description": "Capture the whole page rather than the viewport, for `formats: [\"screenshot\"]`."
    },
    "maxAge": {
      "type": "integer",
      "format": "int64",
      "minimum": 0,
      "default": 3600000,
      "description": "How old a cached copy of this fetch may be, in milliseconds. 0 always fetches. Clamped to a 24 hour ceiling. Extraction options (formats, schema, selectors) are not part of the cache key, so a second pass over the same page reuses the fetch."
    },
    "storeInCache": {
      "type": "boolean",
      "default": true,
      "description": "Set false to read the cache without writing to it."
    }
  },
  "$defs": {
    "ChangeTrackingOptions": {
      "type": "object",
      "properties": {
        "modes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "gitDiff",
              "json"
            ]
          },
          "description": "Diff surfaces. gitDiff = markdown unified diff + AST; json = per-field diff; both = mixed."
        },
        "schema": {
          "type": "object",
          "additionalProperties": true,
          "description": "JSON schema of tracked fields (json/mixed mode)"
        },
        "prompt": {
          "type": "string"
        },
        "previous": {
          "$ref": "#/$defs/ChangeTrackingSnapshot"
        },
        "tag": {
          "type": "string",
          "description": "Opaque caller tag echoed on the result"
        },
        "contentType": {
          "type": "string",
          "description": "MIME type; non-text content is hashed, not diffed"
        }
      }
    },
    "ChangeTrackingSnapshot": {
      "type": "object",
      "properties": {
        "markdown": {
          "type": "string",
          "description": "Present for gitDiff/mixed mode"
        },
        "json": {
          "type": "object",
          "additionalProperties": true,
          "description": "Present for json/mixed mode"
        },
        "contentHash": {
          "type": "string",
          "description": "Mode-aware hash; persist + supply on the next check"
        },
        "capturedAt": {
          "type": "string",
          "description": "Caller-stamped capture time, echoed untouched"
        }
      }
    },
    "ChunkStrategy": {
      "type": "object",
      "description": "Strategy for chunking extracted markdown before query-based filtering",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "sentence",
            "regex",
            "topic"
          ],
          "description": "Chunking algorithm: sentence = split on .!?, regex = split on pattern, topic = split on markdown headings"
        },
        "maxChars": {
          "type": "integer",
          "minimum": 1,
          "description": "Maximum characters per chunk (merges short chunks up to this limit)"
        },
        "overlapChars": {
          "type": "integer",
          "minimum": 0,
          "description": "Character overlap between adjacent chunks"
        },
        "dedupe": {
          "type": "boolean",
          "description": "Remove duplicate chunks"
        },
        "pattern": {
          "type": "string",
          "description": "Regex pattern to split on (required when type = 'regex')"
        }
      }
    },
    "ExtractOptions": {
      "type": "object",
      "description": "Firecrawl-compatible extraction options sub-object",
      "properties": {
        "schema": {
          "type": "object",
          "additionalProperties": true,
          "description": "JSON Schema for structured extraction. Used as jsonSchema when jsonSchema is not set directly."
        }
      }
    },
    "OutputFormat": {
      "type": "string",
      "enum": [
        "markdown",
        "html",
        "rawHtml",
        "plainText",
        "links",
        "images",
        "json",
        "summary",
        "changeTracking",
        "screenshot"
      ],
      "description": "Aliases accepted in addition to these: `extract` and `llm-extract` for `json`, `change-tracking` for `changeTracking`, `screenshot@fullPage` for `screenshot`."
    },
    "ParserSpec": {
      "type": "object",
      "description": "Document parser directive. Accepts string form ('pdf') or object form.",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "pdf"
          ],
          "description": "Parser type (only 'pdf' is supported)"
        },
        "mode": {
          "type": "string",
          "enum": [
            "auto",
            "fast",
            "ocr"
          ],
          "description": "Parsing strategy (auto = text-first; ocr degrades to text extraction with a warning)"
        },
        "maxPages": {
          "type": "integer",
          "minimum": 1,
          "description": "Optional cap on the number of pages to parse"
        }
      }
    }
  }
}