Tracking Exchange Rates When TravellingMar 01
I've recently been travelling a lot (which as my family is well aware, is a normal state!) and wanted to be able to easily keep track of the exchange rate, plus be able to calculate the prices including tax - as well as find out how much it would be in my normal currency.
Step 1 was finding an API I could use. I'm a big fan of free - and when that's nor possible affordable. Naturally XE Currency was my first port of call but that was a little out of my price range. A little Googling found Fixer.io which is free, and while not giving the identical rates to xe.com or my card company, close enough to give me a very good approximation.
The first step was creating a Workflow which would get me the current exchange rate, and save it to a file so I could use it offline. A simple GET command and some RegEx was all that was needed to extract the exchange rate, then it was a simple matter of saving the file for later retrieval - and I added an alert at the end.
The next part of the puzzle was to create a Workflow to ask me what the price is, and then calculate the price including sales tax, then display the original price, price including tax, and price in € (my usual currency). This fetches the saved exchange rate from the first Workflow - allowing the Workflow to run offline. (At one point I had an idea of not having data during the trip, but considering my poor sense of direction and unfamiliarity with my destination I did the smart thing and ordered a SIM card - regardless though, the data only changes once per day. Especially as this is a free service, reducing load on their servers seemed like a nice thing to do.)
My final touch was to use Launch Center Pro to create a location based reminder for my hotel to update the exchange rate. I could have used a time based one (recurring daily), but then I would have to remember to disable it when I leave - this way if I forget it won't be prompting me unnecessarily.
Fixer.io is a Euro based API, which is handy for anyone based in the Eurozone or travelling here. Of course, you could theoretically also use it to convert one currency to another via the Euro, but the accuracy could well be off so I wouldn't necessarily recommend that. The only note I'll add, is that if you're travelling to Europe and intend to use this, is to skip the tax - our prices include it!