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.
我发现这个问题的答案非常有用,但我也想把过去的汇率换算成过去的汇率,而不是今天的汇率。我正在编写一个iPhone应用程序,使用汇率计算不同国家的销售收入。
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
下面是上面提到的答案中的示例,用于获取GBP当前的echange rate to EUR: http://download.finance.yahoo.com/d/quotes.csv?
Does anyone know how to do this for any other dates? THANK YOU!
有人知道怎么做其他的约会吗?谢谢你!
4 个解决方案
#1
14
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:
要检索货币汇率的历史数据,您不能使用Yahoo Finance。他们的API只提供股票的历史数据。例如苹果公司2003年4月1日至7月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
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
所以,在你的情况下,你需要去别的地方挖。唯一可用的其他主要API是OpenExchangeRate: http://openexchangerates.org/documentation# historicaldata。
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.
重要提示:从2012年8月底开始,您将需要一个应用ID来查询Open Exchange rate API——这是免费的供个人使用,对于应用程序和商业用途来说是便宜的。
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.
您可以使用以下信息:免费的外汇历史数据,然后每天(在您方便的时候)使用雅虎财经(Yahoo Finance)构建一个包含您所需的所有汇率的最新表格。
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.
美联储提供许多货币利率的历史数据。请参阅数据下载程序以检索(csv、xls、xml)历史数据。你可以使它适应你的需要。
#2
2
Actually, there is a way to get exchange rates historical data for free from Yahoo Finance.
实际上,有一种方法可以从雅虎财经中免费获得汇率历史数据。
Sample YQL console results(e.g USD/EUR exchange rate for 2015-09-03) by URL: https://developer.yahoo.com/yql/console/?q=show%20tables&env=store://datatables.org/alltableswithkeys#h=select+*+from+yahoo.finance.historicaldata+where+symbol+%3D+%22EUR%3DX%22+and+startDate+%3D+%222015-09-03%22+and+endDate+%3D+%222015-09-03%22
样本YQL控制台的结果(e。通过URL: https://developer.yahoo.com/yql/console/?
相应的直接链接https://query.yahooapis.com/v1/public/yql?q=select%20 * % 20 % 20 yahoo.finance.historicaldata % 20 % 20符号% 20% 3 d % 22 uah 20% % 3 dx % 20 - 22% % 20 startdate可以% 20% 3 d % 20% 222015-09-03 % 20 - 22% % 20 enddate % 20% 3 d % 20% 222015-09-03 % 22格式= json&diagnostics = true&env =商店% 3 % 2 f % 2 fdatatables.org % 2 falltableswithkeys&callback =
or via YQL query like
或者通过YQL查询。
select * from yahoo.finance.historicaldata where symbol = "EUR=X" and startDate = "2015-09-03" and endDate = "2015-09-03"
#3
1
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
.
您可以使用ichart。为货币融资。就像Romain建议的股票一样。例如,对于美元兑换韩元,在查询中使用符号“KRW=X”,即。使用s=KRW=X代替s= apple。
#4
1
If you would like to use JSON API, then I would suggest using this Forex Exchange API, which is using Yahoo Finance rate.
如果您想使用JSON API,那么我建议您使用这个使用Yahoo金融利率的外汇兑换API。
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.
我已经为我的几个客户实现了这一点,到目前为止,没有从这个货币交换API中报告任何问题,尽管它是*的货币交换API。
#1
14
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:
要检索货币汇率的历史数据,您不能使用Yahoo Finance。他们的API只提供股票的历史数据。例如苹果公司2003年4月1日至7月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
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
所以,在你的情况下,你需要去别的地方挖。唯一可用的其他主要API是OpenExchangeRate: http://openexchangerates.org/documentation# historicaldata。
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.
重要提示:从2012年8月底开始,您将需要一个应用ID来查询Open Exchange rate API——这是免费的供个人使用,对于应用程序和商业用途来说是便宜的。
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.
您可以使用以下信息:免费的外汇历史数据,然后每天(在您方便的时候)使用雅虎财经(Yahoo Finance)构建一个包含您所需的所有汇率的最新表格。
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.
美联储提供许多货币利率的历史数据。请参阅数据下载程序以检索(csv、xls、xml)历史数据。你可以使它适应你的需要。
#2
2
Actually, there is a way to get exchange rates historical data for free from Yahoo Finance.
实际上,有一种方法可以从雅虎财经中免费获得汇率历史数据。
Sample YQL console results(e.g USD/EUR exchange rate for 2015-09-03) by URL: https://developer.yahoo.com/yql/console/?q=show%20tables&env=store://datatables.org/alltableswithkeys#h=select+*+from+yahoo.finance.historicaldata+where+symbol+%3D+%22EUR%3DX%22+and+startDate+%3D+%222015-09-03%22+and+endDate+%3D+%222015-09-03%22
样本YQL控制台的结果(e。通过URL: https://developer.yahoo.com/yql/console/?
相应的直接链接https://query.yahooapis.com/v1/public/yql?q=select%20 * % 20 % 20 yahoo.finance.historicaldata % 20 % 20符号% 20% 3 d % 22 uah 20% % 3 dx % 20 - 22% % 20 startdate可以% 20% 3 d % 20% 222015-09-03 % 20 - 22% % 20 enddate % 20% 3 d % 20% 222015-09-03 % 22格式= json&diagnostics = true&env =商店% 3 % 2 f % 2 fdatatables.org % 2 falltableswithkeys&callback =
or via YQL query like
或者通过YQL查询。
select * from yahoo.finance.historicaldata where symbol = "EUR=X" and startDate = "2015-09-03" and endDate = "2015-09-03"
#3
1
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
.
您可以使用ichart。为货币融资。就像Romain建议的股票一样。例如,对于美元兑换韩元,在查询中使用符号“KRW=X”,即。使用s=KRW=X代替s= apple。
#4
1
If you would like to use JSON API, then I would suggest using this Forex Exchange API, which is using Yahoo Finance rate.
如果您想使用JSON API,那么我建议您使用这个使用Yahoo金融利率的外汇兑换API。
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.
我已经为我的几个客户实现了这一点,到目前为止,没有从这个货币交换API中报告任何问题,尽管它是*的货币交换API。