Get Exchange Rates

Get Exchange Rates

Fetch the latest exchange-rate records for a requested currency pair, with optional pagination over the returned rate history.

API Endpoint

GET `/api/v1/exchange-rate/fetch`

Authorization

BearerAuth

AuthorizationBearer

In: header

Query Parameters

Response Body

200 application/json

401 application/json

422 application/json

500 application/json

Example cURL Request

curl -X GET "https://atlas.tryduplo.com/api/v1/exchange-rate/fetch?from_currency=NGN&to_currency=KES&page=1&limit=10" \  
-H "Authorization: Bearer "

Sample Responses

Successful Response

{
  "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"
  }
}

Unauthenticated Response

{
  "requestId": "f006ad7b-096c-4254-8c7e-2d23a55b0b0e",
  "requestTimestamp": "2026-02-20 10:15:30.123",
  "message": "Unauthenticated.",
  "statusCode": 401
}

Invalid Data Response

{
  "requestId": "f006ad7b-096c-4254-8c7e-2d23a55b0b0e",
  "requestTimestamp": "2026-02-20 10:15:30.123",
  "message": "The given data was invalid.",
  "errors": {
    "from_currency": [
      "The from currency field is required."
    ]
  },
  "statusCode": 422
}

Server Error Response

{
  "requestId": "f006ad7b-096c-4254-8c7e-2d23a55b0b0e",
  "requestTimestamp": "2026-02-20 10:15:30.123",
  "message": "An error occurred while processing your request.",
  "statusCode": 500
}

Feedback

How is this guide?

Good | Bad

Last updated on 5/27/2026