Ok great! This is my code from Google Apps Script. But its not working to return only the live (or as close to live as possible) results. The problem could be with line 44 function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Custom Keepa API Menu')
.addItem('Get Data','pull\_asin')
.addToUi();
}

function pull\_asin(){
var linetostart = 2
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
//loop through every asin in the sheet
for(let i = 0; i < 100; i++){
var current\_asin = sheet.getRange(linetostart +i,2).getValue();
Logger.log("What is my current asin from the sheet?")
Logger.log(current\_asin);
var product\_response = productEndpoint(current\_asin)
var lastUpdate = product\_response['products']['lastUpdate']
console.log(product\_response)
//parse offers
offer\_response = product\_response['products'][0]['offers']
console.log(offer\_response)
if (offer\_response == null)
{
sheet.getRange(linetostart+i, 3).setValue('No offers info');

}
else{
length\_of\_offers = product\_response['products'][0]['offers'].length;
//length of offers
console.log("length of offers", length\_of\_offers)
var is\_a1selling = 'No'
var is\_a2selling = 'No'
for(let j = 0; j < length\_of\_offers; j++)
{
current\_offer\_object = offer\_response[j]
current\_seller\_id = current\_offer\_object['sellerId']
current\_last\_seen = current\_offer\_object['lastSeen']
//check if seller id is present
if (current\_seller\_id == 'A1NI0M2K3LNEWY' && current\_last\_seen - 300000 < lastUpdate)
{
 console.log("This seller is selling the item")
 is\_a1selling = 'Yes'
 sheet.getRange(linetostart+i, 3).setValue(is\_a1selling);
}
else{
 sheet.getRange(linetostart+i, 3).setValue(is\_a1selling);
}

}
}
//var buybox\_response = buyboxEndpoint(current\_asin)
//not working -> buybox\_response['buyBoxSellerIdHistory']
buybox\_history = product\_response['products'][0]['buyBoxSellerIdHistory']
if(buybox\_history == null){
sheet.getRange(linetostart+i, 4).setValue('No info');
}
else{
console.log(buybox\_history)
var includes\_a1;
includes\_a1 = buybox\_history.includes('A1NI0M2K3LNEWY')
console.log('includes\_a1', includes\_a1)
var is\_in\_buybox = 'No'
if(includes\_a1 === true){
is\_in\_buybox = 'Yes'
sheet.getRange(linetostart+i, 4).setValue(is\_in\_buybox);
}
else{
sheet.getRange(linetostart+i, 4).setValue(is\_in\_buybox);
}
}
}
}

function productEndpoint(asin){
var response = UrlFetchApp.fetch("https://api.keepa.com/product?key=fjg1vr6jg6ke9uua1teo4a7unedtrri9pfrvs212bt73c4sgmqv4la32edsdc3qm&domain=1&buybox=1&offers=100&asin=" + asin);
// Parse the JSON reply
var product\_response = response.getContentText();
return JSON.parse(product\_response);
}
function sellerEndpoint(asin){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var response = UrlFetchApp.fetch("https://api.keepa.com/seller?key=fjg1vr6jg6ke9uua1teo4a7unedtrri9pfrvs212bt73c4sgmqv4la32edsdc3qm&domain=1&seller=A1NI0M2K3LNEWY&storefront=1");
// Parse the JSON reply
var seller\_response = response.getContentText();
console.log(seller\_response);
return JSON.parse(product\_response);
}
좋아요! 이것은 Google 앱 스크립트의 제 코드입니다. 그러나 라이브 (또는 가능한 한 라이브에 가까운) 결과 만 반환하는 것은 작동하지 않습니다. 문제는 44 줄에 있을 수 있습니다. 함수 onOpen() {var ui = SpreadsheetApp.getUi();ui.createMenu('Custom Keepa API 메뉴').addItem('데이터 가져오기','pull\_asin').addToUi();}함수 pull\_asin(){var linetostart = 2var ss = 스프레드시트앱.getActiveSpreadsheet();var sheet = ss.getActiveSheet();//시트의 모든 아신을 반복합니다.for(let i = 0; i < 100; i++){var current\_asin = sheet.getRange(linetostart +i,2).getValue();Logger.log("시트에서 내 현재 asin은 얼마입니까?")Logger.log(current\_asin);var product\_response = productEndpoint(current\_asin)var lastUpdate = product\_response['products']['lastUpdate']콘솔.로그(제품\_응답)// 오퍼 분석offer\_response = product\_response['products'][0]['offers']console.log(offer\_response)if (offer\_response == null){sheet.getRange(linetostart+i, 3).setValue('오퍼 정보 없음');}else{length\_of\_offers = product\_response['products'][0]['offers'].length;// 오퍼의 길이console.log("오퍼 길이", length\_of\_offers)var is\_a1selling = '아니요'var is\_a2selling = 'No'for(let j = 0; j < length\_of\_offers; j++){current\_offer\_object = offer\_response[j]current\_seller\_id = current\_offer\_object['sellerId']current\_last\_seen = current\_offer\_object['lastSeen']//판매자 아이디가 있는지 확인if (current\_seller\_id == 'A1NI0M2K3LNEWY' && current\_last\_seen - 300000 < lastUpdate){ console.log("이 판매자가 상품을 판매하고 있습니다") is\_a1selling = '예' sheet.getRange(linetostart+i, 3).setValue(is\_a1selling);}else{ sheet.getRange(linetostart+i, 3).setValue(is\_a1selling);}}}//var buybox\_response = buyboxEndpoint(current\_asin)//작동하지 않음 -> buybox\_response['buyBoxSellerIdHistory']buybox\_history = product\_response['products'][0]['buyBoxSellerIdHistory']if(buybox\_history == null){sheet.getRange(linetostart+i, 4).setValue('정보 없음');}else{console.log(buybox\_history)var includes\_a1;includes\_a1 = buybox\_history.includes('A1NI0M2K3LNEWY')console.log('includes\_a1', includes\_a1)var is\_in\_buybox = '아니요'if(includes\_a1 === true){is\_in\_buybox = '예'sheet.getRange(linetostart+i, 4).setValue(is\_in\_buybox);}else{sheet.getRange(linetostart+i, 4).setValue(is\_in\_buybox);}}}}function productEndpoint(asin){var response = UrlFetchApp.fetch("https://api.keepa.com/product?key=fjg1vr6jg6ke9uua1teo4a7unedtrri9pfrvs212bt73c4sgmqv4la32edsdc3qm&domain=1&buybox=1&offers=100&asin=" + asin);// JSON 응답 파싱var product\_response = response.getContentText();반환 JSON.parse(product\_response);}함수 sellerEndpoint(asin){var ss = SpreadsheetApp.getActiveSpreadsheet();var sheet = ss.getActiveSheet();var response = UrlFetchApp.fetch("https://api.keepa.com/seller?key=fjg1vr6jg6ke9uua1teo4a7unedtrri9pfrvs212bt73c4sgmqv4la32edsdc3qm&domain=1&seller=A1NI0M2K3LNEWY&storefront=1");// JSON 응답 파싱var seller\_response = response.getContentText();콘솔.로그(판매자\_응답);return JSON.parse(product\_response);}