Today, many services are provided to facilitate human life in digital environments. While the number of these services is increasing, human life continues to be facilitated, especially in financial services. Financial services have a very common usage network by people today.
The most frequently preferred transaction in financial services is currency exchange. Currency exchange offered to people by finance applications has saved people from a great deal of trouble. Nowadays, people can trade hundreds of currencies while eating or waiting in line through a single application.
Finance applications need to provide uninterrupted, fast, and accurate currency data while providing this service to people. There are many ways to achieve this in financial applications. Among these ways, the most popular one today is the use of the free currency exchange rate API. In this article, we will explain why the currency exchange rates API is the most popular way and we will do an integration. Let’s get started then.
Why currency exchange rates API is popular
Currency exchange rate API forms the basis of financial applications today. Currency data presented to users in finance applications is provided by currency exchange APIs.
Currency exchange APIs are obliged to provide the most up-to-date free currency api data they support to the applications. The accuracy of the data it provides is very important. Therefore, the accuracy of the data provided is the responsibility of the currency exchange APIs.
There are many benefits to using Currency exchange APIs in applications. First of all, there is no need to make any development related to currency exchange on the application side. If currency data is needed on the application side, a request is made to the currency exchange APIs and the currency data is obtained in the most up-to-date way.
Another popular advantage is the currency number supported by currency exchange APIs. Currency exchange APIs today generally support more than 100 official currencies around the world. Applications also allow their users to trade hundreds of currencies with a single application.
The main reason why various currency exchange rate APIs are preferred by finance applications is the historical data service. Some currency exchange APIs provide historical data for currencies. In this way, it tries to provide all kinds of analyzes to its users with historical data so that they can shape their investments in applications.
Fixer API is the currency exchange API preferred by many applications and developers, especially finance applications. It has been developed to meet almost anything a developer and application may need.
It supports 170 currencies. It obtains currency information from official financial institutions and updates its data every 60 seconds. In this way, it provides its customers with the most up-to-date data. It also provides historical data of currencies up to 1999.
Currency exchange APIs are frequently used by applications. Let’s integrate the Fixer API, which is the most popular currency exchange API today, into the Nodejs application.
Integration Fixer API to Nodejs
Before we integrate the Fixer API into the application, we need to obtain an API key. We choose one of the many flexible and affordable packages of Fixer API, including the free package, and sign up.
After obtaining the API key, we will create a Nodejs application. Then we paste the following codes into our application.
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://data.fixer.io/api/latest?access_key=c05*****ff',
'headers': {
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
When this code runs, the following information will be printed on the console of the application.
{
"success": true,
"timestamp": 1666682343,
"base": "EUR",
"date": "2022-10-25",
"rates": {
"AED": 3.621377,
"AFN": 85.374344,
"ALL": 116.853552,
"AMD": 395.763462,
"ANG": 1.764208,
"AOA": 449.01181,
"ARS": 152.485578,
"AUD": 1.55921,
"AWG": 1.776683,
"AZN": 1.68287,
"BAM": 1.94908,
"BBD": 1.976435,
"BDT": 99.559908,
"BGN": 1.95171,
"BHD": 0.371823,
"BIF": 2023.701279,
"BMD": 0.985951,
"BND": 1.392563,
"BOB": 6.763976,
"BRL": 5.232933,
"BSD": 0.9789,
"BTC": 5.1082093e-5,
"BTN": 80.998918,
"BWP": 13.192581,
"BYN": 2.482453,
"BYR": 19324.63167,
"BZD": 1.973047,
"CAD": 1.352004,
"CDF": 1996.549805,
"CHF": 0.98842,
"CLF": 0.035258,
"CLP": 972.886841,
"CNY": 7.203649,
"COP": 4919.893471,
"CRC": 608.41918,
"CUC": 0.985951,
"CUP": 26.127691,
"CVE": 109.885574,
"CZK": 24.471369,
"DJF": 174.264744,
"DKK": 7.438731,
"DOP": 52.786269,
"DZD": 138.281501,
"EGP": 19.422236,
"ERN": 14.789259,
"ETB": 51.832028,
"EUR": 1,
"FJD": 2.278187,
"FKP": 0.870126,
"GBP": 0.873715,
"GEL": 2.72111,
"GGP": 0.870126,
"GHS": 13.704518,
"GIP": 0.870126,
"GMD": 57.184753,
"GNF": 8444.669964,
[...]
}
}
When we look at the response from Fixer API, we see that we have obtained 170 currency data corresponding to Euro currency in just milliseconds.
Now we will look at how to get currency symbol information, which is another service of Fixer API. Let’s replace the code block that creates the request below with the previous code block.
var options = {
'method': 'GET',
'url': 'https://data.fixer.io/api/symbols?access_key=c0*****ff',
'headers': {
}
};
Now let’s run this code and look at the console of the application.
{
"success": true,
"symbols": {
"AED": "United Arab Emirates Dirham",
"AFN": "Afghan Afghani",
"ALL": "Albanian Lek",
"AMD": "Armenian Dram",
"ANG": "Netherlands Antillean Guilder",
"AOA": "Angolan Kwanza",
"ARS": "Argentine Peso",
"AUD": "Australian Dollar",
"AWG": "Aruban Florin",
"AZN": "Azerbaijani Manat",
"BAM": "Bosnia-Herzegovina Convertible Mark",
"BBD": "Barbadian Dollar",
"BDT": "Bangladeshi Taka",
"BGN": "Bulgarian Lev",
"BHD": "Bahraini Dinar",
"BIF": "Burundian Franc",
"BMD": "Bermudan Dollar",
"BND": "Brunei Dollar",
"BOB": "Bolivian Boliviano",
"BRL": "Brazilian Real",
"BSD": "Bahamian Dollar",
"BTC": "Bitcoin",
"BTN": "Bhutanese Ngultrum",
"BWP": "Botswanan Pula",
"BYN": "New Belarusian Ruble",
"BYR": "Belarusian Ruble",
"BZD": "Belize Dollar",
"CAD": "Canadian Dollar",
"CDF": "Congolese Franc",
"CHF": "Swiss Franc",
"CLF": "Chilean Unit of Account (UF)",
"CLP": "Chilean Peso",
"CNY": "Chinese Yuan",
"COP": "Colombian Peso",
"CRC": "Costa Rican Col\u00f3n",
"CUC": "Cuban Convertible Peso",
"CUP": "Cuban Peso",
"CVE": "Cape Verdean Escudo",
"CZK": "Czech Republic Koruna",
"DJF": "Djiboutian Franc",
"DKK": "Danish Krone",
"DOP": "Dominican Peso",
"DZD": "Algerian Dinar",
"EGP": "Egyptian Pound",
"ERN": "Eritrean Nakfa",
"ETB": "Ethiopian Birr",
"EUR": "Euro",
"FJD": "Fijian Dollar",
"FKP": "Falkland Islands Pound",
"GBP": "British Pound Sterling",
"GEL": "Georgian Lari",
"GGP": "Guernsey Pound",
"GHS": "Ghanaian Cedi",
"GIP": "Gibraltar Pound",
"GMD": "Gambian Dalasi",
"GNF": "Guinean Franc",
"GTQ": "Guatemalan Quetzal",
"GYD": "Guyanaese Dollar",
[...]
}
}
With just one request, we have obtained hundreds of currency symbols.
Conclusion
Using currency exchange APIs provides many advantages to finance applications. The data that forms the heart of finance applications are served by these APIs. If you want to increase user satisfaction in your applications and reduce your workload, take a look at the detailed documentation of Fixer API.
Recent Comments