Reference
Extract
Extract structured data from the page.
extract()
grabs structured text from the current page using zod. Given instructions and schema
, you will receive structured data.
We strongly suggest you set
useTextExtract
to true
if you are extracting data from a longer body of text.Arguments: ExtractOptions<T extends z.AnyZodObject>
Provides instructions for extraction
Defines the structure of the data to extract
This method converts the page to text, which is much cleaner for LLMs than the DOM. However, it may not work for use cases that involve DOM metadata elements.
Specifies the model to use
Configuration options for the model client. See ClientOptions
.
Timeout in milliseconds for waiting for the DOM to settle
Returns: Promise<ExtractResult<T extends z.AnyZodObject>>
Resolves to the structured data as defined by the provided schema
.