# Export costs

Download every period, resource and usage type row of a cost explorer view as a CSV, for a German Excel or for scripts.

For your accounting software, see [Export costs to DATEV](export-to-datev.md).

## Prerequisites

- Permission for `billing:GetCostAndUsage`.
- `iam:UpdateOrganization` to export a view grouped or filtered by where resources run.

## Download the CSV

**Console**
1. Open **Cost explorer** and set up the view (see [Explore costs](explore-costs.md)).
2. Choose **CSV for Excel (German)** or **CSV (machine-readable)**.

**CLI**
```sh
dcloud billing costs export --start 2026-10-01 --end 2026-10-31 \
  --format excel-de > october.csv
```

**API**
```http
POST /billing/api/cost-explorer/export?format=excel-de
{ "start": "2026-10-01", "end": "2026-10-31", "granularity": "day" }
```

## Result

One row per period of the chosen granularity, resource and usage type, with the columns
`period_start`, `service`, `service_name`, `usage_type`, `usage_type_name`, `resource_type`,
`resource_id`, `resource_name`, `region`, `zone`, `projects`, `created_by`, `tags`, `quantity`,
`unit`, `amount_eur` and `runs_on`.

| Format                 | `format`            | Shape                                                                                                       |
| ---------------------- | ------------------- | ----------------------------------------------------------------------------------------------------------- |
| CSV (machine-readable) | `machine` (default) | Commas, decimal points, the column ids above, `amount_eur` unrounded with eight decimals                    |
| CSV for Excel (German) | `excel-de`          | Semicolons, decimal commas, column names in words, dates as DD.MM.YYYY, euros to the cent, UTF-8 with a BOM |

The machine-readable file sums to the explorer's total exactly. Rounding each row of the Excel file
to the cent can make its sum differ from the total by a few cents.

## Related

- [Export costs to DATEV](export-to-datev.md)
- `billing.costs.export` · `dcloud billing costs export`
