Yahoo Finance API stock/ticker lookup only allowin

2020-02-23 09:47发布

问题:

Until yesterday a query such as this http://autoc.finance.yahoo.com/autoc?query=a&callback=YAHOO.Finance.SymbolSuggest.ssCallback yielded a long list of fuzzy/broadmatch results for both ticker and company name.

Since today you are a.) required to specific region and language and b.) it is only yielding exact match results only for the ticker and not for the company name. Thus usually you get only one results back.

Thus for http://autoc.finance.yahoo.com/autoc?query=y&region=US&lang=en&callback=YAHOO.Finance.SymbolSuggest.ssCallback there's now only one result: YAHOO.Finance.SymbolSuggest.ssCallback({"ResultSet":{"Query":"a","Result":[{"symbol":"A","name":"Agilent Technologies Inc.","exch":"NYQ","type":"S","exchDisp":"NYSE","typeDisp":"EQUITY"}]}});

Any idea how to a.) broaden the match type and b.) include the company name as the searched field?

回答1:

The URL has now changed to this: http://d.yimg.com/aq/autoc?query=y&region=US&lang=en-US&callback=YAHOO.util.ScriptNodeDataSource.callbacks



回答2:

The following works (the returned data stream has lots of escape characters):

http://autoc.finance.yahoo.com/autoc?query=alphabet&region=EU&lang=en-GB

Or expanded in the YQL Console:

https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D'http%3A%2F%2Fautoc.finance.yahoo.com%2Fautoc%3Fquery%3Dalphabet%26region%3DEU%26lang%3Den-GB'&format=json&callback=


回答3:

Shameless Plug

When I was building an app that required stock symbol/company lookup, I tried a few options, and none were very good. I took what I built, and made it public: https://www.stocksearchapi.com

UPDATE I took this offline due to lack of interest