> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ndi.nace.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Ground

> Pin quoted text to a location in the source

Ground is target location, not claim verification. Pass 1–30 targets.

```python theme={"dark"}
from ndi_sdk import NdiClient
from ndi_sdk.models.document_ops import GroundTarget

with NdiClient() as client:
    upload = client.documents.create_upload("report.pdf")
    job = client.jobs.wait(
        client.documents.ground(
            upload,
            targets=[GroundTarget(id="total", text="1,200.50")],
            wait_seconds=30,
        ).job_id
    )
    for target in job.result.targets:
        for match in target.matches:
            print(target.id, match.matched_text, match.location)
```

## Method signature

```text theme={"dark"}
def ground(
    source: DocumentSource | UploadResponse,
    *,
    targets: list[GroundTarget],
    options: GroundOptions | None = None,
    wait_seconds: int = 0,
    idempotency_key: str | None = None,
) -> Job
```

### Parameters

| Parameter      | Type                                 | Required | Description                           |
| -------------- | ------------------------------------ | -------- | ------------------------------------- |
| `source`       | `DocumentSource` or `UploadResponse` | Yes      | File or prior parse                   |
| `targets`      | `list[GroundTarget]`                 | Yes      | 1–30 quoted strings                   |
| `options`      | `GroundOptions`                      | No       | `max_matches`, `include_previews`     |
| `wait_seconds` | `int`                                | No       | Hold the HTTP response open (max 300) |

### Returns

A `Job`. On success, `result.targets[].matches` carries locators. `not_found`
is an answer about the document.

Set `options.include_previews=True` to mint crop URLs. Fetch them with
`client.jobs.ground_crop(job_id, artifact_ref)`.

See [Ground guide](/guides/ground) and [Ground response](/guides/ground-response).
