extract_structured
Extract structured data from any webpage using a JSON schema when you know fields but not selectors. Get clean JSON for product details, job listings, and event data.
Instructions
Use this to get a specific data shape from a page using a JSON schema when you can describe the fields but not their selectors - product details, job listings, event data. Uses an LLM by default; falls back to CSS selectors when no LLM is configured. Not for pages with stable markup whose selectors you know (scrape_structured, no LLM, cheaper). Cost: 3 credits. Example: extract_structured({url: "https://jobs.example.com/post/123", schema: {properties: {title: {type:"string"}, salary: {type:"string"}}, required:["title"]}})
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The URL to extract structured data from | |
| prompt | No | Natural language instructions for extraction | |
| schema | Yes | JSON schema defining the data structure to extract | |
| llmConfig | No | LLM provider configuration for AI-powered extraction | |
| user_agent | No | Override the outbound User-Agent. CrawlForge identifies itself honestly by default; use this only for targets you have your own agreement with. | |
| selectorHints | No | CSS selector hints to guide extraction | |
| respect_robots | No | Respect the target site's robots.txt (default: true). Setting this to false is honoured, returns a warning in the response, and is recorded against your API key — it is your decision, not a silent default. | |
| verify_numbers | No | Numeric provenance guard (default: true): every price or numeric value the LLM returns must appear literally in the page source, else it is returned as null with a reason in `provenance.unverified`. Set false to get the model's raw numbers back, including ones it derived (a count, a sum, a total) rather than read off the page. | |
| fallbackToSelectors | No | Fall back to CSS selector extraction if LLM is unavailable |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| data | No | Extracted fields matching the requested schema | |
| _cost | No | Cost-transparency metadata (D3.5), present when injected into the text copy of the result | |
| error | No | ||
| success | No | False when the extraction errored or a required field came back missing or empty | |
| confidence | No | ||
| provenance | No | ||
| validation | No | ||
| schema_used | No | ||
| processingTime | No | ||
| extractionNotes | No | ||
| extraction_method | No | "llm" | "css_fallback" | "keyword_fallback" | "none" |