API: extraction/structured
better-web-search-mcp / extraction/structured
extraction/structured#
Interfaces#
StructuredData#
Defined in: src/extraction/structured.ts:13
The result of a structured-data extraction.
Properties#
| Property | Type | Description | Defined in |
|---|---|---|---|
apollo | unknown | Parsed window.__APOLLO_STATE__ payload, when present. | src/extraction/structured.ts:23 |
initialState | unknown | Parsed window.__INITIAL_STATE__ payload, when present. | src/extraction/structured.ts:25 |
jsonLd | unknown[] | Parsed JSON-LD objects (with @graph unwrapped into its members). | src/extraction/structured.ts:15 |
nextData | unknown | Parsed #__NEXT_DATA__ payload, when present. | src/extraction/structured.ts:17 |
nextFlight | string | Concatenated self.__next_f.push flight chunks, when present. | src/extraction/structured.ts:19 |
nuxt | unknown | Parsed window.__NUXT__ payload, when present. | src/extraction/structured.ts:21 |
Variables#
EMPTY_STRUCTURED#
constEMPTY_STRUCTURED:StructuredData
Defined in: src/extraction/structured.ts:29
An empty structured-data result, used when nothing is found.
Functions#
extractStructuredData()#
extractStructuredData(
html):StructuredData
Defined in: src/extraction/structured.ts:185
Extract all structured / hydration data from an HTML page.
Every extractor is defensive: malformed JSON-LD, broken __NEXT_DATA__,
or truncated window globals are skipped silently rather than thrown.
Parameters#
| Parameter | Type |
|---|---|
html | string |