extract.structured_data
Extract structured JSON (emails, phones, URLs, key-values, or schema-shaped fields) from messy plain text or HTML. Call when the agent already has document text/HTML and needs machine-readable fields for the next step — not for fetching a live URL (use extract.webpage). Inputs: exactly one of text or html; optional instruction, schema, require_llm. Outputs structured JSON; fail-closed on invalid input. Paid (~5 credits / $0.05) via prepaid key or x402.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | No | HTML fragment/document to structure. Example: '<p>Email us at hello@acme.io</p>' | |
| text | No | Plain text to structure. Do not pass a URL here — use extract.webpage. Example: 'Contact Jane at jane@acme.io or +1-415-555-0100.' | |
| schema | No | Optional JSON Schema the extract should satisfy | |
| instruction | No | Optional focus hint (max 500 chars). Example: 'Extract contact fields only' | |
| require_llm | No | If true and enrichment LLM unavailable → processing failure (no charge on fail-closed). Example: false |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||