Click here to Skip to main content
11,483,586 members (68,354 online)
Rate this: bad
good
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 http://code.google.com/p/yahoo-finance-managed/[^] 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();
 
            tw.WriteLine("Id|Isin|Name|Exchange|Type|Industry");
            Console.WriteLine("Id|Isin|Name|Exchange|Type|Industry");
            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,
Sunny
Posted 17-Jan-13 22:38pm
Edited 20-Jan-13 19:22pm
v3

1 solution

Rate this: bad
good
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[^]
  Permalink  
Comments
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 305
1 Frankie-C 195
2 Raje_ 155
3 OriginalGriff 142
4 Abhipal Singh 108
0 Sergey Alexandrovich Kryukov 8,444
1 OriginalGriff 7,903
2 Sascha Lefèvre 3,114
3 Maciej Los 2,521
4 Richard Deeming 2,370


Advertise | Privacy | Mobile
Web01 | 2.8.150520.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