# FX Swap

## Get FX Rates History

Retrieve historical FX rates for a currency pair within an optional date range.

### Request

**GET**  
``/api/v1/fx/rates/history``

### Authorization

- **BearerAuth**  
  Authorization: Bearer `<token>`  
  In: `header`

### Query Parameters

- **from_currency** `string`
  - 3-letter source currency code  
  - Length: `3 <= length <= 3`

- **to_currency** `string`
  - 3-letter destination currency code  
  - Length: `3 <= length <= 3`

- **start_date?** `string`
  - Start date for the history window  
  - Format: `date`

- **end_date?** `string`
  - End date for the history window  
  - Format: `date`

- **page?** `integer`
  - Pagination page number  
  - Range: `1 <= value`

- **limit?** `integer`
  - Number of records per page  
  - Range: `1 <= value <= 200`

### Response Body

#### 200  application/json

```json
{
  "requestId": "737a4b93-d6fc-43e3-936f-217b58f4a4b9",
  "requestTimestamp": "2026-04-21 14:28:11",
  "message": "FX rates history fetched successfully.",
  "statusCode": 200,
  "data": [
    {
      "fromCurrency": "NGN",
      "toCurrency": "USD",
      "rate": 1587.42,
      "recordedAt": "2026-03-12T10:30:00+00:00"
    }
  ],
  "links": {},
  "meta": {}
}
```

### cURL Example

```bash
curl -X GET "https://atlas.tryduplo.com/api/v1/fx/rates/history?from_currency=NGN&to_currency=USD&start_date=2026-03-01&end_date=2026-03-31&page=1&limit=20" \
  -H "Authorization: Bearer "
```

### How is this guide?

Good / Bad

**Last updated on:** 5/27/2026
