1.0.0 • Public • Published


A simple way to get up-to-date exchange rates for Bitcoin and major national currencies. Does not require an API key.

Data format

The base is currently in Euro - this means that the rates will indicate how much currency is equivalent to 1 Euro.

Rates are automatically cached for 5 minutes (but this is configurable), and there's currently no historical rate search.

Currently supported currencies (and their sources):

  • BTC - Bitcoin (

  • USD - United States Dollar (ECB, via

  • CAD - Canadian Dollar (ECB, via

  • GBP - British Pound (ECB, via

  • CNY - Chinese Yuan (ECB, via

  • RUB - Russian Ruble (ECB, via

  • JPY - Japanese Yen (ECB, via

  • AUD - Australian Dollar (ECB, via

  • NZD - New Zealand Dollar (ECB, via

  • BGN - Bulgarian Lev (ECB, via

  • BRL - Brazilian Real (ECB, via

  • CHF - Swiss Franc (ECB, via

  • CZK - Czech Koruna (ECB, via

  • DKK - Danish Krone (ECB, via

  • HKD - Hong Kong Dollar (ECB, via

  • HRK - Croation Kuna (ECB, via

  • HUF - Hungarian Forint (ECB, via

  • IDR - Indonesian Rupiah (ECB, via

  • ILS - Israeli Shekel (ECB, via

  • INR - Indian Rupee (ECB, via

  • KRW - South Korean Won (ECB, via

  • MXN - Mexican Peso (ECB, via

  • MYR - Malaysian Ringgit (ECB, via

  • NOK - Norwegian Krone (ECB, via

  • PHP - Philippine Peso (ECB, via

  • PLN - Polish Zloty (ECB, via

  • RON - Romanian New Leu (ECB, via

  • SEK - Swedish Krona (ECB, via

  • SGD - Singapore Dollar (ECB, via

  • THB - Thai Baht (ECB, via

  • TRY - Turkish Lira (ECB, via

  • ZAR - South African Rand (ECB, via

Each currency can be accessed from the result by its 3-letter abbreviation.

Note that currencies are subject to change; the module does not currently do any validation, so availability of rates may change if or the ECB decides to change them. This list of currencies was up-to-date as of September 20, 2015.


WTFPL or CC0, whichever you prefer. A donation and/or attribution are appreciated, but not required.


My income consists largely of donations for my projects. If this module is useful to you, consider making a donation!

You can donate using Bitcoin, PayPal, Flattr, cash-in-mail, SEPA transfers, and pretty much anything else.


Pull requests welcome. Please make sure your modifications are in line with the overall code style, and ensure that you're editing the .coffee files, not the .js files.

Build tool of choice is gulp; simply run gulp while developing, and it will watch for changes.

Be aware that by making a pull request, you agree to release your modifications under the licenses stated above.


A simple example:

var Promise = require("bluebird");
var getExchangeRates = require("get-exchange-rates");
Promise.try(function() {
    return getExchangeRates();
}).then(function(rates) {
    var amountInEuro = 2;
    var amountInUSD = amountInEuro * rates.USD;
    console.log(amountInEuro + " EUR = " + amountInUSD + " USD");
    // eg. "2 EUR = 2.2838 USD"



Retrieves the exchange rates - either from the cache, or remotely. If retrieved remotely, the results are automatically cached. The rates are not rounded - you are responsible for doing this yourself.

Returns a Promise, that resolves with an object containing the rates.

The function will never reject - if either of the APIs is unavailable, the function will simply return stale rates. This may be changed at a later point (and will, in line with semantic versioning, result in a major version bump).

  • cacheExpiration: Optional, defaults to 5 minutes. The duration in seconds, after which the cache should expire. The first call after this duration will result in the cache being repopulated. This option will only take effect if the result is retrieved remotely. Be respectful to the API operators; please do not set this lower than 5 minutes (300 seconds).

Package Sidebar


npm i get-exchange-rates

Weekly Downloads






Last publish


  • joepie91