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

# Fetch Text Data

> List text chunks with pagination using the Python client

## documents.fetch\_text\_data

List stored text and summary chunks from a **text** namespace. Returns one page at a time (up to 100 items). Pass `next_token` from the previous response to fetch the next page.

```python theme={null}
client.documents.fetch_text_data(
    namespace_name: str,
    *,
    limit: int | None = None,
    next_token: str | None = None,
) -> dict[str, Any]
```

**API:** `GET /namespaces/{namespace_name}/documents/fetch-text-data` — see [Fetch text data](/on-prem/api-references/data/fetch-text-data)

### Parameters

<ParamField path="namespace_name" type="string" required>
  Text namespace to read from.
</ParamField>

<ParamField path="limit" type="integer">
  Page size. Default **100**, maximum **100**.
</ParamField>

<ParamField path="next_token" type="string">
  Cursor from `pagination.next_token` in a previous response.
</ParamField>

### Examples

```python theme={null}
from moorcheh import MoorchehClient

with MoorchehClient("http://localhost:8080") as client:
    all_items = []
    next_token = None

    while True:
        page = client.documents.fetch_text_data("my-documents", limit=100, next_token=next_token)
        all_items.extend(page.get("items", []))
        pagination = page.get("pagination", {})
        if not pagination.get("has_more"):
            break
        next_token = pagination.get("next_token")

    print(f"Fetched {len(all_items)} chunks")
```

## Response fields

Same shape as the REST API: `status`, `message`, `namespace`, `statistics`, `items`, `pagination`, `execution_time`.

## Related Operations

* [Upload Documents](/on-prem/python-client/data/upload-documents)
* [Search](/on-prem/python-client/search/query)
