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

# Data Formats

> Supported response formats: JSON, XML, and CSV.

Our API is designed to fit seamlessly into your workflow, whether you are building a web application or performing complex financial analysis. We currently support three output formats: **JSON** and **CSV** and **XML**.

## Specifying the Format

You can determine the response format using the `{format}` option in the URL structure (e.g., `/json/...`, `/csv/...`).

Please refer to specific endpoint documentation to see where the `{format}` parameter fits into the URL.

***

### JSON (Default)

JSON is the standard format for most implementations.

* **Methods:** Available as `GET` and `POST`.
* **Headers:** Set `Content-Type` to `application/json`.

<Note>
  **Shorthand URLs**

  Because JSON is the default format, you can omit the `{format}` segment in the URL.
  For example, `/currencies/all` is treated as a shorthand for `/json/currencies/all`.
</Note>

### CSV (Comma-Separated Values)

CSV support is provided specifically to assist **quantitative analysts ("quants")**, data scientists, and researchers.

* **Why use it:** It allows for easy import into spreadsheet software (like Excel) or dataframes (like Python Pandas) for backtesting and modeling.
* **Methods:** Available as `GET` and `POST`.
* **Structure:** The first row of the response is a header row containing column names; subsequent rows contain the exchange rate data.
* **Headers:** When requesting CSV, the input parameters are still processed as JSON, so the `Content-Type` header should be set to `application/json`.

The available method calls and input parameters are identical to the [JSON](#json-default) format - only the output is CSV-formatted.

### XML

<Warning>
  **Method Requirement**

  When requesting XML format, you must use the **POST** method. The `GET` method is not supported for XML responses.
</Warning>

* **Methods:** Available as `GET` and `POST`.
* **Headers:** Set `Content-Type` to `application/xml`.
* **Body:** Requires an XML-formatted request body.

Names of methods and parameters are identical to those in the JSON format.

<Note>
  Detailed parameter descriptions and example requests for all formats can be found in the main [JSON section](#json-default).
</Note>
