100% free and open source forex and currency conversion API

Introduction

moneymorph is a free and open source forex and currency conversion API. It provides real-time exchange rates for many world currencies, delivered in JSON format. It is a simple and easy-to-use API that can be used to convert one currency to another.

The API is free to use and does not require any authentication. It is designed to be almost feature comparable to Open Exchange Rates API, which almost makes it a drop-in replacement, and 100% compatible with libraries such as money.js. The missing features compared to commercial APIs are historical exchange rates and time-series data, which is not planned to be implemented, as it would greatly increase the complexity, and the cost of running the service. If you need historical exchange rates, I recommend using the a commercial API, such as Open Exchange Rates, or Fixer. But if you just need the latest exchange rates, and the ability to convert between currencies, moneymorph is the perfect choice.

Why free? Well, because of two things. First, I have had the need for this API in the past and I didn't want to pay a huge premium for it. Second, I wanted to see how far the Phoenix framework and Elixir can go in terms of performance.

While the API is free to use, it does cost a little money to run, so if you find it useful, please consider buying me a coffee, to help keep the lights on.

Contribution

moneymorph is an open source project and contributions are welcome. If you would like to contribute to the project, please check out the GitHub repository and submit a pull request.

Right now, the project is in its early stage, and there's no roadmap other than making it feature comparable to Open Exchange Rates API. If you have any ideas or suggestions, please feel free to open an issue on GitHub.

GET /api/latest

The /api/latest endpoint returns the latest exchange rates for all available currencies. The available currencies are indexed by their standard ISO 4217 currency codes.

The exchange rates are calculated relative to the base currency, which is the currency that the rates are quoted against. This is by default set to USD, but can be changed by passing the base parameter.

Example

curl --location --request GET 'https://moneymorph.dev/api/latest'
  --header 'Content-Type: application/json'
      

Response

{
    "timestamp": 1729536414,
    "base": "USD",
    "rates": {
        "AUD": 1.4954,
        "BGN": 1.8021,
        "BRL": 5.7084,
        ...
    }
}
      

Query Parameters

Parameter Description
base Optional. The base currency to use for exchange rate calculation. By default, this is set to USD.
symbols Optional. A comma-separated list of currency codes to limit the output to. If not specified, all available currencies will be returned.

GET /api/currencies

The /api/currencies endpoint returns a list of all available currencies. The currencies are indexed by their standard ISO 4217 currency codes.

Example

curl --location --request GET 'https://moneymorph.dev/api/currencies'
  --header 'Content-Type: application/json'
      

Response

{
    "AUD": "Australian Dollar",
    "BGN": "Bulgarian Lev",
    "BRL": "Brazilian Real",
    ...
}
      

GET /api/convert/:amount/:from/:to

The /api/convert endpoint converts an amount from one currency to another. The amount to convert, the source currency, and the target currency are part of the URL.

Example

curl --location --request GET 'https://moneymorph.dev/api/convert/10/USD/EUR'
  --header 'Content-Type: application/json'
      

Response

{
    "meta": {
        "timestamp": 1729536702,
        "rate": 0.9214
    },
    "request": {
        "to": "EUR",
        "query": "/convert/10.0/USD/EUR",
        "from": "USD",
        "amount": 10.0
    },
    "response": 9.214
}
      

Path Parameters

Parameter Description
amount Required. The amount to convert. Must be a number.
from Required. The source currency code.
to Required. The target currency code.