以编程方式按日期从雅虎财务中获取货币汇率 [英] Programmatically access Currency Exchange Rates from Yahoo Finance by Date
问题描述
我找到了这个问题非常有用的答案,但我想还可以获得过去日期的汇率,而不仅仅是今天的汇率。我正在编写一个iPhone应用程序,它使用汇率来计算不同国家的销售额。
I found the answer to this question VERY useful, but I would like to also get exchange rates for dates in the past, not just today's exchange rates. I'm writing an iPhone app that uses the exchange rate to calculate money made from sales in different countries.
以上是上述答案的例子,以获得今天英镑兑换欧元的汇率:
http://download.finance.yahoo.com/d/quotes.csv? s = GBPEUR = X& f = sl1d1t1ba& e = .csv
Here's the example from the answer mentioned above to get today's echange rate for GBP to EUR: http://download.finance.yahoo.com/d/quotes.csv?s=GBPEUR=X&f=sl1d1t1ba&e=.csv
有没有人知道如何为其他日期执行此操作?
谢谢!
Does anyone know how to do this for any other dates? THANK YOU!
推荐答案
要检索货币汇率的历史数据,您不能使用Yahoo Finance。他们的API仅提供股票的历史数据。例如,2003年4月1日至7月30日之间的APPLE:
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
所以,在你的情况下,你需要挖掘其他地方。唯一可用的其他主要API是OpenExchangeRate:
http://openexchangerates.org/documentation#historical-data
So, in your case you need to dig somewhere else. The only other main API available is OpenExchangeRate: http://openexchangerates.org/documentation#historical-data
注意:
重要提示:从结束2012年8月,您将需要一个应用程序ID来查询Open Exchange Rates API - 它可以免费供个人使用,而且便宜,适用于应用程序和商业用途。
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.
其他选项:
你可以使用此:免费外汇历史数据,然后使用雅虎财经(< a href =http://download.finance.yahoo.com/d/quotes.csv?s=GBPEUR=X,EURCHF=X,EURCAD=X,USDEUR=X,EURJPY=X&f=sl1d1t1ba&e= .csv>货币汇率)每天(在您方便时)建立一个包含您所需的所有货币汇率的最新表格。
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.
美联储为您提供多种货币汇率的历史数据。参见数据下载程序以检索(csv,xls,xml)历史数据。您可以根据自己的需要进行调整。
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.
这篇关于以编程方式按日期从雅虎财务中获取货币汇率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!