-
-
Save ubuntupunk/4e7bd5b5433ab928998f084144a59fa1 to your computer and use it in GitHub Desktop.
Google script to fetch stock quote data from Yahoo Finance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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