browser_extract_json

Summary: Browser Extract JsonPOST /api/execute/browser_extract_json

Parses unstructured or semi-structured web documents into normalized JSON records using predefined templates or heuristic DOM mining. When a known template (such as `amazon_product`, `google_search`, or `github_repo`) is specified or auto-detected from the URL, dedicated selectors extract canonical fields with high precision. On unfamiliar websites, the engine analyzes repeating sibling subtrees inside the optional container query to identify product cards, feed posts, or directory rows. It automatically maps titles, hyperlinks, thumbnails, prices, ratings, timestamps, and summaries into uniform objects. The returned payload also bundles any embedded Schema.org `application/ld+json` blocks and OpenGraph meta tags found in the document head. Combining heuristic subtree clustering with metadata harvesting yields reliable structured output across arbitrary domains without requiring custom scraper rules or manual XPath maintenance.

Parameters

NameTypeRequiredDescription
context_idstringyesSession identifier whose loaded document will be parsed into structured JSON records.
templatestringnoOptional predefined parser name (like 'amazon_product' or 'wikipedia') or empty for auto-detection.
selectorstringnoOptional CSS container query restricting heuristic repeating-item detection to a specific subtree.

Usage

result = await browser.extract_json(context_id=context_id)

See Also