The EuropeanCentralBank has some possibilyties.
Euro foreign exchange reference rates[
^]
public static DataTable GetCurrencyListFromWeb1()
{
DataTable returnList = new DataTable();
returnList.Columns.Add("currency", typeof(string));
returnList.Columns.Add("rate", typeof(decimal));
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
string date = string.Empty;
using (XmlReader xmlr = XmlReader.Create(@"https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"))
{
xmlr.ReadToFollowing("Cube");
while (xmlr.Read())
{
if (xmlr.NodeType != XmlNodeType.Element) continue;
if (xmlr.GetAttribute("time") != null)
{
date = xmlr.GetAttribute("time");
}
else returnList.Rows.Add(xmlr.GetAttribute("currency"), decimal.Parse(xmlr.GetAttribute("rate"), CultureInfo.CurrentCulture));
}
}
returnList.Rows.Add("EUR", 1);
return returnList;
}