# Exchange Rates

Retrieve real-time exchange rates for currency pairs using the Atlas Exchange Rate API.

Before initiating a swap request, you can look up the current exchange rate between two currencies using the [Get Exchange Rates](https://docs.tryduplo.com/atlas/exchange-rate/getExchangeRates) endpoint. This lets you display live rates to your users or calculate expected amounts ahead of the swap. The supported currencies include **NGN (Nigerian Naira)**, **USD (United States Dollars)**, **GBP (Pounds Sterling)**, **EUR (Euro)**.

## [Fetching an exchange rate](https://docs.tryduplo.com/en/atlas/guides/rates#fetching-an-exchange-rate)

To retrieve the exchange rate for a currency pair, make a GET request to the [Get Exchange Rates](https://docs.tryduplo.com/atlas/exchange-rate/getExchangeRates) endpoint with the source and destination currency codes.

The required parameters are:

- `from_currency`: The 3-letter ISO 4217 code for the source currency (e.g. `NGN`).
- `to_currency`: The 3-letter ISO 4217 code for the destination currency (e.g. `USD`).

Note

Currently, all conversions MUST be quoted in `NGN`. This effectively makes `NGN` the only possible value for `from_currency`.

### cURL

```
curl -X GET "https://atlas.tryduplo.com/api/v1/exchange-rate/fetch?from_currency=NGN&to_currency=USD" \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Accept: application/json"
```

On a successful request, you should receive a response similar to the one below:

### JSON

```
{
  "requestId": "3a6538fd-03f0-4b05-ba41-5d44769dd014",
  "requestTimestamp": "2026-02-20 10:15:30.123",
  "message": "Exchange rate retrieved successfully.",
  "statusCode": 200,
  "data": {
    "id": "b3a2e3ac-2744-4fb8-8f5f-49555f1637e1",
    "fromCurrency": "NGN",
    "toCurrency": "USD",
    "currentRate": "2046.77",
    "previousRate": "2046.77",
    "status": "active",
    "createdAt": "2026-02-20 10:15:30.123",
    "updatedAt": "2026-02-20 10:15:30.123"
  }
}
```

The `currentRate` field is the active exchange rate for the currency pair. The `previousRate` field reflects the rate before the last update, which you can use to indicate rate movement to your users.

### [Fetching exchange rates over 24-hour period](https://docs.tryduplo.com/en/atlas/guides/rates#fetching-exchange-rates-over-24-hour-period)

You can also fetch the exchange rates for a currency pair over a 24-hour time period. This is useful for audits and conflict resolution.

To fetch the data, make a GET request to the [Rates History](https://docs.tryduplo.com/atlas/fx-swap/getFxRatesHistory) endpoint with the same query parameters as the Get Exchange Rates endpoint.

### cURL

```
curl -X GET "https://atlas.tryduplo.com/api/v1/fx/rates/history?from_currency=NGN&to_currency=USD" \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Accept: application/json"
```

You should get a response similar to the below:

### 24-Hour Rates Data

```

```
