Complete Example
Extraction Workflow
1. Configure the Model
gpt-5.1, but you can use:
gpt-5.1(default)gpt-5-mini- Any model supported by your provider
2. Navigate to the Target Page
3. Define Your Schema
- Uses empty strings as type placeholders for string fields
- Supports arrays with
[{ ... }]notation - Can include nested objects
- Guides the LLM to extract data in the exact format you need
4. Extract with Description
description parameter tells the LLM:
- What to look for on the page
- Which elements to focus on
- Any specific instructions about the extraction
Advanced Schema Patterns
Single Object
Nested Objects
Arrays of Primitives
Best Practices
Take a snapshot before extraction
Take a snapshot before extraction
For AI agent workflows, always take an extraction snapshot first:This provides the LLM with optimized HTML for better extraction results.
Be specific in descriptions
Be specific in descriptions
Clear descriptions lead to better extraction:
Match schema to actual data structure
Match schema to actual data structure
Your schema should reflect the actual structure on the page. If there are multiple items, use arrays. If there’s a single element, use an object.
Handle extraction errors gracefully
Handle extraction errors gracefully
Always wrap extraction in try/catch and close resources:
Running the Example
Make sure you have an API key configured for your model provider:Next Steps
Form Filling
Learn how to fill out and submit forms
AI Integration
Build AI agents with OpenSteer