Docs/API reference

CrawlResults · Python

Python collection of per-page extraction results.

Download .md
Developers3 min read13 sections
Source reference · Match your SDK version. Availability and known issues
In this guide

Purpose and lifecycle

This is a return type, not a top-level package export. It retains results in memory. Current Crawl.build wraps native dictionaries as DatasetResult handles, so conversion/export through that path needs correction.

pandas is required for df(); Parquet export through pandas needs an installed Parquet engine.

Definition and availability

Source snapshot: 1.0.0-alpha.3. Reachable result/callback type; not a top-level package export. Declared in source; this is not a runtime test result.

Signatures and source locations are generated from the SDK wrappers. Clean snapshots link to the recorded commit. Modified snapshots link to main, which may differ; file hashes identify the local inputs.

class CrawlResults
python1 lines · copy-ready

Members

MemberKindReturn / value typeSource status
__init__methodNot annotated; see behavior notesPresent in source
to_jsonmethodNot annotated; see behavior notesPresent in source
to_csvmethodNot annotated; see behavior notesPresent in source
to_parquetmethodNot annotated; see behavior notesPresent in source
dfmethodNot annotated; see behavior notesPresent in source
__iter__methoditerPresent in source
__len__methodintPresent in source
__getitem__methodDatasetResultPresent in source
__repr__methodstrPresent in source

__init__()

Store an in-memory list of DatasetResult wrappers. No fetching or exporting happens during construction.

Returns / value: Not annotated; see behavior notes.

def __init__(self, results: List[DatasetResult])
python1 lines · copy-ready
ParameterTypeRequired / defaultMeaning
resultsList[DatasetResult]RequiredList of DatasetResult wrappers retained in memory.

to_json()

Write a JSON array of all field dictionaries.

Returns / value: Not annotated; see behavior notes.

def to_json(self, path: str)
python1 lines · copy-ready
ParameterTypeRequired / defaultMeaning
pathstrRequiredFilesystem path relative to the process working directory unless absolute.

to_csv()

Write all field maps using the first result’s keys as columns; inconsistent later keys can fail.

Returns / value: Not annotated; see behavior notes.

def to_csv(self, path: str)
python1 lines · copy-ready
ParameterTypeRequired / defaultMeaning
pathstrRequiredFilesystem path relative to the process working directory unless absolute.

to_parquet()

Build a pandas DataFrame and export it with the installed Parquet engine.

Returns / value: Not annotated; see behavior notes.

def to_parquet(self, path: str)
python1 lines · copy-ready
ParameterTypeRequired / defaultMeaning
pathstrRequiredFilesystem path relative to the process working directory unless absolute.

df()

Collect every field dictionary into a pandas DataFrame.

Returns / value: Not annotated; see behavior notes.

def df(self)
python1 lines · copy-ready

__iter__()

Iterate over the stored DatasetResult wrappers. See any known limitation above before using a materialized Python collection.

Returns / value: iter.

def __iter__(self) -> iter
python1 lines · copy-ready

__len__()

Return the number of stored results or matched elements; no additional pages are fetched.

Returns / value: int.

def __len__(self) -> int
python1 lines · copy-ready

__getitem__()

Index the backing Python list of results. List indexing rules apply, including negative indices and IndexError outside the list.

Returns / value: DatasetResult.

def __getitem__(self, idx) -> DatasetResult
python1 lines · copy-ready
ParameterTypeRequired / defaultMeaning
idxNot annotatedRequiredPython list index for CrawlResults; negative indices follow list semantics.

__repr__()

Return a short debugging representation of the wrapper. This is not a data export or a stable serialization format.

Returns / value: str.

def __repr__(self) -> str
python1 lines · copy-ready

Errors and operational limits

Filesystem, pandas dependency and native result-shape errors may propagate.

Source availability, package publication and runtime validation are separate facts. These pages describe the source snapshot, not a claim that all platforms or every API path have passed production acceptance.