Building a Currency Converter in Ruby provides currency data with update rates ranging from daily to minutely update frequencies. Hence, it is the perfect data provider for your ruby currency converter. Developer experience is important to us. Therefore, you may access our API using ruby SDK, or alternatively via simple GET requests using a HTTP client. In this tutorial, we will focus on accessing the API directly using GET requests.

Simple Ruby on Rails Currency Converter Example:

Using the ruby SDK is really the most efficient method to build a ruby currency converter as the package is maintained by us and it requires the least amount of code lines. Assuming, you have the ruby package already installed, run the following code to obtain currency exchange data.


require 'net/http'
require 'json'

url = ""
uri = URI(url)
response = Net::HTTP.get(uri)
response_obj = JSON.parse(response)

rate = response_obj['data']

Since USD is set as a default base currency, all exchange rates are relative to USD. If you would like to change this, simply add the desired base_currency parameter to your request:


url = ""

In any case, you will end up with the following JSON response.

JSON response

      "...": "..."

The values in the JSON response are exchange rates. Since we intend to build a currency converter, we still have to multiply the exchange rate with the amount that we would like to convert, to end up with the desired result.

Converter Endpoint

If you do not wish to take this small extra step, provides an extra /convert endpoint that was specifically designed for this task. However, it is only available for plans >= medium.