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

# JSON, CSV and XML formats

> Select a representation and handle errors before parsing the body.

<span id="como-se-pide" />

## Select a format

Use `?format=json|csv|xml` or the `Accept` header (`application/json`, `text/csv`, `application/xml`, `text/xml`). The query parameter takes precedence. Without an explicit selection, JSON is the default; do not rely on a browser’s `Accept` header to select formats automatically.

```bash theme={null}
curl --fail-with-body --max-time 10 -H "X-API-Key: $COTIZAVE_API_KEY" "https://api.cotizave.com/v1/fx/rates/reference?format=csv"
```

<span id="planes" />

## Plan access

CSV and XML require **Esencial or higher**. JSON is available on all plans, subject to endpoint and market access. Choosing JSON does not remove normal quota usage.

<span id="csv" />

## CSV structure

CSV uses commas as delimiters and decimal points. Objects are flattened with names such as `from.currency`. With one object collection, each item becomes a row and other fields repeat; collection columns use a prefix such as `rates.mid`. Columns include the union of present fields and can grow.

Multiple object collections cannot fit into one table: they may produce `406 format_not_available`. For `/route`, use JSON or XML. In spreadsheets, select the delimiter and number format explicitly when importing.

<span id="xml" />

## XML structure

The root is `<response>`. Each key becomes an element and array entries are named `<item>`. A null field becomes an empty element; an absent field is omitted. Illustrative fragment:

```xml theme={null}
<response><market>reference</market><type>reference</type><mid>475.0083</mid><updated_at>2026-10-19T04:00:00Z</updated_at><effective_date>2026-10-19</effective_date></response>
```

<span id="errores" />

## Check status before parsing

API-generated errors remain JSON even when requesting CSV/XML; a proxy may use another format. `400 invalid_format` indicates an unknown format, `402 feature_not_in_plan` missing access, and `406 format_not_available` an incompatible representation. The quickstart JSON clients are for JSON; do not pass them `format=csv` or `xml`.

<span id="cobertura" />

## Coverage

This selection applies to the API-key-authenticated routes documented here. It does not enable a disabled utility, convert currencies or change the language of identifiers or source-provided names.

Exporting JSON, CSV or XML does not grant resale or redistribution rights. No plan includes these rights without Cotizave’s prior written authorisation. See [data use](/en/data-use).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.