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

# Getting Tasks

> Learn how to retrieve and read task information from Chunkr AI

You can retrieve information about a task at any time using the `get_task()` method
This is useful for checking the status of previously created tasks or accessing their results.

## Basic Usage

<CodeGroup>
  ```python Python theme={"system"}
  from chunkr_ai import Chunkr
  chunkr = Chunkr()

  # Get task by ID
  task = chunkr.get_task("task_123")

  # Access task information
  print(task.status)
  print(task.output)
  ```
</CodeGroup>

## Customizing the Response

The `get_task()` method accepts two optional parameters to customize the response:

<CodeGroup>
  ```python Python theme={"system"}
  # Exclude chunks from output
  task = chunkr.get_task("task_123", include_chunks=False) 

  # Get task with base64-encoded URLs instead of presigned URLs
  task = chunkr.get_task("task_123", base64_urls=True)
  ```
</CodeGroup>

## Response Options

| Parameter        | Default | Description                                                                                                                  |
| ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `include_chunks` | `True`  | When `True`, includes all processed chunks in the response. Set to `False` to receive a lighter response without chunk data. |
| `base64_urls`    | `False` | When `True`, returns URLs as base64-encoded strings. When `False`, returns presigned URLs for direct access.                 |

## Async Usage

For async applications, remember to use `await`:

<CodeGroup>
  ```python Python theme={"system"}
  # Get task asynchronously
  task = await chunkr.get_task("task_123")
  ```
</CodeGroup>

## Best Practices

* Store task IDs when creating tasks if you need to retrieve them later
* Use `include_chunks=False` when you only need task metadata
* Consider using base64 URLs (`base64_urls=True`) when you need to cache or store the URLs locally

<CodeGroup>
  ```python Python theme={"system"}
  # Get task with base64-encoded URLs
  task = chunkr.get_task("task_123", base64_urls=True)

  # Get task without chunks
  task = chunkr.get_task("task_123", include_chunks=False)
  ```

  ```bash cURL theme={"system"}
  # Get task with base64-encoded URLs
  curl -X GET "https://api.chunkr.ai/api/v1/task/{task_id}?base64_urls=true" -H "Authorization: YOUR_API_KEY"

  # Get task without chunks
  curl -X GET "https://api.chunkr.ai/api/v1/task/{task_id}?include_chunks=false" -H "Authorization: YOUR_API_KEY"
  ```
</CodeGroup>
