How to Find a Country’s Currency in Node.JS

Online commerce can help your business grow beyond the confines of your locality. The issue arises, however, when beginning to work with global currencies. To ensure the best experience for both you and your clients and customers, the following API will auto-populate an input country’s national currency, ISO code, and currency symbol.

Image for post
Image for post

First, we need to install our client software:

npm install cloudmersive-validate-api-client --save

Or, you can add this snippet to your package.json:

"dependencies": {
"cloudmersive-validate-api-client": "^1.2.4"
}

Then, we can call our function, AddressGetCountryCurrency:

var CloudmersiveValidateApiClient = require('cloudmersive-validate-api-client');
var defaultClient = CloudmersiveValidateApiClient.ApiClient.instance;
// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';
var apiInstance = new CloudmersiveValidateApiClient.AddressApi();var input = new CloudmersiveValidateApiClient.ValidateCountryRequest(); // ValidateCountryRequest | Input requestvar callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.addressGetCountryCurrency(input, callback);

Now, you can more easily expand your organization while providing excellent service to your clients. To retrieve your personal API key, you can visit the Cloudmersive website. This will give you access to up to 800 calls across our library of APIs.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store