FXR-API: Foreign Exchange Rates API
The Foreign eXchange Rates API (FXR-API) is a free web-based foreign exchange rates API that provides accurate, high-precision exchange rates for 160+ currencies across the world. Rates are gathered from multiple reliable international financial centers and subsequently normalized to ensure a true reflection of global market rates. Historical mid-market end-of-day rates are available since January 1, 2000 where applicable.
FXR-API has seen successful integration into many diverse applications such as web-based multi-currency e-commerce platforms to display product prices in any preferred currency, desktop-based accounting software to make currency conversions fully automatic and less error prone, personal finance mobile apps to track exchange rates, and (soon) even embedded devices! Use of FXR-API is completely free, without any signup requirements. See the full list of supported currencies.
Below are the various API resources that are currently available:
- GET /{currency}
- GET /{base-currency}/{counter-currency}
- GET /{base-currency}/{counter-currency}/{date}
GET /{currency}
This API resource returns a currency object representing basic currency information and latest foreign exchange rates for {currency} against a selected list of currencies, namely, USD, EUR, GBP, JPY, and CHF. If the exchange rate of the specified currency against one of the selected currencies is less than 1.0, the pairing is reversed with the specified currency becoming the counter currency instead. You may, however, disable this behavior by appending the query string parameter fixed
to the request. If the specified currency is not found, an HTTP 404 status response is triggered.
Example request:
https://dev.kwayisi.org/apis/forex/ghs
Example response:
{
"code": "GHS",
"name": "Ghana Cedi",
"rates": [
{
"date": "2017-04-05",
"pair": "USD/GHS",
"rate": 4.25
},
{
"date": "2017-04-05",
"pair": "EUR/GHS",
"rate": 4.5339
},
{
"date": "2017-04-05",
"pair": "GBP/GHS",
"rate": 5.3027
},
{
"date": "2017-04-05",
"pair": "GHS/JPY",
"rate": 26.0929
},
{
"date": "2017-04-05",
"pair": "CHF/GHS",
"rate": 4.2389
}
]
}
GET /{base-currency}/{counter-currency}
This API resource returns a quotation object representing the relative active (live) value of {base-currency} against {counter-currency} on the foreign exchange market. Unlike GET /{currency}, the specified base currency is unconditionally made the fixed currency of the currency pair. If either of the specified currencies is not found, an HTTP 404 status response is triggered.
Example request:
https://dev.kwayisi.org/apis/forex/usd/ghs
Example response:
{
"date": "2016-01-19",
"pair": "USD/GHS",
"rate": 3.8723
}
GET /{base-currency}/{counter-currency}/{date}
This API resource returns a quotation object representing the relative historical value of {base-currency} against {counter-currency} on the date {date} on the foreign exchange market. The date should be in the ISO 8601 format YYYY-MM-DD
. If either of the specified currencies is not found, or no currency data exists for the specified date, an HTTP 404 status response is triggered.
Example request:
https://dev.kwayisi.org/apis/forex/usd/ghs/2016-01-01
Example response:
{
"date": "2016-01-01",
"pair": "USD/GHS",
"rate": 3.8092
}
Currency object
Property | Type | Nullable? | Description |
---|---|---|---|
code | string | No | Currency code (ISO 4217) |
name | string | No | Name of currency (in English) |
rates | array | No | Array of quotation instances |
Quotation object
Property | Type | Nullable? | Description |
---|---|---|---|
date | string | No | Date of rate (ISO 8601) |
pair | string | No | Currency pair separated by slash (/) |
rate | float | No | Exchange rate for the pair |