Dataset API
The Dataset class provides schema-driven structured data extraction from web pages. It supports multiple fields, auto-match, and export to JSON, CSV, and Parquet.
6 min read Updated July 2026
Python Usage
Node.js Usage
Field API
Extraction Types
| Type | Input → Output | Use Case |
|---|---|---|
| text | " Hello " → "Hello" | Trim and collapse whitespace |
| price | "$1,234.56" → "1234.56" | Normalize currency to float string |
| datetime | "Jan 15, 2024" → "2024-01-15" | Standardize dates to ISO format |
| url | "/path" → "https://base.com/path" | Resolve relative URLs to absolute |
Streaming Dataset
Process thousands of URLs with bounded, constant memory consumption:
Export Formats
| Method | Format | Notes |
|---|---|---|
| to_json(path) | JSON | Pretty-printed JSON object or array |
| to_csv(path) | CSV | Header row + record rows |
| to_parquet(path) | Parquet | Columnar, Snappy-compressed format |
| to_dict() | Dict | In-memory dictionary |
