For a recent Shopify job, I had to update a variety of prices by converting them to a different currency.
I found this great API from Fixr.io. It’s super fast to use (response times in less than 7ms), and responses themselves are simple JSON objects. The exchange rates are updated almost every day from the European Central Bank.
To demo it to you, I decided to build a currency conversion app that converted USD to NZD. You can view and play with this app online here.
The source code for it is all on GitHub as a gist:
What I realised that’s kinda amazing after I built this, is that a currency conversion app can be built in less than 75 lines of code. And that includes all the comments and styling. I also used the numeral.js library to format the numbers and jQuery for the DOM updates and Ajax request.
And, here is a video overview of the whole process you can watch:
[fusion_youtube id=”wfrztPhxsTc” width=”740″ height=”” autoplay=”false” api_params=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” class=””][/fusion_youtube]
Any questions or comments let me know! Thanks!