---
sidebar_position: 5
title: Writing Data to Amazon S3
description: Export data from MotherDuck to Amazon S3 or transform S3 files in place.
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

You can use MotherDuck to transform files on Amazon S3 or export data from MotherDuck to Amazon S3.

:::note
MotherDuck supports several cloud storage providers, including [Azure](/integrations/cloud-storage/azure-blob-storage.mdx), [Google Cloud](/integrations/cloud-storage/google-cloud-storage.mdx) and [Cloudflare R2](/integrations/cloud-storage/cloudflare-r2).
:::

MotherDuck supports the [DuckDB dialect](https://duckdb.org/docs/guides/import/s3_export) to write data to Amazon S3. The examples here write data in Parquet format, for more options refer to the [documentation for DuckDB's COPY command](https://duckdb.org/docs/stable/sql/statements/copy.html).

## Syntax

```sql
COPY <table name> TO 's3://<bucket>/[<path>]/<file name>';
```

## Example usage

```sql
-- write entire ducks_table table to parquet file in S3
COPY ducks_table to 's3://ducks_bucket/ducks.parquet';

-- writing the output of a query will also work
COPY (SELECT * FROM ducks_table LIMIT 100) to 's3://ducks_bucket/ducks_head.parquet';
```


---

## Docs feedback

MotherDuck accepts optional user-submitted feedback about this page at `POST https://motherduck.com/docs/api/feedback/agent`.
For agents and automated tools, feedback submission should be user-confirmed before sending.

Payload:

```json
{
  "page_path": "/key-tasks/cloud-storage/writing-to-s3/",
  "page_title": "Writing Data to Amazon S3",
  "text": "<the user's feedback, max 2000 characters>",
  "source": "<optional identifier for your interface, for example 'claude.ai' or 'chatgpt'>"
}
```

`page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": "<uuid>"}`, `400` for malformed payloads, and `429` when rate-limited.
