# Currency conversion (Useful)

The currency conversion endpoint provides real-time exchange rates and calculates the converted amount for specified currency pairs, including both forex and cryptocurrencies. This endpoint is useful for obtaining up-to-date conversion values between two currencies, facilitating tasks such as financial reporting, e-commerce transactions, and travel budgeting.

**API credits cost:** `1` per symbol

## Parameters

- `symbol` (string, required)
  The currency pair you want to request can be either forex or cryptocurrency. Slash(`/`) delimiter is used. E.g. `EUR/USD` or `BTC/ETH` will be correct
  Example value: `EUR/USD`


- `amount` (number, required)
  Amount of base currency to be converted into quote currency. Supports values in the range from `0` and above
  Example value: `100`


- `date` (string, optional)
  If not null, will use exchange rate from a specific date or time. Format `2006-01-02` or `2006-01-02T15:04:05`. Is set in the local exchange time zone, use timezone parameter to specify a specific time zone
  Example value: `2006-01-02T15:04:05`


- `format` (string, optional)
  Value can be `JSON` or `CSV`. Default `JSON`
  Available values: `JSON`, `CSV`
  Default value: `JSON`


- `delimiter` (string, optional)
  Specify the delimiter used when downloading the `CSV` file. Default semicolon `;`
  Default value: `;`


- `dp` (integer, optional)
  The number of decimal places for the data
  Default value: `5`


- `timezone` (string, optional)
  Timezone at which output datetime will be displayed. Supports:

1. Exchange for local exchange time
2. UTC for datetime at universal UTC standard
3. Timezone name according to the IANA Time Zone Database. E.g. America/New_York, Asia/Singapore. Full list of timezones can be found here.

Take note that the IANA Timezone name is case-sensitive
  Example value: `UTC`



## Response

- `` (object)
  - `symbol` (string)
    Requested currency symbol
  - `rate` (number)
    Real-time exchange rate for the corresponding symbol
  - `amount` (number)
    Amount of converted currency
  - `timestamp` (integer)
    Unix timestamp of the rate


## Example Request

```bash
curl "https://api.twelvedata.com/currency_conversion?symbol=EUR/USD&amount=100&apikey=demo"
```

## Example Response

```json
{
    "symbol": "USD/JPY",
    "rate": 105.12,
    "amount": 12824.64,
    "timestamp": 1602714051
}
```
