Euro foreign exchange reference rates + historical data
If you want to know how foreign currencies relate to euro, you can use the database of the European Central Bank (ECB). The good thing is that they also offer historical data, for free.
Reference rates for today in HTML
Visit http://www.ecb.int/euro.html.
Example: the line “Hungarian forint (HUF) = 270.35” means that 1 euro = 270.35 HUF.
Reference rates for today in XML
Visit http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html. Here, under Latest rates, check out the link http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml.
Historical reference rates in XML, for the last 90 days
Visit http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html, then http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml.
Historical reference rates in XML, since 1999
Warning! This XML is quite big, don’t open it in your browser! :)
Visit http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html, then http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.xml.
How to parse the XMLs
Under http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html you will find some help.
Problem with the XMLs
The only problem that I noticed is that some days (like weekends) are missing. I think these are the dates when exchanges are closed. A possible solution is to step back one day (or more) until you find an existing day and use those values.
Example: Jan 2, 2011 is missing -> step back to Jan 1, 2011 -> missing, step back to Dec 31, 2010 -> OK, exists -> use these values for Jan 2, 2011.
Credits
I read about this ECB database in this thread.