Skip to content Skip to sidebar Skip to footer

Google Script For Alphavantage Gives Weird Results

I am trying to make a google script which i want to use in Google sheets. I followed a tutorial video on youtube and i had the idea that my script was working well. But then two st

Solution 1:

Try adding {validateHttpsCertificates: false} to your UrlFetchApp.fetch() to ignores any invalid certificates for HTTPS requests.

Your code should look like this:

functionapiav(a) {
  var res = UrlFetchApp.fetch('https://www.alphavantage.co/query?function=OVERVIEW&symbol=IBM&apikey=ABCDEFGH', {validateHttpsCertificates: false});
  var content = res.getContentText();
  var json = JSON.parse(content);
  var overviewvalue = json['EPS'];
  Logger.log(overviewvalue);
  return overviewvalue;
}

Output:

enter image description here

Reference:

UrlFetchApp

Post a Comment for "Google Script For Alphavantage Gives Weird Results"