Retrieve a web page and return its content as markdown (default), text, HTML, a JSON envelope, or a printed PDF. Handles the fetch vs. browser decision, charset decoding, and PDF-to-text for you. Optionally extract structured data with CSS selectors (`extract`) or `autoparse`, return discovered `links`, take a `screenshot`, or scope the DOM with `include_tags`/`exclude_tags`. Each successful call is billed in credits (a failure costs 0). Results are cached by default, and a cache hit is billed like the fetch that stored it (the cache saves time, not credits); set `cache=false` for time-sensitive pages. With the defaults it only reads the page. A `method` other than GET, HEAD or OPTIONS, and the `actions` that click, fill or run scripts on the page, can change state on the target site: set them only when the user asks for that. For markdown, text and HTML it returns `{ content }`. With `format: "json"`, or when `extract`, `autoparse`, `links`, `screenshot` or `network_capture` is set, it returns the JSON envelope: `content`, the site's `status`, `credits`, `engine` (the rendering tier: `fetch`, `js` or `browser`), `warnings` and `data` for extraction. Screenshots come back as image content blocks; each `screenshots` entry in the JSON keeps its metadata and says which block holds it. A PDF comes back as a resource content block, with its size, the rendering tier and the credits in the JSON.
View input schema
{
"type": "object",
"properties": {
"url": {
"type": "string",
"format": "uri",
"description": "The absolute URL to retrieve."
},
"render": {
"type": "boolean",
"default": false,
"description": "Render with a real browser (executes JavaScript). Use for single-page apps or pages whose content is painted client-side. Costs more than the default fetch tier. A plain fetch that gets only a near-empty script page (a bot challenge) fails with ERR::UPSTREAM::CHALLENGE and bills nothing; retry with `render: true` or your own `proxy`."
},
"format": {
"type": "string",
"enum": [
"markdown",
"text",
"html",
"json",
"pdf"
],
"default": "markdown",
"description": "Output format. 'markdown' (default) is best for feeding to an LLM; 'html' returns the raw document; 'json' returns the main content as markdown in `content` plus `sections` ([{level, heading, text}], split on headings); 'pdf' prints the page in a full browser (routed there for you) and returns the file as a resource content block."
},
"main_content_only": {
"type": "boolean",
"description": "Strip the page to its main article, dropping nav/footer/aside. Defaults on for markdown and json."
},
"include_tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "CSS selectors to KEEP (everything else is dropped)."
},
"exclude_tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "CSS selectors to remove (e.g. ['nav','.ad','#cookie'])."
},
"links": {
"type": "boolean",
"default": false,
"description": "Also return the page's discovered links as an absolute, de-duplicated list."
},
"extract": {
"type": "object",
"additionalProperties": {},
"description": "Selector-based extraction: a map of field -> CSS/XPath selector, e.g. {\"title\":\"h1\",\"price\":\".amount\"}. Returns structured `data`. A trailing `[]` returns every match as an array, e.g. {\"titles\":\".titleline > a[]\",\"links\":\"a[]@href\"}; without it only the first match is returned. The full form {\"selector\":\"...\",\"kind\":\"list\"} also works. Precise and cheap when you know the page structure."
},
"screenshot": {
"type": "boolean",
"default": false,
"description": "Capture a screenshot (requires render)."
},
"impersonate": {
"type": "boolean",
"description": "Fetch tier only: present a real browser's TLS/JA3 + HTTP/2 fingerprint to clear passive bot gates. On by default; set false to send a plain client handshake."
},
"proxy": {
"type": "string",
"description": "Your own proxy URL to egress through. Takes precedence over the pool; no surcharge."
},
"cache": {
"type": "boolean",
"description": "Serve a recent cached result if fresh (on by default). A hit is billed at the same price as the fetch that stored it: the cache saves time, not credits. Set false only when you need live data."
},
"cache_ttl": {
"type": "integer",
"minimum": 0,
"description": "Max age in seconds of a cached copy to accept (0 forces a fresh fetch; capped at 48h). Freshness only: a hit is billed like a fetch."
},
"wait": {
"type": "integer",
"minimum": 0,
"description": "Milliseconds to wait after load before capturing (render only)."
},
"scroll_pages": {
"type": "integer",
"minimum": 0,
"maximum": 20,
"description": "Before capture, scroll to the bottom up to this many times, stopping once the page stops growing: loads infinite-scroll feeds, search results and timelines. Needs full-browser rendering and costs as such (like `actions`). Default 0 (off); typical value 3-10."
},
"mode": {
"type": "string",
"enum": [
"auto"
],
"description": "Routing mode. `auto` lets the platform escalate fetch -> browser as needed, billing only the rung that worked."
},
"method": {
"type": "string",
"description": "HTTP method sent to the target (default GET; no request body can be sent). Anything but GET, HEAD or OPTIONS can change state on the target site: use it only when the user asks."
},
"custom_headers": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Extra request headers sent to the target, e.g. {\"Accept-Language\":\"de\"}."
},
"session_id": {
"type": "string",
"description": "Run inside a session from spicrawl_session_create: same exit IP and browser state (cookies, localStorage) across calls."
},
"proxy_verify": {
"type": "boolean",
"description": "Verify `proxy` is reachable before using it."
},
"wait_for": {
"type": "string",
"description": "CSS selector to wait for before capturing (render only)."
},
"wait_for_timeout": {
"type": "integer",
"minimum": 0,
"description": "Max milliseconds to wait for `wait_for`."
},
"block_resources": {
"type": "array",
"items": {
"type": "string"
},
"description": "Resource types the browser should not load, e.g. [\"fonts\",\"media\",\"images\"] (render only). Faster and cheaper."
},
"actions": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "click"
},
"selector": {
"type": "string",
"minLength": 1,
"description": "CSS selector of the element to click."
},
"wait_for_navigation": {
"type": "boolean",
"description": "The click navigates: finish the step only once the new page has loaded."
},
"until": {
"type": "string",
"enum": [
"load",
"domcontentloaded",
"networkidle"
],
"description": "Load state the new document must reach. Default load."
},
"timeout_ms": {
"type": "integer",
"minimum": 1,
"description": "Budget for this step in ms. The step fails (or is skipped) when it runs out."
},
"on_error": {
"type": "string",
"enum": [
"fail",
"skip"
],
"description": "fail (default) aborts the workflow; skip records the failure and continues."
},
"label": {
"type": "string",
"description": "Name echoed in the response's `actions` and `screenshots`."
}
},
"required": [
"type",
"selector"
],
"additionalProperties": false,
"description": "Click an element. On a checkbox or radio this toggles it (there is no 'set checked'); read its state with evaluate if it matters."
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "fill"
},
"selector": {
"type": "string",
"minLength": 1
},
"value": {
"type": "string"
},
"secret": {
"type": "boolean",
"description": "A credential: redacted from logs and the request log."
},
"timeout_ms": {
"$ref": "#/properties/actions/items/anyOf/0/properties/timeout_ms"
},
"on_error": {
"$ref": "#/properties/actions/items/anyOf/0/properties/on_error"
},
"label": {
"$ref": "#/properties/actions/items/anyOf/0/properties/label"
}
},
"required": [
"type",
"selector",
"value"
],
"additionalProperties": false,
"description": "Type a value into an input."
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "wait_for"
},
"selector": {
"type": "string",
"minLength": 1,
"description": "CSS selector to wait for."
},
"ms": {
"type": "integer",
"minimum": 1,
"description": "Or: sleep this many ms."
},
"timeout_ms": {
"$ref": "#/properties/actions/items/anyOf/0/properties/timeout_ms"
},
"on_error": {
"$ref": "#/properties/actions/items/anyOf/0/properties/on_error"
},
"label": {
"$ref": "#/properties/actions/items/anyOf/0/properties/label"
}
},
"required": [
"type"
],
"additionalProperties": false,
"description": "Wait for a selector to appear, or sleep `ms`."
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "wait_for_navigation"
},
"until": {
"$ref": "#/properties/actions/items/anyOf/0/properties/until",
"description": "Load state the new document must reach. Default load."
},
"timeout_ms": {
"$ref": "#/properties/actions/items/anyOf/0/properties/timeout_ms"
},
"on_error": {
"$ref": "#/properties/actions/items/anyOf/0/properties/on_error"
},
"label": {
"$ref": "#/properties/actions/items/anyOf/0/properties/label"
}
},
"required": [
"type"
],
"additionalProperties": false,
"description": "Wait for a navigation started by the previous step (a click, a form submit, a redirect) to load."
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "scroll"
},
"y": {
"type": "integer",
"description": "Pixels to scroll down (negative scrolls up)."
},
"to_bottom": {
"type": "boolean",
"description": "Scroll to the bottom repeatedly until the page stops growing (infinite scroll)."
},
"selector": {
"type": "string",
"minLength": 1,
"description": "Scroll this element into view."
},
"timeout_ms": {
"$ref": "#/properties/actions/items/anyOf/0/properties/timeout_ms"
},
"on_error": {
"$ref": "#/properties/actions/items/anyOf/0/properties/on_error"
},
"label": {
"$ref": "#/properties/actions/items/anyOf/0/properties/label"
}
},
"required": [
"type"
],
"additionalProperties": false,
"description": "Scroll the page: give exactly one of y, to_bottom or selector."
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "select"
},
"selector": {
"type": "string",
"minLength": 1,
"description": "CSS selector of the <select>."
},
"value": {
"type": "string"
},
"values": {
"type": "array",
"items": {
"type": "string"
},
"description": "Several options, for a multi-select."
},
"timeout_ms": {
"$ref": "#/properties/actions/items/anyOf/0/properties/timeout_ms"
},
"on_error": {
"$ref": "#/properties/actions/items/anyOf/0/properties/on_error"
},
"label": {
"$ref": "#/properties/actions/items/anyOf/0/properties/label"
}
},
"required": [
"type",
"selector"
],
"additionalProperties": false,
"description": "Choose option(s) in a <select> by value."
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "evaluate"
},
"expression": {
"type": "string",
"minLength": 1,
"description": "JavaScript expression evaluated in the page."
},
"return_value": {
"type": "boolean",
"description": "Return the value under `actions` in the response (forces format json)."
},
"await_promise": {
"type": "boolean"
},
"timeout_ms": {
"$ref": "#/properties/actions/items/anyOf/0/properties/timeout_ms"
},
"on_error": {
"$ref": "#/properties/actions/items/anyOf/0/properties/on_error"
},
"label": {
"$ref": "#/properties/actions/items/anyOf/0/properties/label"
}
},
"required": [
"type",
"expression"
],
"additionalProperties": false,
"description": "Run JavaScript in the page."
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "screenshot"
},
"full_page": {
"type": "boolean"
},
"selector": {
"type": "string",
"minLength": 1,
"description": "Capture only this element."
},
"format": {
"type": "string",
"enum": [
"png",
"jpeg",
"webp"
]
},
"quality": {
"type": "integer",
"minimum": 1,
"maximum": 100
},
"timeout_ms": {
"$ref": "#/properties/actions/items/anyOf/0/properties/timeout_ms"
},
"on_error": {
"$ref": "#/properties/actions/items/anyOf/0/properties/on_error"
},
"label": {
"$ref": "#/properties/actions/items/anyOf/0/properties/label"
}
},
"required": [
"type"
],
"additionalProperties": false,
"description": "Capture the page at this point. The image is returned as an image block; the response becomes the JSON envelope whatever `format` says."
}
]
},
"description": "Browser steps run in order before capture (render only). Each step is {type, ...fields}. Examples: [{\"type\":\"click\",\"selector\":\"#load-more\"},{\"type\":\"wait_for\",\"selector\":\".item:nth-child(20)\",\"timeout_ms\":5000}] · infinite scroll: [{\"type\":\"scroll\",\"to_bottom\":true},{\"type\":\"wait_for\",\"ms\":1000}] · login: [{\"type\":\"fill\",\"selector\":\"#user\",\"value\":\"me\"},{\"type\":\"fill\",\"selector\":\"#pass\",\"value\":\"…\",\"secret\":true},{\"type\":\"click\",\"selector\":\"button[type=submit]\",\"wait_for_navigation\":true}]. A screenshot step switches the response to the JSON envelope (a FORMAT_COERCED warning says so)."
},
"screenshot_fullpage": {
"type": "boolean",
"description": "Capture the whole page, not just the viewport."
},
"screenshot_selector": {
"type": "string",
"description": "Capture only the element matching this CSS selector."
},
"screenshot_format": {
"type": "string",
"description": "Screenshot image format."
},
"screenshot_quality": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"description": "Screenshot quality 1-100 (lossy formats)."
},
"autoparse": {
"type": "boolean",
"description": "Return the structured data the page publishes about itself (JSON-LD, OpenGraph, Twitter Card, microdata). No selectors; survives redesigns."
},
"network_capture": {
"type": "object",
"properties": {
"urls": {
"type": "array",
"items": {
"type": "string"
},
"description": "URL patterns of the page's own requests to record."
},
"resource_types": {
"type": "array",
"items": {
"type": "string"
},
"description": "Resource types to record, e.g. [\"xhr\",\"fetch\"]."
},
"include_bodies": {
"type": "boolean",
"description": "Include response bodies."
},
"max_body_bytes": {
"type": "integer",
"description": "Per-response body cap."
},
"max_responses": {
"type": "integer",
"description": "Cap on recorded responses."
}
},
"additionalProperties": false,
"description": "Record the API responses the PAGE fetched while rendering — often cleaner JSON than the DOM. Render only."
},
"parse_pdf": {
"type": "boolean",
"description": "Turn a PDF target into text/markdown (default true). false refuses PDFs."
},
"max_cost": {
"type": "integer",
"minimum": 0,
"description": "Refuse (rather than run) a request that would cost more than this many credits."
},
"original_status": {
"type": "boolean",
"description": "Return the target's own HTTP status instead of 200 for a successful scrape."
},
"allowed_status_codes": {
"type": "array",
"items": {
"type": "integer"
},
"description": "Target statuses to treat as success instead of an error (e.g. [404] to capture a not-found page)."
}
},
"required": [
"url"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}