How to get Yahoo Finance Data in Google Sheets!
Get Stock Data directly in your sheets: tickerdata.com/
Formula to get price from Yahoo finance into Google Sheets:
=IMPORTXML("finance.yahoo.com/quote/"&B2,"/html/body/div[1]/div/div/div[1]/div/div[2]/div/div/div[5]/div/div/div/div[3]/div[1]/div[1]/fin-streamer[1]")
In this video, I take you step by step on how to pull yahoo finance data into google sheets. This is an extremely useful method, and can be used to be to create phenomenal spreadsheets.
Let me know if you have any questions!
Get 50% off of Seeking Alpha Premium!
www.sahg6dtr.com/9D5QH2/R74QP/
Follow me on Twitter: / dividendology
Join my Discord! / dividendology
I am not a Financial advisor or licensed professional. Nothing I say or produce on KZread, or anywhere else, should be considered as advice. All content is for educational purposes only. I am not responsible for any financial losses or gains. Invest and trade at your own risk.
Пікірлер: 203
*UPDATE* Here is an updated video on how to do this: kzread.info/dash/bejne/k45txNKOpczVYbw.html
You were a lifesaver today. I found this video to be incredibly valuable when I encountered a significant roadblock. Thanks to this video, I successfully completed my client's project.
@Dividendology
8 ай бұрын
Fantastic!
Very informative and easy to follow! Thanks for showing how to get this done. I too am running into "Error: Loading Data....." message, but I think this is because of the amount of data elements I am asking for within the file, not just the few fields on the page you showed in your example.
Your tutorials are great, advanced feautures explained with ease. Thanks alot!
@Dividendology
8 ай бұрын
You are welcome!
Followed your example for stock price but returns "resource at url not found". I'm trying to grab VGAB from Yahoo. It's Vanguard Global Aggregate Bond Index ETF found on the NEO exchange in Canada. Thank you,
Great video! ❤ It is working. Thanks alot! A little update here, use ; instead of , and will work like in the video. Keep it up! ☀️
@piotrk2269
3 ай бұрын
thank you
Hi, Bert good video, but when I am trying the code for price it says that I can not have a = in the begining, Any idea?
Nice info and video. Have you done any importing of option chain data, single calls into excel or Google Sheets? Keep making the videos. Thank you.
Thanks, very helpful! Do you know is there a similar function in Excel?
@Dividendology
2 жыл бұрын
I believe excels power query function provides similar capabilities, but I’m guessing there are other ways to do it in excel as well!
Is it possible to pull the Analyst Data (Sell, Under, Hold, etc.) data from Market watch into Google Sheets? Been trying but I cant get it to up day with each different cell
This is very useful! Thank you for sharing. How do I split the 52 Week Range data (Low and High) separately?
@jakelamotta7904
2 жыл бұрын
FY
typed in exactly as you to get x-div date, and I get "#n/a error resource at url not found". Don't understand what I am doing wrong.
@rymelo2405
6 ай бұрын
Same.
I am getting an error message that says "resource at url not found". Thought that it might have been due to my language settings, so I tried starting a new one in english, but no luck there either
Thanks for your video! Very informative. I 'm trying to do this with the estimated 5 yr growth (using the url of the "analysis tab") but I get: "Error: Resource at url not found". Any idea?
@TheCPelsor
Жыл бұрын
I'm having the same problem. Will post if I find a solution.
@filippoghezzi654
Жыл бұрын
@@TheCPelsor Found a solution?
I was looking for this for 30 minutes! Everyone showed how to import the tables but I needed only one information (the stock price) Thanx
@Dividendology
2 жыл бұрын
You are welcome!
@SoulMarauder59
2 жыл бұрын
Oh they changed so you dont write , between the expressions but ;
@ICTARABIC
Жыл бұрын
@@SoulMarauder59 getting value error,needs table and list
@sandeepkumar-js3gi
Жыл бұрын
Same here...
@Play-jv3oi
4 ай бұрын
@@Dividendology can we find the float on that google sheet?
How come I receive an errorn "could mot fetch URL on every one of these I try from multiple sources. Can someone please help.
Great job bro, thank you.
Amazing work. I have a question about making a Google Sheet for Forex Trading and if you can fetch and parse data like bank interest rates, GDP, inflation numbers and Import & Export numbers of 8 Economies for the major 8 currencies around the globe. Perhaps possible to fetch the data from Yahoo Finance page. I would like to hear from you in this regard. Thank you.
Very good explainer video. I am getting some drift on my prices...what I see in Yahoo Finance is not exactly the same as what's in the sheet.
Did they change something , I cant get dividend date to import. I Get #N/A
@AndrewE-ko6pp
18 күн бұрын
Not only this I also get an error message: "Resource at url contents exceeded maximum size."
Thanks man.
Thanks for this information! very useful! do you know why sometimes the formula wont update and stays on "loading..."?
@Dividendology
2 жыл бұрын
I haven’t run into that error before with yahoo finance data. If I find out, I’ll be sure to let you know.
@bobkoss280
2 жыл бұрын
@@Dividendology Have you found out anything about "Loading..." for a long time, and then ending up with #N/A
@vaclavkinsky6964
8 ай бұрын
Same here @@bobkoss280
i can get anything above the "Summary Chart Conversations Statistics Historical Data Profile Financials Analysis Options Holders Sustainability" tabs to work, but not the data in the tabs, help plz?
Thank-you so much!
What is the formula to get the Growth Estimates - Next 5 Years (per annum) off the Analysis page on yahoo finance ?, I keep getting error message
HI thanks for the video but I can't get this to work, all I get is #N/A Error Resources at URL not found.
@FabsBlog07
3 ай бұрын
I get the same thing were you able to find the solution?
it's a bad advice to copy the full xpath. Because if there is any change in attributes beginning from the root to the element, the absolute xpath will become invalid. Copy the relative xpath instead (the one that starts with //)
@JoeCarena
3 күн бұрын
Copying the relative path didn't work. No copy/paste options are working. This is frustrating because the formula works for other sites, like his Wikipedia example, but not Yahoo Finance. This was all a waste of time and I assume it was intentional to get us to pay for his tickerdata service.
Thanks for the videos, I keep getting an imported content is empty error, any fix for this?
@elizastefanescu5390
4 ай бұрын
Hello! Use ; instead of , and will work. I had the same issue and I saw in the Google sheet syntax that you need to use ;
What about the Valuation Measures table in the Statistic tab? I have trouble applying the same command rule with the "Current x Enterprise Value/EBITDA" value (link, XPath)
@Dividendology
2 жыл бұрын
I'll look into ways to do this.
@harveymoment
2 жыл бұрын
@@Dividendology Any update on this? Can't get the book value per share to turn up, XPath appears broken/weird
@iamnomadgg
3 ай бұрын
Any update on this? @@Dividendology
Please make a full spreadsheet stock trading automation course it will be helpful
Very interesting
Many thanks for your video, It doesnt seems to work at my computer. He is giving an error ''imported content is empty'' (translated from Dutch) . Any idea what I might have done wrong ?
@Dividendology
2 жыл бұрын
Hi Michael, what were you trying to webscrape from yahoo finance? Some metrics may be slightly different.
@michaeldhont3805
2 жыл бұрын
@@Dividendology Thanx for your reaction. I would like to have for example Forward Dividend & Yield and some data from the statistics like Return on Assets, Totall cash etc etc.
@Dividendology
2 жыл бұрын
One thing I recommend is to watch my web scraping in google sheets video. I show how to web scrape data from Finviz, where it is extremely easy to pull in all of the things you just mentioned into google sheets.
@michaeldhont3805
2 жыл бұрын
@@Dividendology thnx, I will take a look at that.
Hey man ! Do you know how to have the "Full XPath" options in the copy options...? When i'm at this step, I only have: HTML, XPath for choice...
@Dividendology
2 жыл бұрын
I haven't run into that problem before. I'll have to look into it.
@jeremiethompson7798
2 жыл бұрын
@@Dividendology thanks for the answer !! It looks like my mac don’t offer me the option of Full Xpath… I am looking on internet but find nothing
@baalzhamon8491
2 жыл бұрын
I have to use microsoft edge instead of firefox due to this
@bobkoss280
2 жыл бұрын
I got that in Firefox. I switched to Chrome and now see "full xpath"
Will repeat myself here. To anyone wandering why IMPORTXML does not work for all xpaths (for example data from statistics or financials tab). The IMPORTXML only works for webpage content which is statically generated, but unfortunately most of the data in yahoo finance is dynamically generated. In this case, the whole process becomes a bit more complex. I have managed to get it working with python (+selenium) script. I made a simple video about it here kzread.info/dash/bejne/gJmhxLehddbRZ9o.html , but if you want to get everything working some coding knowledge is unfortunately needed.
@tinifigueroa7266
7 ай бұрын
Yeaaah I have just seen your video! In addition thanks to @dividendology for this great video too :)
@eloiwallaert2630
2 ай бұрын
Hello sir, your link is not working. It said that the video is private. How can I watch it please ? Thank you for your answer
Hello, seens doesn't work for tickers with "." in URL ;/
Data shows up then vanished, How to solved it? Thanks in advance.
it doesnt work after i change it to update it to differnt stocks also "," is replaced with ";"
First of all thanks for sharing this video, a question, is the data updated on real time from Yahoo finance? Thank you so much
@Dividendology
Жыл бұрын
Google sheets periodically updates automatically.
@philloes2778
5 ай бұрын
@@Dividendology Do you know how to update it manually? If I want all cells to update right now?
to implement shares in Indonesia?
Hi, The coding doesn't work for UK stocks for example, Airtel africa, etc. Please help me how to bring UK stocks details in google sheet
@BetasCoin
Жыл бұрын
Instead of pulling data using htmlimport, then you can pull all data on Yahoo Finance using the fact that it is build on Javascript. I just made a video showcasing my version of this if you need. kzread.info/dash/bejne/f3WdmJSHY7mXeJc.html
Hi I got a problem with your function, is someone able to help me?
Data not found even if I copy the same code
can we find the float on that google sheet?
For those having issues with the Industry Column coming up #Error. Make sure there are not extra Quotation Marks at the end of your input.. thats what was causing my error
@filippoghezzi654
Жыл бұрын
I checked the question marks but they are correct. Still getting the error message
@FabsBlog07
3 ай бұрын
@@filippoghezzi654 me too have you guys figured this out?
Doesn't work now for me. I typed in exactly like this video says. I get the "resource at url not found" I wished this worked.
So my data is converted to "xx.xx.xx", basically date. How do i get the string from the website (the stock price) to be a number in my sheet?
This doesn't work anymore
@elizastefanescu5390
4 ай бұрын
Hi! It works but you need to use ; instead of , and will work properly.
@m.anandakumar9065
3 ай бұрын
How
@amanjaelani
2 ай бұрын
Still worked
@m.anandakumar9065
2 ай бұрын
@@amanjaelani send the code
I have some problems with the last step, when I try to change the Ticker I get an error . In Dutch "parseerfout in formule" parsing error in formula . Any idea what it means or how I can solve it. Many thanks
@Dividendology
Жыл бұрын
may be an error on yahoo finance's end. Some people have been having trouble lately.
@michaeldhont3805
Жыл бұрын
@@Dividendology I can finaly scrape data from yahoo finance, so thank your for this tutorial. One more question , I only can retrieve data from the Summary, any idea what this can be? thnks
Hi sir, is not working anymore I think, at least for me the formula now shows an #ERROR! 😢
Does this not work with Options Data ?
I am using a MacBook and try to double click on the areas and all I get is the area highlighted I try and do "control" and click and get options but I do not see an "inspect" option. What am I doing wrong.... please help
@jayedsheath
8 ай бұрын
Getting the same problem. Have you fix it?
It seems to be that it doesn't work anymore. It always says that the imported data is empthy. Any update in 2024? Thanks
@Dividendology
2 ай бұрын
Yep! Here's the updates video: kzread.info/dash/bejne/k45txNKOpczVYbw.html
Im getting an error pulling "Growing Estimates, Next 5 Years (per annum)". Does anyone know how to solve it?
@rayli6640
Жыл бұрын
I am facing the same problem either
This no longer seems to be working.
sorry, i can't get the date and dividends... Historical Data > dividends only > Time Period (Max)
I'm getting information from 2 days ago ???
Doesn't work anymore, it seems that Yahoo Finance website could be using any Java formating. There is an error now in Google Sheets "Imported content is empty" when you do what you are doing when taking the earnings date (You cant really do much anymore).
@Dividendology
7 ай бұрын
Working on an update
@usmleibm
6 ай бұрын
Did you find any solution? Thanks@@Dividendology
Seeing a lot of ‘Resource at URL not found’ - despite their obviously being available values for things like price. It seems to happen mainly for smaller cap companies. At first I thought it was an issue with an exchange extension, in my case .L for LSE companies, but then I got it to work for BP. So I can get it work, and am repeating the exact process for other companies with no success. Helpful video nonetheless, thank you!
@umair5807
9 ай бұрын
I am facing the same issue. Have you got any solution for this error?
How to pull data from balance sheet in yahoo finance?
@Dividendology
2 жыл бұрын
I am currently searching for a way to do this.
Dosent work on any other then american stocks
Good
Its not working, I'm sure its a user error, but what could it be?
It works except the price doesn't fluctuate like on Yahoo Finance! and I refreshed like 6 times.
@ICTARABIC
Жыл бұрын
updates every 1 minute in settings
I get the error "Could not fetch url..." I'm copying and pasting the url, but don't know what to do.
@filippoghezzi654
Жыл бұрын
Found a solution?
@ElioG
Жыл бұрын
@@filippoghezzi654 no unfortunately.
Has anyone tried scraping from YH "Statistics" or "Financials" sections? I have tried using both IMPORTHTML and IMPORTXML but non of them seem to work other than the homepage (summary) section.
@rohitsethi2627
Жыл бұрын
Same for me, only working on Summary section, not on Satistics
@dbarrantescr
Жыл бұрын
@@rohitsethi2627 I tried about everything I could think of but didn't manage to make it work. If anyone knows please let us know!
Sadly not working
I did same thing but my result is #N/A I dunno why. I even copy your formula and paste it. It does not work anymore I think. (((
@AE-sy1pn
8 ай бұрын
same thing is happening to me
I hold BDT, CM & CP to name a few that I am having issues with dividend dates. Can anybody suggest a fix or know a video to correct issue?
@Dividendology
Жыл бұрын
I’m working on creating a custom solution with a developer!
@erickrgarcia
Жыл бұрын
@Dividendology thank you replying back. Look forward to the video.
TE AMO VIEJAA!!!
Anyone knows how to get other data like FCF or shares outstanding in google sheets? seems like The data down below isnt accessable for google sheets. Didnt work for me!
@Dividendology
Жыл бұрын
I’m working on a solution for this!
@thomaskreisel5764
Жыл бұрын
@@Dividendology Sounds good! I would like to have an intrinsic calue calculator, where you just have to change the ticker to get the intrinsic value of a stock. That would be great! Please let me know how if you figured something out!
@Dividendology
Жыл бұрын
Yep, thats actually something Im trying to work on. It may take some time, but I'll find a way to make it happen.
@thomaskreisel5764
Жыл бұрын
@@Dividendology I found this intrinsic value calculator in google. I tried to copy it into my spread sheet. But for some numbers like FCF he is using a formula which I dont understand how it works. Its something like "=Data!....". Maybe you check this out and find it helpful!
I feel like I'm being given the keys to the internet.
@Dividendology
Жыл бұрын
🔑
Doesn't work any more. Finance recently went through a big change. Hope this can be updated to work!
@Dividendology
Жыл бұрын
Working on a custom solution that won’t break :)
Its not working for me :(
I think that is no longer working. I am doing the exact same thing as you, and it is not working for me.
@jayedsheath
8 ай бұрын
Have you been able to fix it? Im getting the same error
not working for stock code with dot or foregin stocks
@Dividendology
7 ай бұрын
working on an update for this
@radomillion
6 ай бұрын
@@Dividendology Have you found an update yet for foreign stocks?
unfortunately it does not work, do you have another solution? Thanks
@WinterKing2811
2 жыл бұрын
Mine not working as well. Something related to google blocking importxml i believe...
@Dividendology
2 жыл бұрын
I’m surprised it’s not working for you, as I haven’t had any problems. Are you receiving an error message?
@soumya178
2 жыл бұрын
@@Dividendology yes it's showing #NA
@XInfinity2024
Жыл бұрын
@@soumya178 That is the same error that I have been getting
Anyone notice in this video that yahoo is displaying $315.41, but when he imports it, spreadsheet has $313.86?
It doesn't work to me! I can't understand why. I copy everything in the same way. What's wrong?
@Dividendology
9 ай бұрын
They may have changed their website out look. I'm working on an update.
@claudiocaiti138
9 ай бұрын
@@Dividendology Thank you
The price doesnt change when it changes on yahoo finance it just stays the same
@Dividendology
Жыл бұрын
Google sheets will update periodically. Typically around every 20 minutes
For those with a Spanish keyboard, be advise to separate arguments with semicolon (;) and not with commas (,), otherwise it doesnt work....😩
@Dividendology
Жыл бұрын
thank you!!
@FinanzasSinCorbata
Жыл бұрын
@@Dividendology You are most welcome, your work is great. Thank you!
Doesn't for me.
not wroking
Anyone else getting "Imported content is empty" when trying this?
@Dividendology
Жыл бұрын
I'm creating a new method to do this. Stay tuned!
Did Yahoo Finance ban web scraping in Google Sheets? I followed the tutorial but I cannot retrieve any data from Yahoo finance. I can retrieve data from Finviz and seeking alpha though.
@Dividendology
Жыл бұрын
I've had some trouble scraping from Yahoo finance lately as well. Im creating a new solution for this!
@rayli6640
Жыл бұрын
@@Dividendology ok, I am not alone😂
Get #ERROR! formula parse error?
@Dividendology
10 ай бұрын
I’m working on an update!!
Somehow it does not work. Probably Yahoo has introduced a problem.
@radomillion
5 ай бұрын
Which exchange and company stock price do you want?
@daronchau8820
4 ай бұрын
most companies prevent webscraping via importxml or any import function via googlesheet. This no longer works because mostwebsites use java and google sheets cant pull/read stuff coded in java
this does not work
It's obvious that
Great video and explanation.
Anyone getting "Resource at URL not found" I fixed it by deleting UK from the yahoo web address.
@KrekreDoBusao
11 ай бұрын
Check if your separator is semi-colon instead of comma. European separator is normally not the same as the US ones. I fixed that simply by changed the , to ;
doesn't work with yahoo, only works with finviz
@Dividendology
Жыл бұрын
Im working on a new custom solution!
Non funziona purtroppo. Grazie lo stesso.
No longer works.
@Dividendology
Жыл бұрын
I’m working on a new solution
@rebym
Жыл бұрын
@@Dividendology So why waste everyone's time? Pin a comment that says that it no longer works!
I keep getting that darn 'Resource not found at url" again. >:(
@Dividendology
2 жыл бұрын
Yahoo finance has been a little ‘hit or miss’ lately. I’m looking into other webscraping options currently.
@Daddywaah
2 жыл бұрын
@@Dividendology Cheers for that Div, I appreciate the reply so I can stop scratching my head for now. I'm just glad I wasn't screwing something up. :)
@danb7146
Жыл бұрын
@@Dividendology Have you figured out why importxml and importhtml won't work a good amount of time with Yahoo Finance?
Lol
This is not scalable.
@Dividendology
Жыл бұрын
I’m working on a new solution! :)
This explanation and others suck as a step, a crucial step is being left out.
For those who receives #N/A or stay at "Loading.."; you need to check first url. you need to remove last part of url. it should be like this; ".../quote/MSFT/?p", not like this; ".../quote/MSFT/?p=MSFT"
@danb7146
Жыл бұрын
Even this doesn't work on a lot of tickers. I find both the importxml and importhtml to be highly unstable trying to get data from Yahoo Finance. Wish I knew a better way or how to fix. BLV is an example. I have a number of others that won't work.
It doesnt work. SXR.DE. When dot (.) in ticker, it doesnt work.
@AwesomeShrader
Жыл бұрын
can confirm :(
@BetasCoin
Жыл бұрын
Instead of pulling data using htmlimport, then you can pull all data on Yahoo Finance using the fact that it is build on Javascript. I just made a video showcasing my version of this if you need. kzread.info/dash/bejne/f3WdmJSHY7mXeJc.html This works for ALL Stocks from ALL stock exchanges