Is there an API for searching Stock Symbols based on Company Names?

danpalmer picture danpalmer · Dec 9, 2011 · Viewed 8.6k times · Source

This is a similar question to Stock ticker symbol lookup API however that was never answered to the standard I think is needed for a commercial application.

The problem is this: Given a company name, partial name, or stock symbol, return a list of possible symbol matches.

So for example:

"microsoft" => "MSFT", "...",  ...  
"aapl" => "AAPL", "...", ...  
"goo" => "GOOG", "...", ...  

I have used "..." to mean another result of secondary importance.

In the question I linked to, there was, as far as I can tell, only 1 actual answer, and many people totally misunderstanding the question. I do not want stock data, prices, or anything like that! The one answer that is addressing the correct issue looks like it is a very private API and one that could break at any time. The exact callback used by the website must be used or else it doesn't appear to work. It also only works in JSON format and not XML which I would prefer if possible.

There are 3 things that I am considering at the moment, and I would appreciate any feedback on these, or suggestions of others:

  • Use SPARQL to query DBPedia and the "Traded As" fields in boxes on Wikipedia, this data is relatively unstructured, incomplete or inconsistent. I also haven't used SPARQL before so it might be a challenge.
  • Construct a virtual table for use with the Yahoo Query Language that actually screen scrapes the Yahoo website (or another) but provides a 'good' interface to allow me to change the backend data without re-distributing the application (for example if Yahoo change their site). This has the added benefit that I already have code for dealing with YQL+XML.
  • Simply screen-scrape data from within my application from sites that allow it in their terms of use.

Screen-scraping feels like a hack, and feels like it could be broken very easily, so I am reluctant to do the latter two options, however having had a look at the data on DBPedia with a test query, it seems like it is really terrible and might well not be of any use at all.

Summary: I need a reliable API for getting stock symbols for company names.

Edit: This does not have to be a Yahoo API at all. I would prefer to use them if possible, but only because of other code using their services.

Answer

Securicy Ventures picture Securicy Ventures · Mar 26, 2013

This may be useful :)

'http://d.yimg.com/autoc.finance.yahoo.com/autoc?query=COMPANY_NAME_HERE&callback=YAHOO.Finance.SymbolSuggest.ssCallback';

It returns as JSON.