Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Google script to fetch stock quote data from Yahoo Finance
function YahooFinance(ticker) {
var ticker = ticker || "GOOG";
ticker = encodeURI(ticker);
var response = UrlFetchApp.fetch("https://query2.finance.yahoo.com/v7/finance/options/" + ticker);
var chain = JSON.parse(response.getContentText());
return parseFloat(chain.optionChain.result[0].quote.regularMarketPrice);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.