Skip to Content
🚀 Trusted by travel businesses worldwide - Roamify eSIM API
Exchange RatesGet Exchange Rates

Get Exchange Rates

Table of Contents

Get latest exchange rates

To get the latest exchange rates, you need to send a GET request to the /api/rates endpoint.

The request parameters does not require any parameters.

Usage - fetch all latest exchange rates

Here is an example of how to fetch all latest exchange rates using curl and JavaScript (Axios):

curl --request GET \ --url 'https://api-dev.getroamify.com/api/rates' \ --header 'Authorization: Bearer Access Token' \ --header 'Content-Type: application/json'

Convert Currency

To convert an amount from one currency to another, you need to send a GET request to the /api/rates endpoint.

The request parameters should contain the following:

  • source: The source currency code. This is a required field of type string.
  • target: The target currency code. This is a required field of type string.
  • datetime: optional, The date and time for which you want the exchange rate. This is an optional field of type string in ISO 8601 format. If not provided, the latest exchange rate will be used.

Usage - convert currency

Here is an example of how to convert currency using curl and JavaScript (Axios):

curl --request GET \ --url 'https://api-dev.getroamify.com/api/rates?source=USD&target=EUR&datetime=2023-01-01T00:00:00Z' \ --header 'Authorization: Bearer Access Token' \ --header 'Content-Type: application/json'

Get Historical Exchange Rates

To get historical exchange rates for a specific date, you need to send a GET request to the /api/rates endpoint.

The request parameters should contain the following:

  • source: The source currency code. This is a required field of type string.
  • target: The target currency code. This is a required field of type string.
  • from: The start date for the historical data. This is a required field of type string in ISO 8601 format.
  • to: The end date for the historical data. This is a required field of type
  • interval: The interval for the historical data. This is an optional field of type string. Possible values are day, hour, minute.

Usage - get historical exchange rates

Here is an example of how to get historical exchange rates using curl and JavaScript (Axios):

curl --request GET \ --url 'https://api-dev.getroamify.com/api/rates?source=USD&target=EUR&from=2023-01-01T00:00:00Z&to=2023-01-07T00:00:00Z&interval=day' \ --header 'Authorization: Bearer Access Token' \ --header 'Content-Type: application/json'
Last updated on