Skip to content

Instantly share code, notes, and snippets.

@kpooooooooooo
kpooooooooooo / kpo_alpha_vantage
Last active April 16, 2019 06:40
KPO Alpha Vantage Guide
api_key = 'PASTE_YOUR_API_KEY_HERE'
url = 'https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol='
function getAlphaVantage(symbol) {
var response = UrlFetchApp.fetch(url + symbol + "&apikey=" + api_key).getContentText();
var data = JSON.parse(response);
var timeSeries = data["Time Series (Daily)"];
var value = 0.0;
for (var dates in timeSeries) {
value = timeSeries[dates]["4. close"];