Historical currency converter web service

Looking for an excuse to try out Google AppEngine, and encouraged by someone on StackOverflow looking for a free web service to convert between currencies at historical dates, I built the Historical currency converter web service. Using a very simple RESTfull API, you can convert between all currencies on the ECB’s list, using exchange rates that date back to January 1999.

My preliminary findings: Google AppEngine is really cool (obviously), and using Python again after almost OD-ing on PHP was very pleasant. I’m still learning to properly use the datastore though, setting a multi-column primary key to guarantee unique (date, currency) records wasn’t very straightforward. Also the import of the historical data was a bit of a hassle with the import script timing out, until I found how the BulkLoader can automatically do this in multiple HTTP requests. Finally, getting this to run on my own domain, currencies.apps.grandtrunk.net, took some time until I found out the right DNS magic to set in DreamHost‘s panel (if you’re interested: I’m now fully hosting apps.grandtrunk.net, which allows me to set the domain validation code using a normal file uploaded to DreamHost; apps.grandtrunk.net is also the domain I told Google Apps to use, while at DreamHost I needed to set a CNAME (alias) record for currencies.apps.grandtrunk.net that points to ghs.google.com). The cron job is also humming along nicely now downloading daily updates, so convert away while I watch the dashboard seeing my quota trickle down…

19 thoughts on “Historical currency converter web service

  1. Moshiur

    Thank you very much I am planning to use this.
    Great post. How often do you update the rates? How about the rest of currencies???

  2. Wim Post author

    The ECB’s rates are updated daily, those I get from the Fed (LKR, TWD and VEF) only get updated every Tuesday with rates from the previous week.
    Other rates: sure, if you can suggest a good data source I’ll add it!

  3. Alex

    Big thanks to Wim for permission to use his webservice in our iPhone App – XChange Pro and XChange Pro Light
    We have free and paid version – depends on number of currencies.
    The app available worldwide: link to US store is here:
    itms://itunes.apple.com/us/app/xchange-pro-historic-currency/id378032772?mt=8

  4. Megan

    Many thanks for this service. I needed to fill in blanks in my memory and in a book-in-progress. Searched and searched, grew frustrated, and then…voila. Precisely the thing, and extremely helpful.

  5. currency converter

    I have been using this iGoogle gadget from a long time. Google AppEngine is really good, and using Python is amazing feeling. Thanks for the post explaining your experience with that.

  6. Tanmay

    Trying out this service for a trial product which builds some intelligence and analysis on the rates provided.

    Will let you know how it goes, thanks!

  7. jaimini

    sometimes the service says date out of range? is the data not available for that date?

  8. Henadzi

    Hi,

    Try to use your api for education labs. Say, if it’s possible to configure server to return jsonp? It will be easy to use it from JS.
    Thank you.

  9. Ivo

    Thanks for this service! I use it to track the exchange rates between EUR and MXN (my wife is Mexican), actually just for the fun of it. The past few days I’m getting HTTP 500 for my cron. It’s currently set at 6:00 AM CET. What’s the best (lowest volume) time to set my cron job? Perhaps it’s an idea to publish this time on the site, so that others may use it too? It’ll keep your server load more balanced, hopefully.
    Thanks again!
    Ivo

  10. Wim Post author

    Hi Ivo,

    Google resets its quotas at around 9am (Central Europe Time), so 10-11am is probably the best time for you to set your cron job. This is also right after I run my own cron jobs to update the latest currency values.

    Cheers,
    Wim

  11. Wim Post author

    That’s right. I don’t have any data before 1971, and some currencies only were added after a certain date.

  12. Wim Post author

    I added JSONP support for /getlatest and /getrate. Just add ?jsonp=functionName to the end of a URL.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>