Need an API to find a full company name given a ticker symbol [closed]
Asked Answered
N

5

7

I need a way from within client-side Javascript to find a full company name given a ticker symbol. I am aware of Yahoo Finance's interface at:

http://finance.yahoo.com/d/quotes.csv?s=TKR&f=n

and am able to access that via YQL (since this is cross-domain). However, that doesn't return the full company name, yet Yahoo Finance has such because it appears in their charts for the company and on their pages about the company.

I don't need for the solution to be via Yahoo Finance... just mention it here as I already know about it (and am accessing it for other data).

Nimiety answered 8/7, 2010 at 20:8 Comment(2)
This question appears to have been asked here: #885956Tillion
That posting regarded finding Tickers for a company name. I want to go in the other direction: get the full name given a ticker.Nimiety
M
7

One of the community-provided YQL tables looks like it will work for you: yahoo.finance.stocks.

Example YQL query: select CompanyName from yahoo.finance.stocks where symbol="TKR"

Update 2012-02-10: As firebush points out in the comments, this YQL community table (yahoo.finance.stocks) doesn't seem to be working correctly any more, probably because the HTML page structures on finance.yahoo.com have changed. This is a good example of the downside of any YQL tables that rely on HTML scraping rather than a true API. (Which for Yahoo Finance doesn't exist, unfortunately.)

It looks like the community table for Google Finance is still working, so this may be an alternative to try: select * from google.igoogle.stock where stock='TRK';

Mita answered 12/7, 2010 at 18:8 Comment(6)
Nice. Thanks for providing as a link to the YQL console!! A bit indirect to use YQL to scrape a Web page, but it works.Nimiety
When I click on your link and hit "TEST", the CompanyName field is always empty - I've tried for other stocks too. If I change the select to '*', other fields appear (like start date), but the name is still empty. :( I wonder if this used to work but is now unsupported?Oneway
@Oneway thanks for catching that - I've updated my answer with a Google alternative that seems to still be working.Mita
At this point in time, your example for the Google result is no longer working.Diablerie
Using YQL, you can use the yahoo.finance.quotes table to get the name from the symbol with the following query SELECT Name FROM yahoo.finance.quotes WHERE symbol="AAPL" developer.yahoo.com/yql/console/…Dihydric
@Dihydric That API truncates all stock/ETF names at 17 bytesGuizot
U
1

I have screen scrapped this information in the past either using Yahoo Finance or MSN Money. For instance you can get this information for ExxonMobil by going to (link). As far as an API you might need to build one yourself. For an API checkout Xignite.

Upbuild answered 9/7, 2010 at 17:14 Comment(0)
T
0

You can use the "Company Search" operation in the Company Fundamentals API here: http://www.mergent.com/servius/

Throng answered 2/8, 2010 at 20:30 Comment(1)
This link appears to be dead nowSammons
T
0

You can use Yahoo's look up service using Jonathan Christian's .NET api that is available on NuGet under "Yahoo Stock Quotes".

https://github.com/jchristian/yahoo_stock_quotes

//Create the quote service
 var quote_service = new QuoteService();

//Get a quote
var quotes = quote_service.Quote("MSFT", "GOOG").Return(QuoteReturnParameter.Symbol,
                                                    QuoteReturnParameter.Name,
                                                    QuoteReturnParameter.LatestTradePrice,
                                                    QuoteReturnParameter.LatestTradeTime);

//Get info from the quotes
foreach (var quote in quotes)
{
    Console.WriteLine("{0} - {1} - {2} - {3}", quote.Symbol, quote.Name, quote.LatestTradePrice, quote.LatestTradeTime);
}

EDIT: After posting this I tried this exact code and it was not working for me so instead I used the Yahoo Finance Managed Api however it's not available via NuGet. A good example of use here

QuotesDownload dl = new QuotesDownload();
DownloadClient<QuotesResult> baseDl = dl;

QuotesDownloadSettings settings = dl.Settings;
settings.IDs = new string[] { "MSFT", "GOOG", "YHOO" };
settings.Properties = new QuoteProperty[] { QuoteProperty.Symbol,
                                        QuoteProperty.Name, 
                                        QuoteProperty.LastTradePriceOnly
                                      };            
SettingsBase baseSettings = baseDl.Settings;
Response<QuotesResult> resp = baseDl.Download();

Also if you just want to download the stuff stocktwits api has a download link for the symbology and industries under "Resources" http://stocktwits.com/developers/docs

Thresher answered 26/7, 2013 at 18:22 Comment(0)
J
0

It also possible to use Quandl.com resources. Their WIKI database contains 3339 major stocks and can be fetched via secwiki_tickers.csv file. For a plain file portfolio.lst storing the list of your tickers (stocks in US markets), e.g.:

AAPL
IBM
JNJ
MSFT
TXN

you can scan the .csv file for the name, e.g:

import pandas as pd

df = pd.read_csv('secwiki_tickers.csv')
dp = pd.read_csv('portfolio.lst',names=['pTicker'])

pTickers = dp.pTicker.values  # converts into a list

tmpTickers = []

for i in range(len(pTickers)):
    test = df[df.Ticker==pTickers[i]]
    if not (test.empty):
        print("%-10s%s" % (pTickers[i], list(test.Name.values)[0]))

what returns:

AAPL      Apple Inc.
IBM       International Business Machines Corporation
JNJ       Johnson & Johnson
MSFT      Microsoft Corporation
TXN       Texas Instruments Inc.

It is possible to combine more stocks from other Quandl's resources. See the documentation online.

Jongjongleur answered 24/4, 2015 at 5:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.