Click here to Skip to main content
11,575,921 members (56,491 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C#
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 21:38pm
Edited 20-Jan-13 18: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 at 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 at 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 at 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
0 Sergey Alexandrovich Kryukov 350
1 Dave Kreskowiak 160
2 F-ES Sitecore 145
3 OriginalGriff 125
4 Abhinav S 98
0 OriginalGriff 705
1 Sergey Alexandrovich Kryukov 600
2 Abhinav S 438
3 F-ES Sitecore 410
4 Suvendu Shekhar Giri 365

Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 21 Jan 2013
Copyright © CodeProject, 1999-2015
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