Yahoo finance exchange list


Using the Yahoo Finance API for CSV

How the Free Yahoo Finance API Works

Yahoo finance provides a great and simple way to download free stock quotes. This service returns stock data in a CSV. (comma delimited format, you can just open it in Excel if you like)

The service Yahoo finance provides for free stock quotes is REST based. (love REST based stuff) So all you need to do is assemble the URL you want and it will give you the data your looking for.

The API lets you specify multiple symbols to download with a maximum of 200 per call. (You can make multiple calls, but if you call too fast it will lock your IP so be warned)


How to call the free Yahoo Finance API

The base url your going to call is http://finance.yahoo.com/d/quotes.csv

Then you add a ?s= and the stock symbols your interested in such as APPL, GOOG and MSFT like so

http://finance.yahoo.com/d/quotes.csv?s=AAPL+GOOG+MSFT

Then you specify the info you want. There is a large list of stuff you can specify, just look at the list below for more info.

http://finance.yahoo.com/d/quotes.csv?s=AAPL+GOOG+MSFT&f=nab

This will get the name of the stock, the ask price and bid price (the “nab” = name,ask and bid)


Financial Data you can Download

PricingDividends
a: Asky: Dividend Yield
b: Bidd: Dividend per Share
b2: Ask (Realtime)r1: Dividend Pay Date
b3: Bid (Realtime)q: Ex-Dividend Date
p: Previous Close
o: Open 
Date
c1: Changed1: Last Trade Date
c: Change & Percent Changed2: Trade Date
c6: Change (Realtime)t1: Last Trade Time
k2: Change Percent (Realtime)
p2: Change in Percent 
Averages
c8: After Hours Change (Realtime)m5: Change From 200 Day Moving Average
c3: Commissionm6: Percent Change From 200 Day Moving Average
g: Day’s Lowm7: Change From 50 Day Moving Average
h: Day’s Highm8: Percent Change From 50 Day Moving Average
k1: Last Trade (Realtime) With Timem3: 50 Day Moving Average
l: Last Trade (With Time)m4: 200 Day Moving Average
l1: Last Trade (Price Only)
t8: 1 yr Target Price 
Misc
w1: Day’s Value Changeg1: Holdings Gain Percent
w4: Day’s Value Change (Realtime)g3: Annualized Gain
p1: Price Paidg4: Holdings Gain
m: Day’s Rangeg5: Holdings Gain Percent (Realtime)
m2: Day’s Range (Realtime)g6: Holdings Gain (Realtime)
52 Week PricingSymbol Info
k: 52 Week Highv: More Info
j: 52 week Lowj1: Market Capitalization
j5: Change From 52 Week Lowj3: Market Cap (Realtime)
k4: Change From 52 week Highf6: Float Shares
j6: Percent Change From 52 week Lown: Name
k5: Percent Change From 52 week Highn4: Notes
w: 52 week Ranges: Symbol
 s1: Shares Owned
 x: Stock Exchange
 j2: Shares Outstanding
Volume
v: Volume
a5: Ask Size
b6: Bid SizeMisc
k3: Last Trade Sizet7: Ticker Trend
a2: Average Daily Volumet6: Trade Links
 i5: Order Book (Realtime)
Ratiosl2: High Limit
e: Earnings per Sharel3: Low Limit
e7: EPS Estimate Current Yearv1: Holdings Value
e8: EPS Estimate Next Yearv7: Holdings Value (Realtime)
e9: EPS Estimate Next Quarters6 Revenue
b4: Book Value 
j4: EBITDA 
p5: Price / Sales 
p6: Price / Book 
r: P/E Ratio 
r2: P/E Ratio (Realtime) 
r5: PEG Ratio 
r6: Price / EPS Estimate Current Year 
r7: Price / EPS Estimate Next Year 
s7: Short Ratio 




Getting Stock Data in C#

Since this is a REST based finance API, to get the data using C# is easy. You can simply use a WebClient.DownloadString(myurl) to get the data. Once you get the data, it’s also easy to parse being a simple CSV format.

Download Source Code

Here is a quick example of how you can use the free Yahoo Finance API in your C# code.

Application Entry Point (main)

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using System.Collections.Generic;
using System.Net;
using jarloo;
 
namespace Jarloo
{
     internal class Program
     {
         private static void Main( string [] args)
         {
             string csvData;
 
             using (WebClient web = new WebClient())
             {
                 csvData = web.DownloadString( "http://finance.yahoo.com/d/quotes.csv?s=AAPL+GOOG+MSFT&f=snbaopl1" );
             }
 
             List<Price> prices = YahooFinance.Parse(csvData);
 
             foreach (Price price in prices)
             {
                 Console.WriteLine( string .Format( "{0} ({1})  Bid:{2} Offer:{3} Last:{4} Open: {5} PreviousClose:{6}" ,price.Name,price.Symbol,price.Bid,price.Ask,price.Last,price.Open,price.PreviousClose));
             }
 
             Console.Read();
 
         }
     }
}

Parsing Class and State Bag

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
 
namespace jarloo
{
     public static class YahooFinance
     {
         public static List<Price> Parse( string csvData)
         {
             List<Price> prices = new List<Price>();
 
             string [] rows = csvData.Replace( "\r" , "" ).Split( '\n' );
 
             foreach ( string row in rows)
             {
                 if ( string .IsNullOrEmpty(row)) continue ;
 
                 string [] cols = row.Split( ',' );
 
                 Price p = new Price();
                 p.Symbol = cols[0];
                 p.Name = cols[1];
                 p.Bid = Convert.ToDecimal(cols[2]);
                 p.Ask = Convert.ToDecimal(cols[3]);
                 p.Open = Convert.ToDecimal(cols[4]);
                 p.PreviousClose = Convert.ToDecimal(cols[5]);
                 p.Last = Convert.ToDecimal(cols[6]);
 
                 prices.Add(p);
             }
 
             return prices;
         }
     }
 
     public class Price
     {
         public string Symbol { get ; set ; }
         public string Name { get ; set ; }
         public decimal Bid { get ; set ; }
         public decimal Ask { get ; set ; }
         public decimal Open { get ; set ; }
         public decimal PreviousClose { get ; set ; }
         public decimal Last { get ; set ; }
     }
}


Exchanges and Yahoo

Had lots of people asking how to get stuff from Non-US exchanges. Being a good Canadian myself I’ve been looking into it, and here is the master Yahoo Exhcange List for all your data scraping goodness!

CountryExchangeSuffixDelayData Provider
United States of AmericaAmerican Stock ExchangeN/A15 minDirect from Exchange
United States of AmericaBATS ExchangeN/AReal-timeDirect from Exchange
United States of AmericaChicago Board of Trade.CBT10 minInteractive Data Real-Time Services
United States of AmericaChicago Mercantile Exchange.CME10 minInteractive Data Real-Time Services
United States of AmericaDow Jones IndexesN/AReal-timeInteractive Data Real-Time Services
United States of AmericaNASDAQ Stock ExchangeN/A15 minDirect from Exchange
United States of AmericaNew York Board of Trade.NYB30 minInteractive Data Real-Time Services
United States of AmericaNew York Commodities Exchange.CMX30 minInteractive Data Real-Time Services
United States of AmericaNew York Mercantile Exchange.NYM30 minInteractive Data Real-Time Services
United States of AmericaNew York Stock ExchangeN/A15 minDirect from Exchange
United States of AmericaOTC Bulletin Board Market.OB20 minDirect from Exchange
United States of AmericaPink Sheets.PK15 minDirect from Exchange
United States of AmericaS & P IndicesN/AReal-timeInteractive Data Real-Time Services
ArgentinaBuenos Aires Stock Exchange.BA30 minInteractive Data Real-Time Services
AustriaVienna Stock Exchange.VI15 minTelekurs
AustraliaAustralian Stock Exchange.AX20 minInteractive Data Real-Time Services
BelgiumBrussels Stocks.BR15 min 
BrazilBOVESPA – Sao Paolo Stock Exchange.SA15 minInteractive Data Real-Time Services
CanadaToronto Stock Exchange.TO15 minInteractive Data Real-Time Services
CanadaTSX Venture Exchange.V15 minInteractive Data Real-Time Services
ChileSantiago Stock Exchange.SN15 minInteractive Data Real-Time Services
ChinaShanghai Stock Exchange.SS30 minInteractive Data Real-Time Services
ChinaShenzhen Stock Exchange.SZ30 minInteractive Data Real-Time Services
DenmarkCopenhagen Stock Exchange.CO15 minTelekurs
FranceEuronext.NX15 minTelekurs
FranceParis Stock Exchange.PA15 minTelekurs
GermanyBerlin Stock Exchange.BE15 minTelekurs
GermanyBremen Stock Exchange.BM15 minTelekurs
GermanyDusseldorf Stock Exchange.DU15 minTelekurs
GermanyFrankfurt Stock Exchange.F15 minTelekurs
GermanyHamburg Stock Exchange.HM15 minTelekurs
GermanyHanover Stock Exchange.HA15 minTelekurs
GermanyMunich Stock Exchange.MU15 minTelekurs
GermanyStuttgart Stock Exchange.SG15 minTelekurs
GermanyXETRA Stock Exchange.DE15 minTelekurs
Hong KongHong Kong Stock Exchange.HK15 minInteractive Data Real-Time Services
IndiaBombay Stock Exchange.BO15 minInteractive Data Real-Time Services
IndiaNational Stock Exchange of India.NS15 minNational Stock Exchange of India
IndonesiaJakarta Stock Exchange.JK10 minInteractive Data Real-Time Services
IsraelTel Aviv Stock Exchange.TA20 minTelekurs
ItalyMilan Stock Exchange.MI20 minTelekurs
JapanNikkei IndicesN/A30 minInteractive Data Real-Time Services
MexicoMexico Stock Exchange.MX20 minTelekurs
NetherlandsAmsterdam Stock Exchange.AS15 minTelekurs
New ZealandNew Zealand Stock Exchange.NZ20 minInteractive Data Real-Time Services
NorwayOslo Stock Exchange.OL15 minTelekurs
PortugalLisbon Stocks.LS15 min 
SingaporeSingapore Stock Exchange.SI20 minInteractive Data Real-Time Services
South KoreaKorea Stock Exchange.KS20 minInteractive Data Real-Time Services
South KoreaKOSDAQ.KQ20 minInteractive Data Real-Time Services
SpainBarcelona Stock Exchange.BC15 minTelekurs
SpainBilbao Stock Exchange.BI15 minTelekurs
SpainMadrid Fixed Income Market.MF15 minTelekurs
SpainMadrid SE C.A.T.S..MC15 minTelekurs
SpainMadrid Stock Exchange.MA15 minTelekurs
SwedenStockholm Stock Exchange.ST15 minTelekurs
SwitzerlandSwiss Exchange.SW30 minTelekurs
TaiwanTaiwan OTC Exchange.TWO20 minInteractive Data Real-Time Services
TaiwanTaiwan Stock Exchange.TW20 minInteractive Data Real-Time Services
United KingdomFTSE IndicesN/A15 minTelekurs
United KingdomLondon Stock Exchange.L20 minTelekurs


 
0

width="468" height="60" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" id="aswift_0" name="aswift_0" style="margin: 0px; padding: 0px; border-width: 0px; outline: 0px; vertical-align: baseline; background-color: transparent; left: 0px; position: absolute; top: 0px;">

103 Comments

Join the conversation and post a comment.

  1. SEBASTIAN

    Great article! One thing I come to think off is how to use this to compare different stocks and how they are valued to each other. I was thinking about getting a list of stocks with it short names. Do u know where to find such lists?

    Keep up the good work :)

    BR
    Sebastian

  2. ADMIN

    EODData has a good list of stock tickers if that is what you looking for. You need to sign up but it’s free and then you can download the lists. http://www.eoddata.com/download.aspx

    BATS Also has a great list you can use, I have a quick article on how to get that data herehttp://www.jarloo.com/download-stock-symbols/

  3. LALAS

    Would it possible to make the source code for this project available for download? If i do a simple copy and paste, i would be get an error for using Jarloo.

    Sorry if that is a trivial request, but i am kinda new to C# and i would like to use your website to help me learn.

    Thank you

  4. ADMIN

    @LALAS I posted the Visual Studio project, you can download from the big green button above.

  5. LALAS

    Cheers.. :)

  6. URI G

    Is there anyway to retrieve the stocks Beta (risk) in a specific date?
    Thanks!

  7. TOM PEIRCE

    Is there any way to specify a certain stock market? Some stocks codes overlap with another on a different exchange, (e.g TSCO is Tesco in UK and a tractor company in US, and this always returns the US one.)

    Thanks.

  8. HUGH BROWN

    TSCO.L is the ticker Yahoo uses for Tesco in London. In general, you’ll have to look up the suffixes for the exchanges.

  9. KEVIN

    Hi,
    May I know how to retrieve stock option detail quotes ?
    Thanks.
    Kevin

  10. DARSH

    Hi, I would like to know whether this method is actually using yahoo finance api or Yahoo Query Language ? I’m a bit confused. Could you please give some clarification regarding the same?

  11. ADMIN

    This uses an API and does NOT use YQL. The API has been around for years and works quite well.

  12. THOMAS

    Can monthly and weekly prices be downloaded through this api? If so how is it done?

  13. ADMIN

    As far as I am aware only dailies are available.

  14. SAM

    How do you get these information, can you share with us where is the Yahoo official documentation so we can always access the latest info from Yahoo? nevertheless this is still the best website in showing how to access Yahoo finance API. Thank.

  15. SAM

    I really like to retrieve the stock info via csv compare to YQL. Not so sure how to use YQL, but why I can’t find any documentation from Yahoo in how to use csv?

  16. ADMIN

    As far as I am aware there is no official documentation. This information I’ve gathered from others and trial and error by working with the API.

  17. KEVIN PARK

    Yahoo,

    I’m using

    http://finance.yahoo.com/d/quotes.csv?s=DJI&f=sl1d1t1c1ohgv&e=.csv

    to try to get the Dow jones and I’m not getting the data as I was in the past. Any ideas?

    Kevin

  18. GRAEMEB

    The Yahoo data described above appears to be current day downloads – am i wrong?
    I was looking for a way to download 5 years of daily data, so that i can then make 5 year charts. Please advise.
    thanks

  19. CHARLES

    Here’s some more tags:
    s6 – Revenue
    j2 – Shares Outstanding

  20. SYLVAIN

    I want simulate Real time to create a demo of a Trading game.
    Do you know about how many call my IP is locked ?
    Do you have a solution to simulate real time for a demo (realtime or dealayed data), there isn’t real streaming quotes for free since the dead of opentick :(

    thanks

  21. YARED

    Any idea how to get the information from the Yahoo Finance Analysts Estimates table? Here is an example:

    http://finance.yahoo.com/q/ae?s=HTZ+Analyst+Estimates

    Thanks!!

  22. KELLY ELIAS

    As far as I am aware there is no API but you can always scrape the data. Just use WebClient.DownloadString() to get the page and then use something the the HTML Agility Pack or even Regex to parse the data.

  23. YARED

    Thanks Kelly! Will do.

  24. JOE

    Just wanted to bring it to your attention that symbol “v” is used for both “Volume” & “More Info”.

    Thanks for this post, it’s very helpful.

  25. SAJJAD

    Anyway symbol to download BETA for a stock?

  26. FABVON

    Hi Kelly! I have an Excel Macro to import around 15 stocks automatically, but when moving the XLS to Google Drive, they don’t support VBA, only Javascript (which I don’t know).

    Any way to import Yahoo Finance data to Google Drive?

  27. KELLY ELIAS

    I don’t have much experience with using Google drive, but if you use Google Spreadsheets you can get Google Finance data directly into your sheet, and Google will keep it up to date. Use the formula: GoogleFinance(symbol, attribute)

    More info: https://support.google.com/drive/bin/answer.py?hl=en&answer=155178

  28. RAJKUMAR

    The Yahoo API that I’m currently referring so as to get the stock rates returns ZERO or ‘N/A’ for Canara Bank (CODE : CANARABANK.BO) but I can see the correct value for this stock on your sitehttp://in.finance.yahoo.com… May I know why I cannot see the correct value while using the API that you provide. I think there is a problem with the API. Please do reply as soon as possible. Awaiting your response….

  29. EHSAN

    Plz any one help me. I want to get Full compny name like for SODA the Full name is SodaStream International Ltd. I am waiating plz.

  30. KELLY ELIAS

    http://finance.yahoo.com/d/quotes.csv?s=SODA&f=snbaopl1

    That should give you what you want. The last parameter “f” sets the fields to show. The table on this page shows each of them (that I know about anyway) and you can see that “n” is the flag you want to display the full name.

  31. ALIJOHN

    Is there a way to get commodities from yahoo finance with csv ?

  32. KELLY ELIAS

    Not that I’m aware of.

  33. JEFB

    I am getting the stock price using the formula:
    =WEBSERVICE(“http://finance.yahoo.com/d/quotes.csv?s=”&C2&”&f=l1″)
    (“C2″ is the cell with the stock symbol)

    However, I cannot figure out how to convert the result into a numeric so that I can use it in a formula. (Excel 2013 360) on Windows 8)

    Any suggestions?

  34. ED

    You can get commodity futures if you know the future, exchange, and month codes-
    I don’t know how to get spot prices yet.

    Gold=GC, Month=June, Year=13, exchange=CMX (metals)

    % curl -s ‘http://download.finance.yahoo.com/d/quotes.csv?s=GCM13.CMX&f=snl1′
    “GCM13.CMX”,”Gold Jun 13″,1469.60

    Month Codes – (“F”,”G”,”H”,”J”,”K”,”M”,”N”,”Q”,”U”,”V”,”X”,”Z”)
    Energy exchange is NYM
    You can look up the future codes on the exchange web site.

    Good Luck!

  35. ANTHONY WILSON

    OK so when I use the API to generate a CSV it cuts the company name off after 17 characters…. Is there a workaround to this????

    Ex. MSFT comes through as Microsoft Corpora instead of Microsoft Corporation

  36. JOKU

    anyone can halp me couz i have one project about yahoo financ?

  37. SHIVAJI

    Following update of the code can be helpful in my opinion. Please check if it helps.

    public static List Parse(string csvData)
    {
    List prices = new List();

    string[] rows = csvData.Replace(“\r”, “”).Split(‘\n’);

    foreach (string row in rows)
    {
    if (string.IsNullOrEmpty(row)) continue;

    string rgPattern = “[\\*\\?\"'|]“;
    Regex objRegEx = new Regex(rgPattern.ToString(), RegexOptions.None);
    string nrow = objRegEx.Replace(row, string.Empty);

    string[] cols = nrow.Split(‘,’);

    Price p = new Price();
    p.Symbol = cols[0];
    p.Name = cols[1];
    p.Bid = Convert.ToDecimal(cols[2]);
    p.Ask = Convert.ToDecimal(cols[3]);
    p.Open = Convert.ToDecimal(cols[4]);
    p.PreviousClose = Convert.ToDecimal(cols[5]);
    p.Last = Convert.ToDecimal(cols[6]);

    prices.Add(p);
    }

    return prices;
    }

  38. KELLY ELIAS

    I just updated the article with the Yahoo Exchange codes for every exchange, so you can use those to tell the difference.

  39. DAVID

    Hello Kelly,
    Do you know how the d2 flag is utilized? Can it work to retrieve a stock’s price at close on a given date? For example, can it pull the closing price for stock X on 06/14/2013? If so how, if not, then what is the d2 flag for?
    Thanks!

  40. SANDRO GIANGRANDI

    hallo kelly, here sandro, from Italy.
    I am in the test phase of both API, for downloading historic data and daily data.
    the project is to download, once, the historic data of a stock, and on a daily basis the daily quotes, put them togheter and make them accessible to Tradestation.
    everything ok, except tha date, that have different format in historic and daily data.
    can you please give me some advice on how to get them readable without problems by TS?
    the best would be to maintain the format of the date in the historical download, and adapt the dayly one.
    any suggestion?
    thank in advance.
    sandro

  41. SHAHID MAQSOOD

    Kelly,

    Is there a way to fetch “Revenue Estimates” data from http://finance.yahoo.com/q/ae?s=IBM+Analyst+Estimates ?

    Thanks,
    Shahid

  42. BILL

    The Yahoo finance quotes are great — but the m4 function brings in a value for a moving average based on 200 calendar days. If you use the technical indicators dropdown box and show the 200 day MA on a stock chart, it proves a value based on 200 trading days (not 200 calendar days). What is the function in need to use to bring into my spreadsheet the 200 trading days information?

    Thanks for the help!

  43. JONATHAN

    Is there a tag to retrieve the Growth Estimates for next 5 years. This is under Analyst Estimates component of the stock quote.

    http://finance.yahoo.com/q/ae?s=MSFT+Analyst+Estimates

    Thanks

  44. JARROD ELMES

    Has anybody noticed a problem with ask/bid prices. I’m sure my app was showing them all a week ago and now it seems very few (90% of them are now N/A). This is unfortunate as of course my spreads are all 0 now as well. I tried the other variants but they give same result of N/A. (I think I’ve at least worked out AIM stocks don’t seem to have them recorded).

    Any of you gurus knowledge on this front would be much appreciated.
    Here’s a few examples of stocks with issue: LAD.L ABB.L MONY.L DIA.L PRV.L
    Test link showing they are N/A: http://finance.yahoo.com/d/quotes.csv?s=DIA.L&f=nsab
    Thankyou…

  45. JARROD ELMES

    Ah, All the Ask/Bids are populated now, so the issue must have been resolved. My query (above) is now redundant and can be ignored. Thanks…

  46. RAY JOHNSON

    Hi,

    When downloading data of multiple stocks in a row, so using multiple lines like this:
    http://finance.yahoo.com/d/quotes.csv?s=AAPL&f=nsab
    http://finance.yahoo.com/d/quotes.csv?s=CAT&f=nsab
    … etc.
    What is the minimum time to leave between each line? Has anybody experienced his IP being locked by Yahoo because of too frequent calls?
    I want to download data of hundreds of stocks once or twice a day, but I’m afraid that Yahoo will lock me out.
    And IF I am locked out, is that only temporarily?

    Thanks already for any input.

    Kind regards
    Ray

  47. KELLY ELIAS

    There is definitely a daily limit although I am unsure exactly what it is. Keep in mind you can ask for multiple stocks per request instead of doing 1 request per stock.

  48. RAY JOHNSON

    Thanks, Kelly.
    If I run into trouble I will try the multiple stock download.

  49. RAY JOHNSON

    The Yahoo YQL interface has some well-described limits:
    http://developer.yahoo.com/yql/guide/usage_info_limits.html
    These seem very reasonable. But for the API interface as Kelly described above, I can not find any published limits. From what I read on some (older) forums, these limits seem to vary in time. Yahoo probably changes them on the fly as server loads vary.
    I am writing some software to download stock data for multiple stocks, so I can start experimenting in a few days.
    PS. Kelly, I forgot to say thanks for publishing this useful information. So thank you! :-)

  50. JARROD ELMES

    Hi Ray, I have written a Share monitoring app (for Windows) using interface above and haven’t yet experienced any blocking of data since I started around 8 months ago. I download quite a lot of Share data and also historical chart data. Yahoo have been good to me so far fingers crossed.

  51. RAY JOHNSON

    Jarrod, that’s reassuring to hear. Thanks!!

  52. DAIA ALEXANDRU

    Hy , i was wondering how cand i retrieve historical data between a start date and an end date ? Tnks

  53. JARROD ELMES

    From URL – http://ichart.finance.yahoo.com

    a = From Month
    b = From Day
    c = From Year
    d = To Month
    e = To Day
    f = To Year

    Eg: 6 months data for Taylor Wimpey:
    http://ichart.finance.yahoo.com/table.csv?s=TW.L&a=03&b=07&c=2013&d=09&e=04&f=2013

  54. ERROSELL

    I have a problem in order to obtain data from exchange .MC (Madrid)

    For example:

    http://finance.yahoo.com/d/quotes.csv?s=SAN.MC&f=sp

    p: Previous Close
    s: Symbol

    Ii returns a file (.csv) with this line: “SAN.MC, N/A” where SAN.MC is the symbol and N/A is Previous Close.

    This problem is the same with other symbols from exchange with suffix .MC

    In this link

    http://finance.yahoo.com/q?s=SAN.MC

    it exists Previous Close !!!!!

    Why does this exchange .MC not work when download csv file?

  55. SANDRO GIANGRANDI

    I understand that ALL stock quotes from the spanish exchange are not available.
    my feeling is that spanish quotes are available on payment, so Yahoo cannot make them available free of charge.
    if you get the historical prices, no problem at all.
    I am not sure to have solved your problem, but it is the same problem I faced some time ago.

    Sandro

  56. JARROD ELMES

    I guess you tried with no prefix? eg: SAN
    It seems to work there but not much info is returned.

  57. JARROD ELMES

    Sorry, I meant suffix :-)

  58. MACIEK

    Is it possible to get detailed options quotas from yahoo to a CSV? Has anyone tried it? If so could you give me some directions?

    Maciek

  59. JARROD ELMES

    Hi Maciek.
    I was going to let someone else answer you as I was unsure about your question.
    What do you mean by ‘detailed options quotas ‘?
    Can you give an example?

  60. MACIEK

    Thank you very much for your response! I’m extremely sorry for this form… I’m working on CRR valuation and variations. I’d like to use all US options, and after expiration date check effectiveness of my valuation. In order to do so I need to set up a database with options quotas over time, underlying assets, and risk free interest. As I would like to make it as fast as possible daily importing all quotas is necessary, and parsing each site would be too long. Due to universities’ limits I cannot access pay-per download data. Importing selected options (name, strike, price, vol) to a CSV would be perfect. Do you maybe know how to modify parameters in this code to access options quotas?

  61. CARISSA

    Hi,
    Is there a way to retrieve the earning date? I don’t see the earning date on the API list.

    Thanks.

  62. JARROD ELMES

    Hi, just for those asking about limits before…

    I’ve just discovered yahoo will only allow data for 200 stocks max in any 1 call (sorry if already mentioned). If you have more, you can do it in chunks of 200 at a time.

    PS. Ray, I just re-read your post where you said you had hundreds of stocks and were getting them 1 at a time.
    If I were you I wouldn’t call API once for each stock as I guess you may have a greater chance of getting on yahoo’s nerves. Instead call the API once with a number of stocks e.g.:
    http://finance.yahoo.com/d/quotes.csv?s=AAPL+CAT+GOOG+BLAH+BLAH2+ETC&f=nsab
    Apart from that it would speed up your code immensly, as you’ll only be making 1 internet request.

    Rgds…

  63. MARK

    When I download stock dividend data, there appear to be some errors as the dividend data does not match the Yahoo Finance page for the stock or current dividend information. Can someone explain?

  64. RAY J.

    My posts are not published here anymore .. Why ..?
    Kind regards
    Ray

  65. JARROD ELMES

    Hi Mark, can you give an example stock symbol. I have looked at a few shares and the yahoo finance page seems to match. If we had an example we could maybe look into your issue better.

    Carissa, do you really mean ‘earning date’. There isn’t a earning date to my understanding, only earnings per share, dividend, dividend yield, divi/exdivi dates as described above in the API?

    Maciek, you blew my mind and I don’t understand your query, sorry. I’m sure there are people on here tho that totally get what you mean and can help you.

    Rgds…

  66. RAY J

    Carissa,
    You can get the next earnings date from FinViz:
    http://finviz.com/quote.ashx?t=aapl
    Parsing the page code, you should be able to extract the earnings date (and much more).

    For example, in the page code, look for:
    >Earnings
    Right after it, you find the next earnings date.

    Kind regards
    Ray

  67. JARROD ELMES

    Sorry Carissa, I was dead wrong re your question (thanks Ray for correcting me).
    Interestingly, I just saw on this site the info you may be after (could be wrong again tho lol) using the YQL API.
    http://www.jarloo.com/get-near-real-time-stock-data-from-yahoo-finance/
    Rgds…

  68. ALEX

    If I just want to display the latest price and change, and use historical info to create a chart for the company website, is this OK under Yahoo’s TOS?

    Thanks, Alex

  69. BALAJI

    Whenever i try to fetch .csv file for NSE or BSE stock list i’m NOT getting (retrieving any values- displayed as “N/A”), or most of the times i’m getting ‘Missing Format Variable.’

    Do i need to pass any arguments for NSE or BSE stocks . apart from NS or BO – example Infy.BO Thanks, BS

  70. MAREK

    How to download quotes indices of the LSE?

  71. JEAN

    Two other stock exchanges you can add to your nice final table! Thanks ;)
    Belgium Brussels Stocks .BR
    Portugal Lisbon Stocks .LS

  72. KELLY ELIAS

    Great, I’ve added them to the list. Thanks!

  73. JEAN

    Happy to help ;)
    In the table you added “.LS” instead of “.BR” for Brussel stocks.

  74. KELLY ELIAS

    Copy and paste is both a blessing and curse. It’s fixed, thanks again for pointing that out.

  75. SAURABH

    Nice article, How do I get data for a certain exchange only? For example, I need a csv with all data for the BATS exchange. Is there a way to specify this?

    Thanks.

  76. HARI

    Can you please let us know if there a way to get Beta information for a stock?

  77. KELLY ELIAS

    While Yahoo provides Beta on there site I haven’t seen a way to easily get it.

  78. SNEHA

    How can i get gold rates from yahoo finance?

  79. SNEHA

    How can i get gold price data from yahoo finance?

  80. HARI

    Excellent article. Very informative, especially the part on non-US exchanges.
    The links in “Stuff you might like” are also great

    Thanks a lot Kelly !!

  81. PAVEL

    Hi, am i the only one for whom the api is not working? I keep getting 404 errors for links likehttp://finance.yahoo.com/d/quotes.csv?s=AAPL+GOOG+MSFT

  82. SANDRO GIANGRANDI
  83. JARROD

    Pavel, In your example, you haven’t specified what data you want returned ie. the format.
    Try appending &f=nab to the end of your query which would in this example give the name,ask and bid price, as described at start of the article.

  84. DOC

    Is there anyway to get enterprise value into excel using this?

  85. KELLY ELIAS

    I’ve done similar projects to send data to excel in many large companies. The best way to do it is using An RTD server. Google excel rtd server and you should find plenty of examples.

  86. ALEX

    I’ve searched a bit for how to find out the currency, here it is:

    c4 = currency

    Alex

  87. GATO

    Hello,

    I’m very impressed by this code, thanks a lot :)

    I’ve 2 questions :

    1) how can I get the figures of a market ? eg CAC40, whose symbol is PX1.

    When I use the code below, I get no results :(

    csvData = web.DownloadString(“http://finance.yahoo.com/d/quotes.csv?s=PX1+&f=snhg”);

    2) is it possible to get the ISIN code ? I can get the symbol but not the ISIN so far

    Thanks for reading this =)

  88. GATO

    My bad, I wasn’t using the good symbol for CAC40.. It was in fact ^FCHI !

    But question 2 is still standing : how can I get the ISIN code?

  89. KII

    Greate article! I’ve learned a lot.
    Do you know how to get history of earnings or EPS?

  90. NUTTIJAY

    a question on the chart api…

    i am getting data like
    symbol : timestamp : vol : high : low : open : close
    dbk.de;2014-04-09 09:00:50+02;81.400;32,2150;32,2150;32,2150;32,2150
    dbk.de;2014-04-09 09:01:15+02;4.600;32,2500;32,2500;32,2500;32,2500
    dbk.de;2014-04-09 09:02:37+02;34.300;32,2100;32,2550;32,2550;32,2100
    dbk.de;2014-04-09 09:03:11+02;2.900;32,2200;32,2200;32,2200;32,2200
    dbk.de;2014-04-09 09:04:41+02;18.900;32,2200;32,2250;32,2200;32,2250
    dbk.de;2014-04-09 09:05:40+02;14.500;32,2400;32,2700;32,2400;32,2700
    dbk.de;2014-04-09 09:06:24+02;6.600;32,2300;32,2350;32,2350;32,2300
    dbk.de;2014-04-09 09:07:57+02;12.300;32,1350;32,2000;32,2000;32,1350
    dbk.de;2014-04-09 09:08:14+02;500;32,1200;32,1200;32,1200;32,1200

    it is parsed from xml… but i realized, that the volumes have no plus or minus or something similar which i would expect…

    nor in the returned xml

    So hwo would I calculate the volume… a simple minus wouldnt work, see second data row…

  91. CHANDRA MUNUKUTLA

    Using the info provided here and a little bit of ruby scripting (with text-table gem installed), here is something folks can use to get a neat table for each of the stock of their interest.
    https://github.com/csmunuku/myscripts/blob/master/ruby/stocks_csv_table.rb

  92. KATHLEEN

    Anyone else having problems with exchanges? I have been getting crude oil prices using

    http://finance.yahoo.com/d/quotes.csv?s=CLK14.NYM&f=nab+l1

    Was working great – now all of a sudden, I just get N/A and zeroes…

  93. VINNIE RUSSO

    Every time I go to download a spreadsheet in .csv form, the Microsoft Office default appears. I want to use Microsoft Works instead. How do I change the default from Office to Works?

  94. PETE

    Anybody know how to download historic, or at least last 4 qtrs of EPS via Yahoo URL? Thanks!

  95. JERRY

    Great info for stocks data. How about options data? I want to download a CSV of the option chain.

  96. ROGER DAILEY

    When using s1 shares owned I’m getting additional columns. Not sure what going on here all others work fine.

    Roger

  97. JAKOB

    I found that you can get the full company name (not cut off after 17 or so characters) through the Yahoo! Finance charting API:http://chartapi.finance.yahoo.com/instrument/1.0/msft/chartdata;type=quote;range=1d/csv/

    Slightly different format, but dead easy to parse.

  98. ROGER DAILEY

    When I run f6 = float shares only I get 3 columns when I expect only one. What am I doing wrong?

  99. ROGER DAILEY

    Question:
    Would it be possible to remove the comma’s in Shares Outstanding, Float Shares and Last Trade Size? Other numerical fields are this way, like average daily volume for example.

    Regards
    roger

  100. DUDZ ARTIAGA

    Hi – I am wondering it I can get qoutes from Philippine Stock Exchange Index (PSEI). I can get just the summary here http://finance.yahoo.com/q?s=PSEI.PS. I was hoping to see stock qoute from a particluar company like ‘BDO’,’BPI’ and so on..

    Do you know how can I get it?

    Thanks!

  101. AB

    Just tried to get ex-dividend date for a stock. Using the following URL
    http://download.finance.yahoo.com/d/quotes.csv?s=avgo&f=sqr1
    I get “AVGO”,”Mar 18″,”Jun 30″
    but the ex-dividend date is wrong; it should be 6/17/2014, I believe.

    Is yahoo wrong, or is “q” the wrong code for latest ex-dividend date?

  102. XZONE0

    Concerning poster Kathleen
    April 14, 2014 at 4:29 pm

    I am having the same problem with stock futures, etc no longer displaying properly.

  103. DEEPAK

    Thanks for this great post! This is exactly what I was looking for since ages…..

    I am just wondering why this won’t work for India Exchanges like BSE and NSE even when I use .BO and .NS as suffix. It just throws csv with N/A values.

    e.g.

    finance.yahoo.com/d/quotes.csv?s=RELIANCE.NS&f=nab returns

    RELIANCE.NS N/A N/A

    Highly appreciate your response.

    Thanks again for this great Post!!!!!

Leave a Comment

Your email address will not be published. Required fields are marked *

 

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值