Programmatically access currency exchange rates

Adam Pierce picture Adam Pierce · Oct 8, 2008 · Viewed 72.6k times · Source

I'm setting up an online ordering system but I'm in Australia and for international customers I'd like to show prices in US dollars or Euros so they don't have to make the mental effort to convert from Australian dollars.

Does anyone know if I can pull up to date exchange rates off the net somewhere in an easy-to-parse format I can access from my PHP script ?


UPDATE: I have now written a PHP class which implements this. You can get the code from my website.

Answer

Greg picture Greg · Oct 8, 2008

You can get currency conversions in a simple format from yahoo:

For example, to convert from GBP to EUR: http://download.finance.yahoo.com/d/quotes.csv?s=GBPEUR=X&f=sl1d1t1ba&e=.csv