Skip to main content
documents.ground finds supplied text in a document and returns source locations. Use it to connect a value or quote back to evidence.
Ground locates text. It does not determine whether a claim is true.

Basic usage


Method signature

Parameters

Returns

A Job. After success, job.result is a GroundResult:

Define targets

Every target needs an ID and the text to locate:
The ID is echoed in the result. Join request targets to results by id, not by quoted text.

Disambiguate repeated text

Add nearby context with hint:
On HTML sources, the visible occurrence nearest the hint ranks first. Without a hint, the first visible occurrence ranks first.

Match by meaning (deprecated)

semantic is deprecated for now. Don’t rely on it: a target with semantic=True can come back with status failed and error semantic_mode_deprecated. Quote the text exactly as it appears in the source.

Select a worksheet

Use sheet to narrow a workbook target to one tab:
sheet is ignored for non-spreadsheet sources.

Configure matching

minimum_semantic_score does not affect exact or normalized matches. require_visual_region exists in the model but is not supported by the current runtime; do not enable it.

Experimental word-level matching

Targets shorter than two normalized characters fail with needle_too_short.

Response structure

Each target has an independent outcome:
not_found is a successful answer about the document; the job itself remains succeeded. failed means that target encountered an error. Matches are sorted best-first:

Location types

The location model follows the source:

Ground response format

Review target status, ranking, match methods, locator fields, and related artifacts.

Preview visual matches

The URL is authenticated and short-lived. Pass it directly to jobs.ground_crop to fetch the bytes through the SDK:
Do not construct an artifact reference. The SDK accepts the complete returned URL and extracts its reference.

Reuse a parse


Async ground


Complete example


Error handling

Distinguish a failed job from per-target not_found and failed statuses. Common request errors include an empty target list, more than 30 targets, an unsupported option, or a source the current grounding path cannot read.

Best practices

Use exact source text

Quote the text as written. Semantic matching is deprecated for now.

Add nearby context

Use hint to rank the intended occurrence when a quote repeats.

Join on target ID

Treat the caller-defined ID as the stable key between request and response.

Handle not_found

A missing quote is a successful document-level answer, not an exception.

Next steps