> ## 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 quoted text

> Pin a quote to a location in the source

Ground locates target text. It is target location, not claim verification.

<Tabs>
  <Tab title="Python">
    ```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)
    ```
  </Tab>

  <Tab title="TypeScript">
    ```ts theme={"dark"}
    import { NdiClient } from "ndi-sdk";

    const client = new NdiClient();
    const upload = await client.documents.createUpload("report.pdf");
    const job = await client.jobs.wait(
      (
        await client.documents.ground(upload, {
          targets: [{ id: "total", text: "1,200.50" }],
          wait_seconds: 30,
        })
      ).job_id,
    );
    console.log(job.result);
    ```
  </Tab>

  <Tab title="curl">
    ```bash theme={"dark"}
    UPLOAD_ID=$(curl -s -X POST "$NDI_BASE_URL/v1/uploads" \
      -H "X-API-Key: $NDI_API_KEY" \
      -F "file=@report.pdf" | jq -r '.upload_id')

    curl -s -X POST "$NDI_BASE_URL/v1/ground?wait_seconds=60" \
      -H "X-API-Key: $NDI_API_KEY" \
      -H "Content-Type: application/json" \
      -d "{\"source\":{\"type\":\"upload\",\"upload_id\":\"$UPLOAD_ID\"},\"targets\":[{\"id\":\"total\",\"text\":\"1,200.50\"}]}"
    ```
  </Tab>
</Tabs>

Pass 1–30 targets. Optional `hint` (nearby context) and `sheet` (spreadsheet
tab) disambiguate. Set
`options.include_previews=true` to mint crop URLs; fetch them with the same
API key via `client.jobs.ground_crop` or
`GET /v1/jobs/{job_id}/ground-crops/{artifact_ref}`.

A `parse_result` source is supported. See [Ground response](/guides/ground-response).
