# export

Export a warehouse table to a file. Returns a download URL (24 h expiry) or writes to cloud storage.

**Formats:** `geoparquet`, `geojson`, `shapefile`, `csv`, `geopackage`, `kml`, `kmz`, `tab`.

```bash
carto export --connection <name> --source <table> --format <fmt>
carto export status <jobId>                     # Fetch status of an async export job
```

## Options

| Option                | Description                                          |
| --------------------- | ---------------------------------------------------- |
| `--connection <name>` | (Required) Connection name.                          |
| `--source <fqn>`      | (Required) Source table name.                        |
| `--format <fmt>`      | (Required) Output format.                            |
| `--select <cols>`     | Comma-separated columns to project (default: all).   |
| `--where <predicate>` | Warehouse-native SQL predicate (no leading `WHERE`). |
| `--limit <n>`         | Max rows to export.                                  |
| `--dest-url <url>`    | Direct cloud destination (`gs://`, `s3://`).         |
| `--async`             | Return job ID immediately without waiting.           |

## Examples

```bash
# Export as GeoParquet (waits, prints download URL)
carto export --connection carto_dw --source project.dataset.my_table --format geoparquet

# Export selected columns with a WHERE predicate and a row limit
carto export \
  --connection carto_dw \
  --source project.dataset.my_table \
  --format csv \
  --select name,lon,lat \
  --where "year = 2025" \
  --limit 10000

# Export directly to cloud storage
carto export \
  --connection carto_dw \
  --source project.dataset.my_table \
  --format geojson \
  --dest-url gs://my-bucket/exports/data.geojson

# Kick off async, then poll status separately
carto export --connection carto_dw --source project.dataset.big --format csv --async
carto export status <jobId>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.carto.com/carto-for-agents/cli/command-reference/export.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
