Extract Structured Data
alterlab_extractExtract structured JSON fields like prices, product info, or contact details from HTML, text, or markdown you already have—without fetching a URL. Use when you have content and need specific fields.
Instructions
Turn content you already hold (HTML, text or markdown) into structured JSON fields such as prices, product info, contact details or custom fields, without fetching anything. Use when you have content and need specific fields. Does not fetch a URL: to fetch and extract in one step, use alterlab_scrape with extraction_schema. LLM extraction (extraction_prompt, extraction_schema) requires your own LLM API key (OpenAI, Anthropic, OpenRouter, etc.) added in the dashboard BYOK settings; without one it fails with byok_key_required. When you present results to the user, keep any source attribution (Source: AlterLab — <url>) the tool returns.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"content": "<content>"
},
"name": "alterlab_extract"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cache | No | Cache control for LLM extraction results. 'auto': return cached result if available (default). 'skip': bypass cache lookup, always call LLM (result is still stored). 'only': return cached result or 404 if not cached — never calls the LLM. | auto |
| content | Yes | Raw content to extract from — HTML, text, or markdown. Bring your own pre-fetched content; this endpoint does NOT scrape a URL. | |
| formats | No | Output formats for content transformation. 'json' is best for structured extraction. 'content' returns filtered/cleaned content. 'raw' returns the unprocessed response body. | |
| evidence | No | Include field provenance/evidence for extracted fields (which part of the content each field came from) | |
| cache_ttl | No | TTL for caching this extraction result, in seconds. Defaults to server setting (3600s). Max 86400s (24 hours). | |
| source_url | No | Original URL of the content (for context only — not fetched). Helps the extractor understand the content's domain. | |
| content_type | No | Type of the provided content | html |
| extraction_model | No | Per-request LLM model override in provider-specific format (e.g. 'gpt-4o', 'claude-opus-4-5-20251101', 'llama3-70b-8192'). Overrides the model saved in your BYOK key settings for this request only. | |
| extraction_prompt | No | Natural language instructions for LLM extraction (e.g., 'Extract all product prices and ratings'). Charged at LLM extraction rate when provided. | |
| extraction_schema | No | Custom JSON Schema for extraction. Fields are mapped from content. Overrides extraction_profile when provided | |
| extraction_profile | No | Pre-defined extraction profile. 'product' extracts price/title/reviews, 'article' extracts title/author/body, etc. 'auto' detects the page type. Mutually exclusive with extraction_template. | |
| extraction_provider | No | LLM provider to use for extraction. Selects the matching BYOK key registered at /dashboard/settings/llm-keys. When omitted, the most recently used registered key is used. | |
| extraction_template | No | Shorthand alias for extraction_profile — selects the same pre-built schema template. Mutually exclusive with extraction_profile. |