简体   繁体   中英

Google sheet and Script editor under debug returns different resut

I am using Google Sheet to retrieve information from Alpha Vantage. If I run the below code under debug and inspect variable v, v has the data that I want.

If I call the function in a sheet, it return "Thank you for using Alpha Vantage. Our standard API call frequency is 5 calls per minute and 500 calls per day...." which imply that I have called function more often than I am allowed to.

I have tried this multiple times. I always get the right results in debug and wrong result in the sheet. Any suggestion?

function AVFunction()
{
  var func="OVERVIEW"
    var query="AAPL"  
    var v= AVImportJSON(func,query,"");
    return v;  // <-breakpoint
}

AVImportJSON is a wrap that eventually uses the code from http://blog.fastfedora.com/projects/import-json

Edit: There is only one cell that call the function.

It appears that Google Sheet would call a function multiple time. With a call limit of 5 calls per min, using function in Google Sheet to access Alpha Vantage does not seems to be a good solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM