> ## 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.

# Export to different formats

Chunkr AI allows you to export task results in multiple formats. You can get the content directly and save it to a file.

## Available Export Formats

### HTML Export

This will collate the `html` from every `segment` in all `chunks`, and create a single HTML file.

<CodeGroup>
  ```python Python theme={"system"}
  # Get HTML content as string
  html = task.html()

  # Or save directly to file
  html = task.html(output_file="output/result.html")
  ```
</CodeGroup>

### Markdown Export

This will collate the `markdown` from every `segment` in all `chunks`, and create a single markdown file.

<CodeGroup>
  ```python Python theme={"system"}
  # Get markdown content as string
  md = task.markdown()

  # Or save directly to file
  md = task.markdown(output_file="output/result.md")
  ```
</CodeGroup>

### Text Export

This will collate the `content` from every `segment` in all `chunks`, and create a single text file.

<CodeGroup>
  ```python Python theme={"system"}
  # Get plain text content as string
  text = task.content()

  # Or save directly to file
  text = task.content(output_file="output/result.txt")
  ```
</CodeGroup>

### JSON Export

This will return the complete task data.

<CodeGroup>
  ```python Python theme={"system"}
  # Get complete task data as dictionary
  json = task.json()

  # Or save directly to file
  json = task.json(output_file="output/result.json")
  ```
</CodeGroup>

## File Output

When using the `output_file` parameter:

* Directories in the path will be created automatically if they don't exist
* Files are written with UTF-8 encoding
* Existing files will be overwritten

Example with custom path:

<CodeGroup>
  ```python Python theme={"system"}
  # Create nested directory structure and save file
  task.html(output_file="exports/2024/january/result.html")
  ```
</CodeGroup>
