Skip to main content

Get Exchange Rate

Retrieves a single exchange rate record with its base currency and conversion rates.

HTTP Request​

  • URL: /exchangeRate/{id}
  • Method: GET
  • Headers:
    • accessToken: Required. Your API access token.
  • Required scope: None. Any valid access token can call this endpoint.

Path Parameters​

ParameterTypeDescription
idStringRequired. The ID of the exchange rate record.

cURL Example​

curl --location '<BASE_URL>/exchangeRate/66f1a2b3c4d5e6f708192a3b' \
--header 'accessToken: <ACCESS_TOKEN>'

Response​

  • 200 OK: The exchange rate record was returned successfully.
  • 400 Bad Request: The ID is not valid.

Sample JSON Response​

{
"success": true,
"data": {
"id": "66f1a2b3c4d5e6f708192a3b",
"baseCurrency": "USD",
"rates": [
{ "_id": "66f1a2b3c4d5e6f708192a3c", "currency": "EUR", "rate": 0.9214 },
{ "_id": "66f1a2b3c4d5e6f708192a3d", "currency": "GBP", "rate": 0.7712 }
],
"updatedAt": "2024-10-13T00:00:02.415Z",
"createdAt": "2024-09-23T17:41:07.902Z"
}
}

Response Details​

Exchange Rate Data​

FieldTypeDescription
idStringUnique identifier of the exchange rate record.
baseCurrencyStringCurrency the rates convert from, for example USD.
ratesArrayConversion rates. Each rate has _id, currency and rate.
updatedAtStringDate and time the rates were last updated (ISO 8601).
createdAtStringDate and time the record was created (ISO 8601).

Notes​

  • If no record matches the ID, data is an empty object.