/v1/web/scrape, then extracts what you asked for:
extract_rulesrun CSS or XPath selectors over the HTML and returndata.ai_extract_rulesandai_queryask an LLM about the page and returnai_extraction.
422 before anything is fetched.
Request Body
Field name → selector. A selector starting with
/ or ( is treated as XPath; anything else is CSS. CSS supports ::text and ::attr(name).For more control, pass an object instead of a string:selector(required): the CSS or XPath selector.type:cssorxpath. Inferred when unset.all: return every match as a list instead of the first one.output:text(default) orhtml(the element’s outer HTML).
Field name → plain-language description. The AI returns a JSON object with exactly these keys.
A freeform question about the page. When combined with
ai_extract_rules, the answer is added under an answer key.Render the page in a browser before extracting. Use this for pages that build their content with JavaScript.
ISO 3166-1 alpha-2 country code for the proxy exit. Country-level only; see Proxy countries for coverage.
extract_rules, ai_extract_rules or ai_query is required. Unknown fields are rejected with 422.
Response
One key per
extract_rules field: the first match as a string, a list with all: true, or null when nothing matched. null when no extract_rules were given.
