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

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.


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

Pricing Dividends
a: Ask y: Dividend Yield
b: Bid d: Dividend per Share
b2: Ask (Realtime) r1: Dividend Pay Date
b3: Bid (Realtime) q: Ex-Dividend Date
p: Previous Close
o: Open
c1: Change d1: Last Trade Date
c: Change & Percent Change d2: Trade Date
c6: Change (Realtime) t1: Last Trade Time
k2: Change Percent (Realtime)
p2: Change in Percent
c8: After Hours Change (Realtime) m5: Change From 200 Day Moving Average
c3: Commission m6: Percent Change From 200 Day Moving Average
g: Day’s Low m7: Change From 50 Day Moving Average
h: Day’s High m8: Percent Change From 50 Day Moving Average
k1: Last Trade (Realtime) With Time m3: 50 Day Moving Average
l: Last Trade (With Time) m4: 200 Day Moving Average
l1: Last Trade (Price Only)
t8: 1 yr Target Price
w1: Day’s Value Change g1: Holdings Gain Percent
w4: Day’s Value Change (Realtime) g3: Annualized Gain
p1: Price Paid g4: Holdings Gain
m: Day’s Range g5: Holdings Gain Percent (Realtime)
m2: Day’s Range (Realtime) g6: Holdings Gain (Realtime)
52 Week Pricing Symbol Info
k: 52 Week High v: More Info
j: 52 week Low j1: Market Capitalization
j5: Change From 52 Week Low j3: Market Cap (Realtime)
k4: Change From 52 week High f6: Float Shares
j6: Percent Change From 52 week Low n: Name
k5: Percent Change From 52 week High n4: Notes
w: 52 week Range s: Symbol
s1: Shares Owned
x: Stock Exchange
j2: Shares Outstanding
v: Volume
a5: Ask Size
b6: Bid Size Misc
k3: Last Trade Size t7: Ticker Trend
a2: Average Daily Volume t6: Trade Links
i5: Order Book (Realtime)
Ratios l2: High Limit
e: Earnings per Share l3: Low Limit
e7: EPS Estimate Current Year v1: Holdings Value
e8: EPS Estimate Next Year v7: Holdings Value (Realtime)
e9: EPS Estimate Next Quarter s6 Revenue
b4: Book Value
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 Code
Here is a quick example of how you can use the free Yahoo Finance API in your C# code.

Application Entry Point (main)

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));



Parsing Class and State Bag

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]);


            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!

Country Exchange Suffix Delay Data Provider
United States of America American Stock Exchange N/A 15 min Direct from Exchange
United States of America BATS Exchange N/A Real-time Direct from Exchange
United States of America Chicago Board of Trade .CBT 10 min Interactive Data Real-Time Services
United States of America Chicago Mercantile Exchange .CME 10 min Interactive Data Real-Time Services
United States of America Dow Jones Indexes N/A Real-time Interactive Data Real-Time Services
United States of America NASDAQ Stock Exchange N/A 15 min Direct from Exchange
United States of America New York Board of Trade .NYB 30 min Interactive Data Real-Time Services
United States of America New York Commodities Exchange .CMX 30 min Interactive Data Real-Time Services
United States of America New York Mercantile Exchange .NYM 30 min Interactive Data Real-Time Services
United States of America New York Stock Exchange N/A 15 min Direct from Exchange
United States of America OTC Bulletin Board Market .OB 20 min Direct from Exchange
United States of America Pink Sheets .PK 15 min Direct from Exchange
United States of America S & P Indices N/A Real-time Interactive Data Real-Time Services
Argentina Buenos Aires Stock Exchange .BA 30 min Interactive Data Real-Time Services
Austria Vienna Stock Exchange .VI 15 min Telekurs
Australia Australian Stock Exchange .AX 20 min Interactive Data Real-Time Services
Belgium Brussels Stocks .BR 15 min
Brazil BOVESPA – Sao Paolo Stock Exchange .SA 15 min Interactive Data Real-Time Services
Canada Toronto Stock Exchange .TO 15 min Interactive Data Real-Time Services
Canada TSX Venture Exchange .V 15 min Interactive Data Real-Time Services
Chile Santiago Stock Exchange .SN 15 min Interactive Data Real-Time Services
China Shanghai Stock Exchange .SS 30 min Interactive Data Real-Time Services
China Shenzhen Stock Exchange .SZ 30 min Interactive Data Real-Time Services
Denmark Copenhagen Stock Exchange .CO 15 min Telekurs
France Euronext .NX 15 min Telekurs
France Paris Stock Exchange .PA 15 min Telekurs
Germany Berlin Stock Exchange .BE 15 min Telekurs
Germany Bremen Stock Exchange .BM 15 min Telekurs
Germany Dusseldorf Stock Exchange .DU 15 min Telekurs
Germany Frankfurt Stock Exchange .F 15 min Telekurs
Germany Hamburg Stock Exchange .HM 15 min Telekurs
Germany Hanover Stock Exchange .HA 15 min Telekurs
Germany Munich Stock Exchange .MU 15 min Telekurs
Germany Stuttgart Stock Exchange .SG 15 min Telekurs
Germany XETRA Stock Exchange .DE 15 min Telekurs
Hong Kong Hong Kong Stock Exchange .HK 15 min Interactive Data Real-Time Services
India Bombay Stock Exchange .BO 15 min Interactive Data Real-Time Services
India National Stock Exchange of India .NS 15 min National Stock Exchange of India
Indonesia Jakarta Stock Exchange .JK 10 min Interactive Data Real-Time Services
Israel Tel Aviv Stock Exchange .TA 20 min Telekurs
Italy Milan Stock Exchange .MI 20 min Telekurs
Japan Nikkei Indices N/A 30 min Interactive Data Real-Time Services
Mexico Mexico Stock Exchange .MX 20 min Telekurs
Netherlands Amsterdam Stock Exchange .AS 15 min Telekurs
New Zealand New Zealand Stock Exchange .NZ 20 min Interactive Data Real-Time Services
Norway Oslo Stock Exchange .OL 15 min Telekurs
Portugal Lisbon Stocks .LS 15 min
Singapore Singapore Stock Exchange .SI 20 min Interactive Data Real-Time Services
South Korea Korea Stock Exchange .KS 20 min Interactive Data Real-Time Services
South Korea KOSDAQ .KQ 20 min Interactive Data Real-Time Services
Spain Barcelona Stock Exchange .BC 15 min Telekurs
Spain Bilbao Stock Exchange .BI 15 min Telekurs
Spain Madrid Fixed Income Market .MF 15 min Telekurs
Spain Madrid SE C.A.T.S. .MC 15 min Telekurs
Spain Madrid Stock Exchange .MA 15 min Telekurs
Sweden Stockholm Stock Exchange .ST 15 min Telekurs
Switzerland Swiss Exchange .SW 30 min Telekurs
Taiwan Taiwan OTC Exchange .TWO 20 min Interactive Data Real-Time Services
Taiwan Taiwan Stock Exchange .TW 20 min Interactive Data Real-Time Services
United Kingdom FTSE Indices N/A 15 min Telekurs
United Kingdom London Stock Exchange .L 20 min Telekurs

Categories:   Code, Finance


  • Posted: February 26, 2012 10:37


    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
  • Posted: March 5, 2012 21:19


    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 here http://www.jarloo.com/download-stock-symbols/
  • Posted: March 23, 2012 22:49


    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
  • Posted: March 24, 2012 05:48


    @LALAS I posted the Visual Studio project, you can download from the big green button above.
  • Posted: March 24, 2012 10:18


    Cheers.. :)
  • Posted: June 26, 2012 06:43

    Uri G

    Is there anyway to retrieve the stocks Beta (risk) in a specific date? Thanks!
    • Posted: September 15, 2015 08:48

      jean charles

      I would be interested by that answer as well. I can return by csv file the today info, but how can i return the stock price of a specific date? Thank you. JC
      • Posted: September 21, 2015 11:10

        Dave S.

        As far as I know, historical Beta values cannot be retrieved, but if there's a way to do it, I hope someone posts it. Current Beta for an equity is in Key Stats. You can retrieve price data for a "range" of just 1 day, which is the day of interest. To retrieve the closing price of INTC for 6/10/2013: http://ichart.finance.yahoo.com/table.csv?s=INTC &a=6 &b=10 &c=2013 &d=6 &e=10 &f=2013
  • Posted: July 10, 2012 10:47

    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.
    • Posted: June 12, 2013 09:28

      Kelly Elias

      I just updated the article with the Yahoo Exchange codes for every exchange, so you can use those to tell the difference.
  • Posted: July 17, 2012 11:17

    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.
  • Posted: July 20, 2012 20:02


    Hi, May I know how to retrieve stock option detail quotes ? Thanks. Kevin
  • Posted: September 27, 2012 05:04


    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?
    • Posted: September 27, 2012 07:24


      This uses an API and does NOT use YQL. The API has been around for years and works quite well.
  • Posted: October 22, 2012 12:49


    Can monthly and weekly prices be downloaded through this api? If so how is it done?
    • Posted: October 22, 2012 13:17


      As far as I am aware only dailies are available.
  • Posted: November 6, 2012 19:46


    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.
    • Posted: November 7, 2012 07:48


      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.
  • Posted: November 6, 2012 19:49


    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?
  • Posted: November 12, 2012 09:02


    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
    • Posted: September 15, 2015 08:50

      jean charles

      DJI is not working, DOW JONES disallow yahoo to use their data. Best way is return a tracker data like DIA
  • Posted: January 26, 2013 23:32


    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
  • Posted: February 3, 2013 20:01


    Here's some more tags: s6 - Revenue j2 - Shares Outstanding
  • Posted: February 12, 2013 08:31


    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
  • Posted: February 12, 2013 17:35


    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!!
    • Posted: February 12, 2013 18:10

      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.
  • Posted: February 13, 2013 08:26


    Thanks Kelly! Will do.
  • Posted: February 18, 2013 17:10


    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.
  • Posted: February 20, 2013 10:11


    Anyway symbol to download BETA for a stock?
  • Posted: March 8, 2013 07:48


    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?
    • Posted: March 8, 2013 08:36

      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
  • Posted: April 5, 2013 01:40


    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 site http://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....
  • Posted: April 25, 2013 04:51


    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.
    • Posted: April 25, 2013 07:48

      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.
  • Posted: May 2, 2013 04:07


    Is there a way to get commodities from yahoo finance with csv ?
    • Posted: May 2, 2013 09:39

      Kelly Elias

      Not that I'm aware of.
  • Posted: May 4, 2013 16:27


    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?
  • Posted: May 6, 2013 14:41


    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!
  • Posted: May 24, 2013 23:18

    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
  • Posted: June 2, 2013 09:48


    anyone can halp me couz i have one project about yahoo financ?
  • Posted: June 6, 2013 06:12


    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; }
  • Posted: June 18, 2013 09:47


    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!
  • Posted: July 11, 2013 06: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
  • Posted: July 24, 2013 04:00

    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
  • Posted: August 21, 2013 08:01


    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!
  • Posted: August 30, 2013 11:58


    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
  • Posted: September 5, 2013 11:04

    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...
  • Posted: September 24, 2013 06:26

    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...
  • Posted: October 2, 2013 05:47

    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
    • Posted: October 2, 2013 07:44

      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.
  • Posted: October 2, 2013 08:12

    Ray Johnson

    Thanks, Kelly. If I run into trouble I will try the multiple stock download.
  • Posted: October 3, 2013 01:04

    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! :-)
    • Posted: October 3, 2013 10:04

      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.
  • Posted: October 3, 2013 12:03

    Ray Johnson

    Jarrod, that's reassuring to hear. Thanks!!
  • Posted: October 4, 2013 04:20

    Daia Alexandru

    Hy , i was wondering how cand i retrieve historical data between a start date and an end date ? Tnks
    • Posted: October 4, 2013 08:11

      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
  • Posted: October 7, 2013 02:45


    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?
    • Posted: October 7, 2013 07:03

      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
  • Posted: October 7, 2013 07:22

    Jarrod Elmes

    I guess you tried with no prefix? eg: SAN It seems to work there but not much info is returned.
  • Posted: October 7, 2013 07:23

    Jarrod Elmes

    Sorry, I meant suffix :-)
  • Posted: October 11, 2013 11:51


    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
  • Posted: October 14, 2013 17:45

    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?
  • Posted: October 15, 2013 06:58


    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?
  • Posted: October 20, 2013 11:55


    Hi, Is there a way to retrieve the earning date? I don't see the earning date on the API list. Thanks.
  • Posted: October 23, 2013 14:43

    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...
  • Posted: October 23, 2013 18:03


    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?
  • Posted: October 24, 2013 02:22

    Ray J.

    My posts are not published here anymore .. Why ..? Kind regards Ray
  • Posted: October 24, 2013 16:23

    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...
  • Posted: October 25, 2013 00:57

    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
  • Posted: October 25, 2013 05:58

    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...
  • Posted: November 1, 2013 07:29


    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
  • Posted: November 25, 2013 06:00


    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
  • Posted: November 25, 2013 08:22


    How to download quotes indices of the LSE?
  • Posted: December 25, 2013 21:52


    Two other stock exchanges you can add to your nice final table! Thanks ;) Belgium Brussels Stocks .BR Portugal Lisbon Stocks .LS
    • Posted: December 29, 2013 14:35

      Kelly Elias

      Great, I've added them to the list. Thanks!
      • Posted: December 30, 2013 01:10


        Happy to help ;) In the table you added ".LS" instead of ".BR" for Brussel stocks.
      • Posted: December 30, 2013 08:58

        Kelly Elias

        Copy and paste is both a blessing and curse. It's fixed, thanks again for pointing that out.
  • Posted: December 30, 2013 15:27


    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.
  • Posted: December 30, 2013 21:01


    Can you please let us know if there a way to get Beta information for a stock?
    • Posted: December 31, 2013 00:19

      Kelly Elias

      While Yahoo provides Beta on there site I haven't seen a way to easily get it.
  • Posted: January 27, 2014 04:15


    How can i get gold rates from yahoo finance?
    • Posted: February 9, 2014 13:06

      sandro giangrandi

      http://download.finance.yahoo.com/d/quotes.csv?s=AAPL+GOOG+MSFT can you try? it should work. ciao Sandro
  • Posted: January 27, 2014 04:16


    How can i get gold price data from yahoo finance?
  • Posted: January 28, 2014 06:50


    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 !!
  • Posted: February 7, 2014 04:07


    Hi, am i the only one for whom the api is not working? I keep getting 404 errors for links like http://finance.yahoo.com/d/quotes.csv?s=AAPL+GOOG+MSFT
  • Posted: February 9, 2014 15:05


    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.
  • Posted: February 21, 2014 13:43


    Is there anyway to get enterprise value into excel using this?
    • Posted: February 21, 2014 15:21

      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.
  • Posted: March 3, 2014 14:58


    I've searched a bit for how to find out the currency, here it is: c4 = currency Alex
  • Posted: March 13, 2014 09:00


    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 =)
  • Posted: March 13, 2014 09:46


    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?
  • Posted: April 7, 2014 04:22


    Greate article! I've learned a lot. Do you know how to get history of earnings or EPS?
  • Posted: April 9, 2014 16:21


    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...
  • Posted: April 11, 2014 06:19

    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
  • Posted: April 14, 2014 16:29


    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...
  • Posted: April 25, 2014 14:45

    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?
  • Posted: May 1, 2014 08:25


    Anybody know how to download historic, or at least last 4 qtrs of EPS via Yahoo URL? Thanks!
  • Posted: May 7, 2014 23:28


    Great info for stocks data. How about options data? I want to download a CSV of the option chain.
  • Posted: May 18, 2014 20:40

    Roger dailey

    When using s1 shares owned I'm getting additional columns. Not sure what going on here all others work fine. Roger
  • Posted: May 20, 2014 07:15


    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.
  • Posted: May 25, 2014 06:18

    Roger dailey

    When I run f6 = float shares only I get 3 columns when I expect only one. What am I doing wrong?
  • Posted: May 26, 2014 08:25

    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
  • Posted: June 11, 2014 22:21

    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!
  • Posted: June 13, 2014 20:41


    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?
  • Posted: June 24, 2014 15:20


    Concerning poster Kathleen April 14, 2014 at 4:29 pm I am having the same problem with stock futures, etc no longer displaying properly.
  • Posted: July 23, 2014 22:23


    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!!!!!
  • Posted: September 4, 2014 19:23


    Any idea how to get the information from the Business Summary area? Thanks!!
  • Posted: September 6, 2014 08:39


    DEEPAK, login to Yahoo finance and try finance.yahoo.com/d/quotes.csv?s=RELIANCE.NS&f=nab you will get the data
  • Posted: September 11, 2014 09:42


    i'm still getting only 17 characters for a stocks name, the rest are being truncated. Is there any solution available for this?
    • Posted: September 18, 2014 18:24

      Kelly Elias

      I don't know of one, that is simply how they choose to return the data unfortunately. You could always use the ticker to look up the full name elsewhere though.
  • Posted: October 15, 2014 04:05


    Wrong letter in More info = i NOT v
  • Posted: October 21, 2014 06:24

    Bhaskar Rabha

    I am trying to get data from url - http://finance.yahoo.com/d/quotes.csv?s=CRAVATEX.BO&f=nab but it is returning N/A. Same is showing perfect on yahoo finance URL - https://in.finance.yahoo.com/q?s=CRAVATEX.BO&f=nl1c1&e=.csv. Please help me where i am doing wrong or it is API issue.
  • Posted: October 29, 2014 13:18


    How can I get stock prices by minute (can I specify the time?) for 6 months back?
  • Posted: October 31, 2014 09:14


    I know this has been asked previously, but.. Does anyone know how to download historical EPS numbers? Is this possible with the Yahoo API, or can this be acquired elsewhere? Thanks
  • Posted: November 15, 2014 06:20


    I have found that some of the Yahoo data fields return values that have commas within their data in addition to the expected commas. They aren't wrapping the data with quotes so this causes Excel to interpret them as belonging to multiple cells. The NAME field does get returned with quotes so that doesn't cause a problem. I suspect that several of the questions about broken data returns are related to this problem. For these fields I have to download their data individually and wrap them with quotes before saving them. So far, these are the ones that I've found: FLOAT_SHARES("f6"), BID_SIZE("b6"), LAST_TRADE_SIZE("k3"), SHARES_OUTSTANDING("j2"), TRADE_LINKS("t6") For example, if you use the following URL, Excel displays this as 6 columns instead of the four that you asked for. http://download.finance.yahoo.com/d/quotes.csv?s=GIS&f=snf6b6&e=.csv
  • Posted: November 17, 2014 17:37


    Is there a known way to get the sector info from yahoo? I know you can look it up in another api but it would be nice to get it straight from yahoo
  • Posted: November 21, 2014 09:17


    Yahoo API that calls stock data seems to be stuck on the closing price of Nov 20. Would be nice if Yahoo fixed this. Don't know how to alert them.
  • Posted: November 21, 2014 09:30

    Dave S.

    As of 2-3 days ago, the API access to current stock prices still appears to be working, but there appears to have been no updating of prices since then. For example, here is the data I get today (Nov 21, 2014) for a several gold-related stocks: [ticker, curr. price, change, % change, volume] "ANV",1.49,-0.55,"-26.96%",11181504 "AUY",3.96,-0.28,"-6.60%",26189038 "GDXJ",27.26,-2.095,"-7.14%",39811928 "GG",20.09,-1.20,"-5.64%",12700780 These data are 2-3 days old. Has anyone else noticed this? If there is a limit to use of the API download service, and my API has been locked, would this be what such a lock would look like, or would there be no download allowed at all? Thanks.
  • Posted: November 21, 2014 09:42

    Dave S.

    ;-) I meant "my IP has been locked.."
  • Posted: November 21, 2014 10:19

    Dave S.

    And wouldn't you know it...20 minutes after posting the above (after 2-3 DAYS of no price updates) the current price data is suddenly available again. Relief. Still, I'd be interested to hear if anyone else saw the above gap in availability.
  • Posted: November 21, 2014 10:32


    Use a dash instead of a period in the stock symbol.
  • Posted: December 10, 2014 18:13


    Is anyone successfully using this to get option quotes? Is there a simple format directly using finance.yahoo.com? The only Yahoo REST API for option quotes seems to be a messy call to YQL embedded in a URL. Regardless, that worked. At least it did until recently. Is anyone getting option data anymore through YQL? Example... select option from yahoo.finance.options where symbol = "COH" and expiration = "2015-05" and option.symbol = "COH150220C00039000" Or... https://query.yahooapis.com/v1/public/yql?q=select%20option%0Afrom%20yahoo.finance.options%0Awhere%20symbol%20%3D%20%22COH%22%20%0A%20%20and%20expiration%20%3D%20%222015-05%22%20%0A%20%20and%20option.symbol%20%3D%20%22COH150220C00039000%22%20%0A&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys No luck. Update - The only table that seems to be returning anything on options is yahoo.finance.oquotes - should I just send the YQL in a URL, or does anyone know of a simpler format that will get me the same results (similar to the URL that returns quotes in CSV format for stocks...) Any suggestions much appreciated!
  • Posted: December 15, 2014 11:33


    is there any way to get UK fund prices?
  • Posted: December 24, 2014 13:18


    Wonderfully useful insights, Kelly. Thank you. I am interested in TSX listed equities. I can get info for Alaris Royalty Corp using AD.TO. I am having no luck with investment trusts. An example: If I try Richards Packaging (RPI.UN) as RPI.UN.TO, I get nothing. Is there a trick to formatting this? Many Thanks
    • Posted: March 26, 2015 14:52

      Dave S.

      >>I am having no luck with investment trusts. An example: If I try Richards Packaging (RPI.UN) as RPI.UN.TO, I get nothing. Is there a trick to formatting this?<< Go to finance.yahoo.com and in the search EF at the top, start typing in the name of the company. The drop-down that usually results, if it contains the desired company, will also show yahoo's ticker for the company, in this case RPI-UN.TO
      • Posted: March 26, 2015 14:57


        You need to use a dash So for RPI.UN it is RPI-UN.TO And for Convertible debentures, say EIF.DB.D is EIF-DBD.TO Cheers
  • Posted: January 5, 2015 08:44


    I was able to get the last trade quotes for a group of stocks using the EXCEL 2013 WEBSERVICE function, but they do not automatically update. I cannot find a "refresh" function and even closing/reopening the EXCEL workbook does not refresh the quote. Any ideas?
    • Posted: March 26, 2015 13:00


      Assuming you are using Excel functions in the form of =NUMBERVALUE(WEBSERVICE(J29)) (WHERE THE ARGUMENT IS IN J29) It doesn't update automatically, and simple F9 doesn't do it. The only way I can get Excel to update quotes using this facility is ctrl-shift-alt-F9. Good Luck!
  • Posted: January 7, 2015 08:34


    All I want to be able to do is fetch a REAL TIME PRICE of the security. Please advise what symbol that is?. Last price is no good.
  • Posted: January 21, 2015 14:19


    I know nothing about C#, nevertheless, I was able to get this running in Microsoft Visual C# 2010. I even edited the program to get only bid, ask, and last of the S&P emini, and put in a 'do loop' along with 'Thread.Sleep(1800);' to keep my calls under 2000 per hour (the call limit). Now, where do I put code to process the data? I tried declaring variables before the 'do loop' and dropping in 'if' statements, but it says my variables are undeclared. WTF?
  • Posted: February 17, 2015 23:34


    Hi, I tried to retrieve the Japan stock price but to no avail. Appreciate if you could advise me on that. Thanks a lot.
  • Posted: February 23, 2015 14:07

    Peter Watling

    It seems the trading date/time isn't right for international quotes. The date element seems to be from the server, and the time the trade time in local timezone.
  • Posted: February 28, 2015 19:32


    I would just go to http://www.dailystockdata.com as they send a data file each trading day for over 35 global stock exchanges. They also have a nice FastMoney and CEOPicks section.
  • Posted: March 16, 2015 11:07


    Is this still working today? 3/16/2015? Using http://download.finnance.yahoo.com/d/quotes.csv?s=aapl&fsl1d1nd
  • Posted: March 30, 2015 12:32


    I have been using this in a spreadsheet for about a year, however approximately 1 month ago W1 and W4 stopped working (% change), and the data field only displays N/A. Has anyone else noticed this? Have these tags been replaced with something else? Thanks.
  • Posted: March 30, 2015 23:10

    Dave S.

    I don't use w1 and w4, but I can verify that they are returning N/A right now. How do these differ from c1 and c6? c1 (change) is still working and c6 (Change (real-time)) is not working at the moment (N/A), perhaps because we're after hours...?
  • Posted: March 31, 2015 13:49

    Dave S.

    It looks like c6 is not working either.
  • Posted: April 1, 2015 14:12

    Petr V.

    Hi guys, I am not able to get historical data for commodities, could you please help me out? Could you provide me with a URL to get eg. prices for each day in the date range of 30 days (for example in January) of eg. Corn Jul 15 (CN15.CBT)? I just need to know a way to specify date range for various commodities. Thanks a lot. Petr.
  • Posted: April 16, 2015 04:44

    Captain Jim

    Is there a code to return the broker's name that made the stock trade?
  • Posted: April 27, 2015 11:38


    Can someone put convert the C# source code into C. Thanks
  • Posted: April 29, 2015 22:41


    I founf the "http://finance.yahoo.com/d/A-NYSE-Ref.xls?s=A+AA+AAP+AB+ABB&f=sl1c6hgp2vt1r command no longer works since 28 April 2015, Any idea why and is there a replacement require from yahoo?
  • Posted: April 30, 2015 00:22

    Dave S.

    As of yesterday and today, yahoo's API is not returning stock data. Let's hope this isn't the end of a wonderful era. The charts are still available.
  • Posted: April 30, 2015 00:33


    Hi all. Anybody know what has a happened? I don get any response att all from yahoo.finance since yesterday (29/4). One example I use: http://finance.yahoo.com/d/quotes.html?s=ALFA.ST&f=nlghcvom3m4kj Regards Christian
  • Posted: May 1, 2015 11:28

    Dave S.

    The API is still working! But for some reason the output file can no longer be .txt and must be .csv. Whew...
  • Posted: May 3, 2015 00:54

    Andre Gotlieb

    I am also unable to download any quote from Yahoo since april 28. Before it worked. Weird enough currency data are still getting through but no quotes. the url call I use for quotes is: surl = "http://download.finance.yahoo.com/d/quotes.csv/q?s=" & Request & " &f=d1nsl1dya2&ignore=.csv" Request being a string with quotes I want to get separated by "+" the url call I use for currency exchange rates (this one works) is: surl = "http://download.finance.yahoo.com/d/quotes.csv?s=" & Request & "&f=d1sl1t1&e=.csv" for the quotes I am getting a return string in html starting with "Yahoo! - 404 Not Found" anyone a clue what has changed ?
  • Posted: May 3, 2015 01:53

    Andre Gotlieb

    Sorry guy's that I bothered. I found the error in the url string for the quotes. There was an extra "/q" at the url's end that shouldn't be there. a little further down in the html response string I found "Please check the URL for proper spelling and capitalization." so .... It works now.
    • Posted: May 5, 2015 22:27

      Kelly Elias

      Happy you got it resolved! Good luck in your trading.
    • Posted: July 25, 2015 15:18

      Jon Koehmstedt

      I'm still getting 404 When I go to http://ichart.yahoo.com/table.csv?s=APPL I get a 404 not found error, But when I go to http://ichart.yahoo.com/table.csv?s=GOOG It starts downloading a csv... Any idea why some tickers just don't work?
      • Posted: July 26, 2015 22:08

        Dave S.

        Try AAPL
  • Posted: May 20, 2015 02:55

    john constable

    ticker trend tag has been returning "N/A". does anyone know if there's a problem?
    • Posted: July 6, 2015 07:26


      Hello Does anyone know the code for DOW Jones, SSE Shanghai and BSE Sensex? The values DJIA returned N/A.
      • Posted: July 9, 2015 22:44

        Dave S.

        ^DJI, ^SSEC, ^BSESN
  • Posted: June 11, 2015 05:10

    Abner Zayd

    I seem to be getting N/A for some of the data too. Has there been an update to this? Do I need to adjust my API call?
  • Posted: August 27, 2015 09:44

    Joaquin Garcia

    I´m trying to parse quotes from Madrid stock exchange using your formula, but I realized that stocks with a point (example: REP.MC) are not parsed into CSV This is my link: http://finance.yahoo.com/d/quotes.csv?s="+ symbol + "&f=l1vr2ejkghpm3m4j3 Is there any way to go around this?? Thanks!!