Programmatically access Currency Exchange Rates from Yahoo Finance by Date

旧城冷巷雨未停 提交于 2019-11-30 04:58:38

To retrieve historical data of currency exchange rates, you can't use Yahoo Finance. Their API only offers historical data of stocks. For example for APPLE between April the 1st 2003 and July, 30:

http://ichart.finance.yahoo.com/table.csv?s=AAPL&a=3&b=1&c=2003&d=6&e=30&f=2003&g=d&ignore=.csv

So, in your case you need to dig somewhere else. The only other main API available is OpenExchangeRate: http://openexchangerates.org/documentation#historical-data

Notice:

Important: From end August 2012, you will need an App ID to query the Open Exchange Rates API - it's free for personal use, and cheap for apps and commercial uses.

Other option:

You could use this: Free Forex Historical Data and then use Yahoo Finance (Currency Rates) each day (at your convenience) to construct an up-to-date table with all your currencies rates needed.

EDIT

The FED offers you historical data of many currencies rates. See Data Download Program to retrieve (csv, xls, xml) historical data. You can adapt it to your needs.

user1986083

You CAN use ichart.finance for currency as well. Use it just as Romain suggested for stocks. For US Dollar to South Korean Won, for example, use the symbol "KRW=X" in your query, i.e., instead of s=AAPL, use s=KRW=X.

If you would like to use JSON API, then I would suggest using this Forex Exchange API, which is using Yahoo Finance rate.

I have implemented this for few of my customers, so far no issues have been reported from this currency exchange API though it's free currency exchange API.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!