雅虎为所有货币提供API文档。

时间:2022-11-12 12:38:37

I've being using this feed for a long time, I believe Apple does it as well in one of the mac widgets. but what is really curious is that I simply can't find any documentation for it, I've tried google and everything.

我已经使用这个feed很长时间了,我相信苹果在其中一个mac小部件上也做得很好。但真正奇怪的是,我根本找不到任何相关的文档,我尝试过谷歌和所有的东西。

http://finance.yahoo.com/webservice/v1/symbols/allcurrencies/quote

http://finance.yahoo.com/webservice/v1/symbols/allcurrencies/quote

I can see people using different parameters like view=basic date=Ymd; currency=true but it's horrible there isn't anything official.

我可以看到人们使用不同的参数,比如view=basic date=Ymd;货币=true,但糟糕的是没有任何官方消息。

For now I am using these parameters:

现在我使用这些参数:

format=json and callback=list sometimes...

列表格式= json和回调=有时……

But it is still a mystery for me. Does anyone know the real truth about it because it seems Yahoo is trying to hide it somewhere else :)

但这对我来说仍然是个谜。有没有人知道它的真实原因,因为似乎雅虎正试图把它藏在别的地方:

7 个解决方案

#1


19  

From the research that I've done, there doesn't appear to be any documentation available for the API you're using. Depending on the data you're trying to get, I'd recommend using Yahoo's YQL API for accessing Yahoo Finance (An example can be found here). Alternatively, you could try using this well documented way to get CSV data from Yahoo Finance.

从我所做的研究来看,您所使用的API似乎没有任何可用的文档。根据您试图获得的数据,我建议使用Yahoo的YQL API访问Yahoo Finance(这里可以找到一个例子)。或者,您也可以尝试使用这种有记录的方法从Yahoo Finance获取CSV数据。

EDIT:

编辑:

There has been some discussion on the Yahoo developer forums and it looks like there is no documentation (emphasis mine):

在雅虎开发者论坛上有一些讨论,看起来没有文档(重点是我的):

The reason for the lack of documentation is that we don't have a Finance API. It appears some have reverse engineered an API that they use to pull Finance data, but they are breaking our Terms of Service (no redistribution of Finance data) in doing this so I would encourage you to avoid using these webservices.

缺乏文档的原因是我们没有财务API。似乎有些人用反向工程设计了一个API,用来提取财务数据,但是他们破坏了我们的服务条款(没有重新分配财务数据),所以我鼓励你避免使用这些webservices。

At the same time, the URL you've listed can be accessed using the YQL console, though I'm not savvy enough to know how to extract URL parameters with it.

与此同时,您所列出的URL可以使用YQL控制台访问,不过我还不知道如何用它提取URL参数。

#2


9  

This could help: http://finance.yahoo.com/d/quotes.csv?e=.csv&f=c4l1&s=EURUSD=X,GBPUSD=X It will return csv file:

这可能会有帮助:http://finance.yahoo.com/d/quotes.csv? e=。csv&f=c4l1&s= X,GBPUSD=X,它将返回csv文件:

"EUR",1.2972
"GBP",1.6034

Or if you need json: Yahoo csv parser

或者,如果您需要json: Yahoo csv解析器。

#3


9  


| ATTENTION !!! |

|关注! ! !|

| SERVICE SUSPENDED BY YAHOO, solution no longer valid. |

Get from Yahoo a JSON or XML that you can parse from a REST query.

从雅虎获得可以从REST查询解析的JSON或XML。

You can exchange from any to any currency and even get the date and time of the query using the YQL (Yahoo Query Language).

您可以使用YQL (Yahoo查询语言)来交换任何货币,甚至可以获得查询的日期和时间。

https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20csv%20where%20url%3D%22http%3A%2F%2Ffinance.yahoo.com%2Fd%2Fquotes.csv%3Fe%3D.csv%26f%3Dnl1d1t1%26s%3Dusdeur%3DX%22%3B&format=json&callback=

This will bring an example like below:

这将带来如下的例子:

{
 "query": {
  "count": 1,
  "created": "2016-02-12T07:07:30Z",
  "lang": "en-US",
  "results": {
   "row": {
    "col0": "USD/EUR",
    "col1": "0.8835",
    "col2": "2/12/2016",
    "col3": "7:07am"
   }
  }
 }
}

You can try the console

你可以试试控制台。

I think this does not break any Term of Service as it is a 100% yahoo solution.

我认为这不会打破任何服务条款,因为它是100%的雅虎解决方案。

#4


5  

I'm developing an application that needs currency conversion, and been using Open Exchange Rates because I wouldn't be paying since the app is in testing. But as of September 2012 Open Exchange Rates is gonna be paid for non-personal, so I checked out that they were using the Yahoo Finance Webservice (the one that "doesn't exist") and looking for documentation on it got here, and opted to use YQL.

我正在开发一个应用程序,它需要货币转换,并且一直使用开放的汇率,因为我不会付钱,因为我的应用程序正在测试。但截至2012年9月,开放汇率将以非个人名义支付,因此我检查了他们使用的是雅虎财经网站(“不存在”),并在这里查找文件,并选择使用YQL。

Using YQL with the Yahoo Finance table (yahoo.finance.quotes) linked by NT3RP, currencies appear with symbol="ISOCODE=X", for example: "ARS=X" for Argentine Peso, "AUD=X" for Australian Dollar. "USD=X" doesn't exist, but it would be 1, since the rest are rates against USD.

使用YQL与雅虎财务表(yahoo.finance.quotes)联系在NT3RP上,货币以符号="ISOCODE=X"出现,例如:阿根廷比索的"ARS=X",澳元"AUD=X"。"USD=X"不存在,但它是1,因为剩下的是针对美元的利率。

The "price" value on the OP API is in the field "LastTradePriceOnly" of the table. For my application I used the "Ask" field.

OP API中的“price”值位于表的“LastTradePriceOnly”字段中。对于我的应用程序,我使用了“Ask”字段。

#5


5  

As NT3RP told us that:

NT3RP告诉我们:

... we (Yahoo!) don't have a Finance API. It appears some have reverse engineered an API that they use to pull Finance data, but they are breaking our Terms of Service...

…我们(雅虎)没有金融API。似乎有些人用反向工程设计了一个API,用来提取财务数据,但他们破坏了我们的服务条款……

So I just thought of sharing this site with you:
http://josscrowcroft.github.com/open-exchange-rates/
[update: site has moved to - http://openexchangerates.org]

所以我只是想和你分享这个网站:http://josscrowcroft.github.com/openexchange rates/[更新:网站已迁移到- http://openexchangerates.org]

This site says:

这个网站说:

No access fees, no rate limits, no ugly XML - just free, hourly updated exchange rates in JSON format
[update: Free for personal use, a bargain for your business.]

没有访问费用,没有速度限制,没有糟糕的XML——只是免费的,每小时更新的JSON格式的汇率[更新:免费为个人使用,为你的生意做交易。]

I hope I've helped and this is of some use to you (and others too). : )

我希望我有所帮助,这对你(以及其他人)有帮助。:)

#6


1  

I have used this URL to obtain multiple currency market quotes.

我使用此URL获取多个货币市场报价。

http://finance.yahoo.com/d/quotes.csv?e=.csv&f=c4l1&s=USD=X,CAD=X,EUR=X

EUR = http://finance.yahoo.com/d/quotes.csv?e=.csv&f=c4l1&s=USD=X,CAD = X,X

"USD",1.0000
"CAD",1.2458
"EUR",0.8396

They can be parsed in PHP like this:

它们可以用PHP来解析:

$symbols = ['USD=X', 'CAD=X', 'EUR=X'];
$url = "http://finance.yahoo.com/d/quotes.csv?e=.csv&f=c4l1&s=".join($symbols, ',');

$quote = array_map( 'str_getcsv', file($url) );

foreach ($quote as $key => $symb) {
    $symbol = $quote[$key][0];
    $value = $quote[$key][1];
}

#7


0  

As an alternative to Yahoo Finance, I started to use Quandl API to get currency quotes. There's a free option that can be used for simple applications and also paid for premium databases.

作为雅虎金融的替代品,我开始使用Quandl API获取货币报价。有一个免费的选项可以用于简单的应用程序,也可以为高级数据库付费。

Once you have an account at Quandl, you get a key to perform your requests. For example, a USD to EUR conversion can be obtained by:

一旦你在Quandl有了一个帐户,你就会得到一个执行请求的密钥。例如,可以通过以下方式获得美元兑换欧元:

curl https://www.quandl.com/api/v3/datasets/CURRFX/USDEUR/data.json?rows=1&api_key=YOUR_KEY

The result from such call is:

这种呼吁的结果是:

{
  "dataset_data":{"limit":1,"transform":null,"column_index":null,
  "column_names":[ "Date","Rate","High (est)","Low (est)"],
  "start_date":"1999-09-06","end_date":"2018-01-19","frequency":"daily",
  "data":[
    ["2018-01-19",0.81721997261047,0.8183100 2235413,0.81335002183914]
  ],
  "collapse":null,"order":null}
}

More exchange rates from USD are available here: Exchange Rates versus USD

这里有更多美元的汇率:汇率和美元。

#1


19  

From the research that I've done, there doesn't appear to be any documentation available for the API you're using. Depending on the data you're trying to get, I'd recommend using Yahoo's YQL API for accessing Yahoo Finance (An example can be found here). Alternatively, you could try using this well documented way to get CSV data from Yahoo Finance.

从我所做的研究来看,您所使用的API似乎没有任何可用的文档。根据您试图获得的数据,我建议使用Yahoo的YQL API访问Yahoo Finance(这里可以找到一个例子)。或者,您也可以尝试使用这种有记录的方法从Yahoo Finance获取CSV数据。

EDIT:

编辑:

There has been some discussion on the Yahoo developer forums and it looks like there is no documentation (emphasis mine):

在雅虎开发者论坛上有一些讨论,看起来没有文档(重点是我的):

The reason for the lack of documentation is that we don't have a Finance API. It appears some have reverse engineered an API that they use to pull Finance data, but they are breaking our Terms of Service (no redistribution of Finance data) in doing this so I would encourage you to avoid using these webservices.

缺乏文档的原因是我们没有财务API。似乎有些人用反向工程设计了一个API,用来提取财务数据,但是他们破坏了我们的服务条款(没有重新分配财务数据),所以我鼓励你避免使用这些webservices。

At the same time, the URL you've listed can be accessed using the YQL console, though I'm not savvy enough to know how to extract URL parameters with it.

与此同时,您所列出的URL可以使用YQL控制台访问,不过我还不知道如何用它提取URL参数。

#2


9  

This could help: http://finance.yahoo.com/d/quotes.csv?e=.csv&f=c4l1&s=EURUSD=X,GBPUSD=X It will return csv file:

这可能会有帮助:http://finance.yahoo.com/d/quotes.csv? e=。csv&f=c4l1&s= X,GBPUSD=X,它将返回csv文件:

"EUR",1.2972
"GBP",1.6034

Or if you need json: Yahoo csv parser

或者,如果您需要json: Yahoo csv解析器。

#3


9  


| ATTENTION !!! |

|关注! ! !|

| SERVICE SUSPENDED BY YAHOO, solution no longer valid. |

Get from Yahoo a JSON or XML that you can parse from a REST query.

从雅虎获得可以从REST查询解析的JSON或XML。

You can exchange from any to any currency and even get the date and time of the query using the YQL (Yahoo Query Language).

您可以使用YQL (Yahoo查询语言)来交换任何货币,甚至可以获得查询的日期和时间。

https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20csv%20where%20url%3D%22http%3A%2F%2Ffinance.yahoo.com%2Fd%2Fquotes.csv%3Fe%3D.csv%26f%3Dnl1d1t1%26s%3Dusdeur%3DX%22%3B&format=json&callback=

This will bring an example like below:

这将带来如下的例子:

{
 "query": {
  "count": 1,
  "created": "2016-02-12T07:07:30Z",
  "lang": "en-US",
  "results": {
   "row": {
    "col0": "USD/EUR",
    "col1": "0.8835",
    "col2": "2/12/2016",
    "col3": "7:07am"
   }
  }
 }
}

You can try the console

你可以试试控制台。

I think this does not break any Term of Service as it is a 100% yahoo solution.

我认为这不会打破任何服务条款,因为它是100%的雅虎解决方案。

#4


5  

I'm developing an application that needs currency conversion, and been using Open Exchange Rates because I wouldn't be paying since the app is in testing. But as of September 2012 Open Exchange Rates is gonna be paid for non-personal, so I checked out that they were using the Yahoo Finance Webservice (the one that "doesn't exist") and looking for documentation on it got here, and opted to use YQL.

我正在开发一个应用程序,它需要货币转换,并且一直使用开放的汇率,因为我不会付钱,因为我的应用程序正在测试。但截至2012年9月,开放汇率将以非个人名义支付,因此我检查了他们使用的是雅虎财经网站(“不存在”),并在这里查找文件,并选择使用YQL。

Using YQL with the Yahoo Finance table (yahoo.finance.quotes) linked by NT3RP, currencies appear with symbol="ISOCODE=X", for example: "ARS=X" for Argentine Peso, "AUD=X" for Australian Dollar. "USD=X" doesn't exist, but it would be 1, since the rest are rates against USD.

使用YQL与雅虎财务表(yahoo.finance.quotes)联系在NT3RP上,货币以符号="ISOCODE=X"出现,例如:阿根廷比索的"ARS=X",澳元"AUD=X"。"USD=X"不存在,但它是1,因为剩下的是针对美元的利率。

The "price" value on the OP API is in the field "LastTradePriceOnly" of the table. For my application I used the "Ask" field.

OP API中的“price”值位于表的“LastTradePriceOnly”字段中。对于我的应用程序,我使用了“Ask”字段。

#5


5  

As NT3RP told us that:

NT3RP告诉我们:

... we (Yahoo!) don't have a Finance API. It appears some have reverse engineered an API that they use to pull Finance data, but they are breaking our Terms of Service...

…我们(雅虎)没有金融API。似乎有些人用反向工程设计了一个API,用来提取财务数据,但他们破坏了我们的服务条款……

So I just thought of sharing this site with you:
http://josscrowcroft.github.com/open-exchange-rates/
[update: site has moved to - http://openexchangerates.org]

所以我只是想和你分享这个网站:http://josscrowcroft.github.com/openexchange rates/[更新:网站已迁移到- http://openexchangerates.org]

This site says:

这个网站说:

No access fees, no rate limits, no ugly XML - just free, hourly updated exchange rates in JSON format
[update: Free for personal use, a bargain for your business.]

没有访问费用,没有速度限制,没有糟糕的XML——只是免费的,每小时更新的JSON格式的汇率[更新:免费为个人使用,为你的生意做交易。]

I hope I've helped and this is of some use to you (and others too). : )

我希望我有所帮助,这对你(以及其他人)有帮助。:)

#6


1  

I have used this URL to obtain multiple currency market quotes.

我使用此URL获取多个货币市场报价。

http://finance.yahoo.com/d/quotes.csv?e=.csv&f=c4l1&s=USD=X,CAD=X,EUR=X

EUR = http://finance.yahoo.com/d/quotes.csv?e=.csv&f=c4l1&s=USD=X,CAD = X,X

"USD",1.0000
"CAD",1.2458
"EUR",0.8396

They can be parsed in PHP like this:

它们可以用PHP来解析:

$symbols = ['USD=X', 'CAD=X', 'EUR=X'];
$url = "http://finance.yahoo.com/d/quotes.csv?e=.csv&f=c4l1&s=".join($symbols, ',');

$quote = array_map( 'str_getcsv', file($url) );

foreach ($quote as $key => $symb) {
    $symbol = $quote[$key][0];
    $value = $quote[$key][1];
}

#7


0  

As an alternative to Yahoo Finance, I started to use Quandl API to get currency quotes. There's a free option that can be used for simple applications and also paid for premium databases.

作为雅虎金融的替代品,我开始使用Quandl API获取货币报价。有一个免费的选项可以用于简单的应用程序,也可以为高级数据库付费。

Once you have an account at Quandl, you get a key to perform your requests. For example, a USD to EUR conversion can be obtained by:

一旦你在Quandl有了一个帐户,你就会得到一个执行请求的密钥。例如,可以通过以下方式获得美元兑换欧元:

curl https://www.quandl.com/api/v3/datasets/CURRFX/USDEUR/data.json?rows=1&api_key=YOUR_KEY

The result from such call is:

这种呼吁的结果是:

{
  "dataset_data":{"limit":1,"transform":null,"column_index":null,
  "column_names":[ "Date","Rate","High (est)","Low (est)"],
  "start_date":"1999-09-06","end_date":"2018-01-19","frequency":"daily",
  "data":[
    ["2018-01-19",0.81721997261047,0.8183100 2235413,0.81335002183914]
  ],
  "collapse":null,"order":null}
}

More exchange rates from USD are available here: Exchange Rates versus USD

这里有更多美元的汇率:汇率和美元。