extract
Extract structured data from a URL or raw HTML, targeting specific data points like tables, prices, or schema fields with modes for selectors, metadata, or brand profiling.
Instructions
Extract structured data from a URL or raw HTML. Use for specific data points (tables, prices, schema fields) rather than whole-page markdown.
Key parameters:
mode: "selector" (CSS → text) | "tables" | "metadata" (title/author/date/og_* + JSON-LD) | "schema" (pass a JSON Schema) | "structured" (one-shot: tables + definitions + JSON-LD + chart hints + key-value pairs) | "brand" (name/tagline/description/logo_url/favicon_url/og_image_url/social_links/fonts + CSS-var colors, each with explainable provenance).
css_selector: required for mode="selector".
schema: required for mode="schema".
multiple: return all matches (mode="selector" only).
Prefer mode="structured" over chaining multiple extract calls — one response carries { tables, definitions, jsonld, chart_hints, key_value_pairs }. chart_hints surfaces SVG titles, aria-labels, figcaptions for charts whose data is JS-rendered. Metadata parity with fetch (same og_/canonical_url shape). mode: "brand" walks JSON-LD Organization/Brand/WebSite → OG/Twitter Card meta → <link rel=icon> → CSS custom properties → heuristic header/footer DOM; provenance records the winning source. Provenance enums: logo ∈ {json-ld, og:logo, link[rel=icon], heuristic, unknown}; colors ∈ {css-vars, palette-extraction, unknown}; fonts ∈ {css-vars, css-rule, inline-style, google-fonts-link, unknown}. Honesty: name and logo_url are unset when no explicit source emits them — favicons never promote to logo_url. mode: "schema" is evidence-only: LLM-sourced fields not present in source text are returned as null with a warning.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | URL to fetch and extract from | |
| html | No | Raw HTML to extract from (url takes priority if both provided) | |
| mode | No | selector | tables | metadata | schema (LLM-sourced fields verified against source; hallucinated values returned as null) | structured | brand (logo/favicon/colors/fonts/social_links with provenance; favicons never promote to logo_url) | |
| schema | No | JSON Schema defining fields to extract. Field names are matched against page content via CSS classes, ARIA labels, microdata, and JSON-LD. Required when mode="schema". | |
| multiple | No | Return array of all matches instead of first (default: false, only for mode="selector") | |
| css_selector | No | CSS selector to match (required when mode="selector") | |
| named_schema | No | Extract page data into a strict named schema (heuristic only; no LLM required). Mutually exclusive with `schema`. | |
| max_tokens_out | No | Token-budget cap on extracted output (cl100k-base BPE). Trims structured/table/schema results to fit; trailing rows or heavy keys are dropped first. |