How to get historical data from Yahoo's CSV API? - yahoo-finance

I'm rather new at this so I'm not sure if I'm doing anything wrong. So I was trying to get some historical data and online it said I should be able to import it from http://ichart.finance.yahoo.com/table.csv?s= [insert ticker symbol] as show here: http://thesimplesynthesis.com/article/finance-apis#yahoo-csv-finance-api. However when I tried to click the link using any ticker symbol just to make sure it works, I keep getting this

Related

Using IMPORTXML in Google Sheets to scrape data from Transfermarkt

I'm trying to see if it's possible to scrape data from Transfermarkt.com to import into a Google Sheets doc.
Currently, I'm trying to import the team data from a player's profile page (see example URL here: https://www.transfermarkt.co.uk/joao-palhinha/profil/spieler/257455) but in future may want to import other data as well.
I wonder if it's possible to scrape data in this way from Transfermarkt, but if it is, any advice on what I'm doing wrong would be very much appreciated!
Right now I'm using, =IMPORTXML(B1,"/html/body/div[3]/main/header/div[4]/div/span[1]/a") where the URL is in B1. I copied the Full XPath from the HTML, but have also tried this by copying just the XPath too.
It says Loading for a few seconds before returning N/A, with an error message 'Resource at URL not found'.
I'm expecting the result in this instance to be Fulham.
Thanks

Get historical stock price from investing.com to google sheets [duplicate]

This question already has answers here:
Scraping data to Google Sheets from a website that uses JavaScript
(2 answers)
Closed last month.
Looking for a way to get the stock price for a specific date (eg. 31.1.2020).
I know I can use IMPORTHTML or IMPORTXML together with INDEX to get the table. However, when I use the browser to search for a specific date on investing.com, there's no direct URL for the date, and it rather presents me with the latest stock prices instead. This is the stock I'm looking for
I'm afraid that investing.com do not provide an API
https://www.investing-support.com/hc/en-us/articles/115005473825-Do-you-provide-an-API-
So you won't be able to do this very easily (if at all) with Google Sheets or Apps Script. The reason is that it looks like most of the content on the site is generated with JavaScript, and so it is not part of the original HTML that is shown when you first enter the site. The HTML is what IMPORTHTML gets.
To get the information you are looking for without using and API, would involve browser automation. That is, simulate the clicks that a user might make and then get the data. This can be very finicky and is prone to break whenever the website changes its layout or HTML for whatever reason (something that tends to happen quite often for busy websites).
I would recommend using a different service that has a Sheets friendly HTML format. Better than that, I would look into a service that has an API and interact with it with Apps Script. Finally, if you need it to be investing.com you could look into something like Puppeteer which can automate a browser (though its a fair bit more complex than a formula or an API).
You can import using importhtml the historical data for the last 30 days, and then use a lookup for that data.
To get historical data I use:
query(IMPORTHTML("https://investing.com/equities/STOCK-historical-data"; "table"; 2);"SELECT Col1, Col2")
I don't know if you can import more than 30, I'm searching for that answer myself.

How to Get A Company Financials in to Google Sheets

I am trying to get a specific value from a public company's balance sheet into Google Spreadsheet to better analyze the company financials. I want to add the ticker in one of the cells and via a formula, I will get the Total Current Assets for example.
Is there a way to it?
The main issue is that the data is populated after the page is being rendered, so even if I use the IMPORTHTML and set the right XPath I am getting Imported content is empty. It because the value is since it is being fetched on the on a later script.
I found this service which provides the company's financials in a JSON and CSV formats, but I dont know how to parse it on the googlesheet.
Should be something that someone already solved.
Thanks

get spreadsheet URL

I have a problem in my reporting, i create every day a google doc tracker where all the stack holders in my department update their work progress in it, so i have plenty of spreadsheets to monitor which is a hassle, here is what im trying to do, I'm trying to create a big google doc tracker where i can have an access over date applied in the normal spreadsheets, all what i need is the spreadsheet's URLs that exist in my google drive to be retrieved in this big tracker, with this i'll be able to drive all the needed data from the normal trackers.
PS: I'm not good with google scripts.
You can use the Drive Service to get a list of files with MIME type "application/vnd.google-apps.spreadsheet" using getFilesByType. This returns a FileIterator, which you can use to individually get each Spreadsheet file. From there, just use getUrl() to find the URL's. The FileIterator link has examples of how to loop through all the matching files.

Getting information from Yahoo! finance

I'm trying to get data about currency exchange from Yahoo! finance in the csv format.
E.g. there is a lot of information in this page, but when I'm downloading csv file over the url there is no such data as Change, Bid, Ask, Prev Close, Open, etc. There is "N/A" values instead them.
How can I get complete information from relevant page?
I suggest that you use Yql. This thread provides an example: Help creating a YQL Query to search companies

Resources