Getting Tokyo stock price data to appear on Google spreadsheet
Asked Answered
G

4

5

I have no problem retrieving price data of US stocks. For example, to retrieve Apple price data, this formula =GOOGLEFINANCE("AAPL","changepct")/100 works fine. When I tried to retrieve Tokyo stocks price data, this formula GOOGLEFINANCE("TYO:1969","changepct")/100 cannot work. Both formulas look similar. I cannot figure out why. Is it because Tokyo stocks are not supported by Google Finance?

Gaudette answered 1/5, 2015 at 4:31 Comment(5)
=GOOGLEFINANCE("TYO","changepct")/100 seems to workTransalpine
Unfortunately, TYO is listed in the US exchange, not Tokyo.Gaudette
support.google.com/docs/answer/3093281?hl=en-US says "GOOGLEFINANCE is only available in English and does not support most international exchanges"Transalpine
Actually, it support most international exchanges so far except Tokyo so far from my experience. I was hoping I made some mistake.Gaudette
it's a shame, actually. I've heard that old google spreadsheets could support tokyo stocksTransalpine
P
9

Is it because Tokyo stocks are not supported by Google Finance?

Yes.

Try and the error message presently includes:

When evaluating GOOGLEFINANCE, Google Spreadsheets is not authorised to access data for exchange: 'TYO'

Pluri answered 23/12, 2018 at 14:36 Comment(0)
J
2

My solution: Scrape the price from Google Finance website.

=IMPORTXML("https://www.google.com/finance/quote/1969:TYO","//div[@class='YMlKec fxKbKc']")

This will give you "¥1,570.00". If you want to convert it to a number use the below:

=VALUE(REGEXREPLACE(IMPORTXML("https://www.google.com/finance/quote/1969:TYO","//div[@class='YMlKec fxKbKc']"), "[¥]", ""))
Johniejohnna answered 17/5, 2022 at 13:4 Comment(0)
D
1

pls using yahoo fiance, using sheets extension func

function yahooF(ticker) {

 const url = `https://finance.yahoo.com/quote/${ticker}?p=${ticker}`;

 const res = UrlFetchApp.fetch(url, {muteHttpExceptions: true});

 const contentText = res.getContentText();

 const price = contentText.match(/<fin-streamer(?:.*?)active="">(\d+[,]?[\d\.]+?)<\/fin-streamer>/);  console.log(price[1]);  return price[1];

}

https://www.lido.app/tutorials/yahoo-finance-google-sheets

Destruct answered 10/9, 2023 at 12:44 Comment(0)
P
-1

A simple solution is to use the German stock exchanges and convert the euro rates to dollars or yen with googlefinance. So for example: DIP for KDDI

Paluas answered 11/2, 2022 at 11:59 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Helping

© 2022 - 2024 — McMap. All rights reserved.