---
title: "Client.download"
description: "Atomically download an asset to an exact local path."
image: "https://tilebox.com/images/tilebox-docs-social-preview.png"
---

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

# Client.download

import { Fragment } from "astro/jsx-runtime";
import ApiReference from "@docs/components/ApiReference.astro";
import ParamField from "@docs/components/ParamField.astro";

```python
async def Client.download(
    asset: Asset,
    destination: str | PathLike[str],
    *,
    overwrite: bool = False,
) -> Path
```

Atomically download an asset to an exact local path.

## Parameters

**asset**

type: Asset

The asset to resolve and download.
**destination**

type: str | PathLike[str]

The destination path. Missing parent directories are created.
**overwrite**

type: bool

Whether to replace an existing destination. Defaults to `False`.

## Returns

The destination as a `Path`.

<h2 id="request-example">Usage example</h2>

Query Sentinel-2 and download the first scene's thumbnail. Run this example in a notebook or another async context.

```python
from shapely import box
from tilebox.datasets import Client, iter_datapoints
from tilebox.datasets.assets import AssetCollection
from tilebox.storage.aio import Client as StorageClient

collection = Client().dataset("open_data.aws_earth.sentinel2").collection("L2A")
data = collection.query(
    temporal_extent=("2026-07-20", "2026-07-28"),
    spatial_extent=box(16.25, 48.15, 16.35, 48.22),
)
datapoint = next(iter_datapoints(data))
assets = AssetCollection.from_datapoint(datapoint)

storage = StorageClient()
path = await storage.download(assets["thumbnail"], "data/thumbnail.jpg")
print(path)
```

The query must return at least one datapoint. An existing destination raises `FileExistsError`; pass `overwrite=True` to replace it.

Source: https://tilebox.com/docs/api-reference/python/tilebox.storage.aio/Client.download/index.mdx
