# Get FinancialData price history?

GROUPS:
 sridev ramaswamy 1 Vote Since 16 may 2017, why am I not able to get the price history of US stock market tickers? Please see output below! Has anything changed? In[9]:= FinancialData["GE", {{2017, 1, 3}, {2017, 5, 15}}] Out[9]= Missing["NotAvailable"] In[10]:= FinancialData["IBM", {{2017, 1, 3}, {2017, 5, 15}}] Out[10]= Missing["NotAvailable"] 
4 months ago
35 Replies
 Hi Sridev,can you try this? Entity["Financial", "NYSE:IBM"][EntityProperty["Financial", "Last", List[Rule["Date", Interval[List[DateObject[List[2005]], Today]]]]]] Cheers,Marco
4 months ago
 Thank you Marco. This did give the price data. but I am not sure about other properties. I shall experiment.one shortcoming is that the last data is as of 16may2017 whereas if FinancialData were working my last data point would have been 17may2017 when you run it on 18may2017.I could see that the data using your syntax is coming from wolfram knowledgebase, whereas the FinancialData function perhaps downloads the data from a different source (perhaps a more Live source). maybe that source is broken? does anyone face similar problem or can anyone working in wolfram in the community comment?Its like a key finance inbuilt function is not working. which is the best place to report this. sorry I have not done that before. Hence the question.
4 months ago
 Hi,it used to use Yahoo.It is true that many of the examples in the documentation of FinancialData do currently not appear to work properly on my machine. (MMA 11.1.1, OSX 10.12.4)Best wishes,Marco
4 months ago
 This is true for me as well. FinancialData will return a current price if no date is specified. If a date or date range is specified it returns Missing. The missing issue started in the last day or two - it was working up to a few days ago. This has happened before.
4 months ago
 Marco, Do you know how to obtain from Mathematica a list of entities on in the S&P 500? I have a list in ticker format, e.g. "CAT", but not in the "NYSE:CAT" format.
4 months ago
 I also have this problem. I assume there must be a problem on the Wolfram side of things???I wonder if there is a way to report such issues to appropriate Wolfram staff?Wolfram Alpha is working for me ... but ... it does not seem to provide Open, High, Low or Volume data.
4 months ago
 Dear David,are you looking for this? EntityClass["Financial", "SP500"] It gives you an entity list. EntityList[EntityClass["Financial", "SP500"]] appears to give all members.Cheers,Marco
4 months ago
 I've reported this to tech support. However, the problem might be at the source rather than with Mathematica.
4 months ago
 Yes. Thank you!
4 months ago
 Hi, I have two observations: A couple of days ago there was a Paclet update, I think (http://community.wolfram.com/groups/-/m/t/1093145) I just used the Yahoo historical data api directly as described here. So basically I just execute: URLExecute["http://ichart.finance.yahoo.com/table.csv?s=IBM&a=11&b=15&c=2016&d=11&e=19&f=2016&g=11&ignore=.csv"]  This is the reply I get:If that means what I think it means, it could be a temporary Yahoo glitch which might make this a temporary issue.Cheers,MarcoUpdate: having said that, on the website mentioned above there is a reply from 7 hours ago that says: Hey everyone! Just to update this post a little bit: Historical API has been shut down by Yahoo Finance. Here is a link. If that's true, it might be a longer term problem....
4 months ago
 Thanks Marco. His latest post shows what we feared that the api link with the live source(yahoo finance) is broken. Thanks David for reporting it to wolfram tech support. Pls let us know what you hear from them. I hope they hook the link to google finance or finviz or direct exchange delayed feed service or something like that. I think the alternative Marco's expression worked because it sources info from knowledgebase which gets data stored at a day's delay or something. And the original source for that could be several. so that's still getting data updated. Unless wolfram links up FinanacialData to a new feed, for the moment this function remains broken. even if it returns I am sure it will be a while perhaps till this finance function works in its full old vigour (with several ticker properties not just price that yahoo finance was providing). Lets see. Lets keep each other updated if we find alternative solutions or hear back from wolfram mathematica support.
4 months ago
 Reply just received from tech support:"Thank you for contacting Wolfram Technical Support. It does appear as though our FinancialData functionality is not behaving as one would expect. Upon investigation, it seems as though Yahoo Finance (where we get the data) is down at the moment (https://ichart.finance.yahoo.com/). We are working with them to resolve the issue as soon as possible."They go on to suggest the same workaround used above by Marco.
4 months ago
 Hey. I am new at this and not all that confident about suggesting anything but ...I was poking around and came across https://blog.quandl.comThey provide free data. Here are instructions on the APIhttps://blog.quandl.com/api-for-stock-dataI got joined and got an API key and this workedhttps://www.quandl.com/api/v3/datasets/WIKI/FB/data.csv?api_key=MYAPIKEYI know nothing of the data quality. I wonder, does this seem like a reasonable alternative?
4 months ago
 Have you guys seen this post? Financial data from Quandl in Wolfram Language using QuandlLink
4 months ago
 In regards to Have you guys seen this post? Financial data from Quandl in Wolfram Language using QuandlLink I do not yet have any experience with packages. Does this work better than using variants of the URL for Quandl data? https://www.quandl.com/api/v3/datasets/WIKI/FB/data.csv?api_key=MYAPIKEY Is using that package worth the effort it might take (for me, at least) to make it work? Variants of https://www.quandl.com/api/v3/datasets/WIKI/FB/data.csv?api_key=MYAPIKEY seem fairly simple.
4 months ago
 Edited for clarity and code:Suitable quick solution. There is also a way to fully limit calls to Quandl data fields, ie, retrieve just date and adjusted close or whatever required. Anmol Bajracharya (QuandlLink author) posted a method using Dataset for filtering in the package documentation.QuandlLink can be downloaded from https://github.com/bajracha71/Quandl-Mathematica-QuandlLink. Note FinancialData was never robust (vendor dependencies). It's certainly not the reason to use Mathematica in finance. The following fragment retrieves the 1-year adjusted closing price for AAPL as example : Needs["QuandlLink"] myquandlkey = "myquandlkey"; dataset = "datasets/WIKI/"; sym = "AAPL"; tstart = startDate -> DateString[DatePlus[Yesterday, {-1, "Year"}], "ISODate"]; tend = endDate -> DateString[Yesterday, "ISODate"]; s = Reverse[Rest[QuandlFinancialData[StringJoin[dataset, sym], apiKey -> myquandlkey, tstart, tend]]][[All, 12]]; s0 = Last[s] 
4 months ago
 This is an issue with Yahoo as a data source. Wolfram|Alpha doesn't use Yahoo, so it's not affected. You should try using Entities like the examples in the comments instead of using FinancialData.
4 months ago
 I've also been struggling with this. I've tried using Marco's suggestion, but with limited success, for example, how do you get data for Facebook? NASDAQ:FB doesn't work.
4 months ago
 This doesn't work for you? DateListPlot[ Entity["Financial", "NASDAQ:FB"]["Close", "Date" -> Interval[{DateObject[{2005}], Today}]]] 
4 months ago
 I'm running 11.0.1 under Linux. Here's what I get: DateListPlot[ Entity["Financial", "NASDAQ:FB"]["Close", "Date" -> Interval[{DateObject[{2005}], Today}]]]; DateListPlot::ldata: Missing[RetrievalFailure] is not a valid dataset or list of datasets. FinancialData["NASDAQ:FB", "Lookup"] {}Many stocks work, but some do not (FB, SNAP, KHC for example)Thanks, Joe
4 months ago
 I found another way on the web to get ticker price data (even intraday is possible with this approach as unit of time is 1 sec. 1800=30minutes) In[20]:= GetPriceData[stocksymbol_, exchangesymbol_, interval_, numperiod_, parameters_] := "http://www.google.com/finance/getprices?q=" <> ToString[stocksymbol] <> "&x=" <> ToString[exchangesymbol] <> "&i=" <> ToString[interval] <> "&p=" <> ToString[numperiod] <> "&f=" <> ToString[parameters] <> ""; In[21]:= PriceData = Import[GetPriceData["QQQ", "NASDAQ", "1800", "10d", "d,c"]]; In[22]:= PriceData[[9 ;; Length[PriceData], 2]] Out[22]= {138.391, 138.52, 138.39, 138.395, 138.31, 138.385, 138.321, \ 138.16, 138.26, 138.22, 138.245, 138.355, 138.32, 138.4, 138.11, \ 137.97, 137.96, 138.255, 138.195, 138.26, 138.341, 138.36, 138.38, \ 138.29, 138.37, 138.32, 138.4, 138.01, 137.635, 137.54, 137.54, \ 137.7, 137.68, 137.84, 137.84, 137.97, 138.2, 138.26, 138.15, 138.15, \ 138.29, 138.41, 138.38, 138.312, 138.34, 138.48, 138.6, 138.52, \ 138.52, 138.5, 138.63, 138.53, 138.57, 138.441, 138.6, 138.64, \ 138.91, 138.9, 139.06, 138.89, 138.79, 138.76, 138.77, 138.9, 138.97, \ 138.81, 138.92, 138.94, 139.04, 139.38, 139.37, 139.06, 139.2, \ 139.287, 139.39, 139.481, 139.47, 139.465, 139.395, 139.395, 139.4, \ 139.46, 139.62, 138.53, 138.12, 137.99, 137.26, 137.4, 137.66, \ 137.405, 137.64, 137.411, 137.16, 136.83, 136.71, 136.65, 136.07, \ 136.05, 136.53, 137.19, 137.121, 137.22, 136.71, 136.879, 136.9, \ 136.86, 137.23, 137.54, 137.33, 137.309, 137.26, 137.72, 138.04, \ 138.19, 138.21, 138.14, 138.22, 138.26, 138.34, 138.29, 138.24, \ 138.255, 138.26, 137.92, 137.825, 138.145, 138.58, 138.62, 138.55, \ 138.69, 138.8, 138.886, 138.86, 138.86, 138.793, 138.87, 138.918, \ 138.94, 139} 
4 months ago
 Please note that I'm still having issues today with DateListPlot[ Entity["Financial", "NASDAQ:FB"]["Close", "Date" -> Interval[{DateObject[{2005}], Today}]]] about 40 equities work, but the following fail as mentioned above (basically there is no data):KHC, FB, FSRVX, MWEMX, MWTSX, SNAP.Could it be the data server that I'm drawing from?? Is there a way to change servers?
4 months ago
 Hi Sridev, Thanks for the pointer! It looks like about 80 days is as far as you can look back (or am I confused?) Also, I can't figure out how to look up mutual funds.-Joe
4 months ago
 FinancialData appears to work again. i havent tried all the options and settings..For example, when i tried FinancialData["GE",{2016}], it gives daily data starting from jan 1, 2016 as expected. Thanks to wolfram team to make the function work again. it will be nice to know details of where they are sourcing it..(is yahoo api back on or is it a different source?)thanks SR
3 months ago
 The Yahoo! Finance API is still (permanently, as far as anyone knows) gone. I'm glad it's meeting your needs right now — overall, FinancialData is in decent shape, but not as robust as we want it to be. We're in the process of switching it over to use WolframAlpha financial sources under the hood, and will announce when that transition is complete.
3 months ago
 Are you finding that financial data functions work for you now? (i.e. using FinancialData[])Jeff Lapides
3 months ago
 Are you finding that FinancialData works? I continue to have problems with it.Jeff Lapides
3 months ago
 daily price data from a start date to end date is what i normally use this function for. and it appears to work normally again since i posted that update on this thread earlier.....
3 months ago
 Yahoo finance API is not available anymore. I have moved to MarketXLS after this change, much more reliable data.
2 months ago
 FinancialData[sym, "Close", startdate] `worked for the past few weeks, but is failing again as of yesterday.
2 months ago
 agree. was failing 1 or 2 days ago...it seems to work ok today, if you want to check
2 months ago
 Hi Sridev, Confirmed working today (July 14). Thanks so much for letting me know. This kind of functionality if why I purchased Mathematica. It is important to me to have access to this type of data without having to write my own scrapers, etc.
2 months ago
 Yahoo finance API is not available anymore. I have moved to MarketXLS after this change, much more reliable data.
2 months ago
 Joe:Agreed. Seems to go in and out. Not working today, July 15.Jeff
2 months ago
 As of about July 17, FinancialData has been working fine for me. Thanks Wolfram (and Wolfram Community).