Click here to Skip to main content
13,348,514 members (78,547 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi everyone,
Greetings for the day!

I don't have much experience of Yahoo Finance API. I'm required to get all the stock symbols stock-market-wise from yahoo using this API. Can somebody please help me to achieve this purpose?

I think this could be achieved by downloading the ticker data from Yahoo.

I've tried getting into the sample codes at[^] but no luck.

I appreciate any little help.

I've tried this so far:

TextWriter tw = File.CreateText("StockData.csv");
            AlphabeticIDIndexDownload dl1 = new AlphabeticIDIndexDownload();
            dl1.Settings.TopIndex = null;                      
            Response<AlphabeticIDIndexResult> resp1 = dl1.Download();

            foreach (var alphabeticalIndex in resp1.Result.Items)
                AlphabeticalTopIndex topIndex = (AlphabeticalTopIndex)alphabeticalIndex;
                dl1.Settings.TopIndex = topIndex;
                Response<AlphabeticIDIndexResult> resp2 = dl1.Download();
                foreach (var index in resp2.Result.Items)
                    IDSearchDownload dl2 = new IDSearchDownload();
                    Response<IDSearchResult> resp3 = dl2.Download(index);                   
                    foreach (var item in resp3.Result.Items)
                        tw.WriteLine(item.ID + "|" + item.ISIN + "|" + item.Name + "|" + item.Exchange + "|" + item.Type + "|" + item.Industry);
                        Console.WriteLine(item.ID + "|" + item.ISIN + "|" + item.Name + "|" + item.Exchange + "|" + item.Type + "|" + item.Industry + "Exchange: " + item.Exchange);

Best Regards,
Posted 17-Jan-13 22:38pm
Updated 20-Jan-13 19:22pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Are you sure you cant get this code samples.

I can download the code from this link[^] and sample codes from here[^]
Sunnykumar08 20-Jan-13 23:32pm
Hi jibesh,

I really appreciate your hint but I've already given a try to this. I'm able to download the list of stock, but I want to sort/categorize them market-wise or exchange-wise? Can you help me with this?
jibesh 20-Jan-13 23:51pm
what effort you made so far. may be you can post the code where you are having trouble so that i can help you. its really impossible for me to do all the code work your problem. but if you can post the code which doesnt work i may able to find an alternate or try to fix the problem. Thanks
Sunnykumar08 21-Jan-13 0:22am
I've updated the question with my code. PS.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.180111.1 | Last Updated 21 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100