JavaScript / Google Apps Script – Using multiple URLS to fetch API JSON Data

I’m currently trying to program a bit of code in Google Apps Script that catalogues item pricing data for an MMORPG by connecting to an API. I’ve managed to cobble up some code (shown below) that successfully does this for a single item, but I’ve hit a roadblock with getting it to work for a range of cells in order to cover every item on the spreadsheet.

Essentially, what I need this to do, is grab a series of itemIDs in a defined range (ie. D8:D24), query the API for each of those entries by appending each itemID into the URL, and then properly display it in the adjacent “F” column for each item.

Admittedly I’ve never coded with JavaScript before and even getting this far took me some learnin’. I think what I might need is a Promise.all() to query the API multiple times and put those results in an array, but I have no clue how to go about that and adapt that to my existing code.

Any help with this would be greatly appreciated. Thank you.

function getPrices() {
  
  const url = "https://universalis.app/api/v2/world/"

  if (SpreadsheetApp.getActiveSheet().getName() == 'Boss Weapons') {
    let sheet = SpreadsheetApp.getActiveSheet();
    let itemID = [];
    itemID.push(sheet.getRange('D8').getValue());

    let request = url + itemID + "?listings=0&entries=0"
    let response = UrlFetchApp.fetch(request);
    let data = JSON.parse(response.getContentText());

    let itemData = [];
    itemData.push(data.minPrice); 
  
    let item = [];
    item.push(itemData);

    let targetRange = sheet.getRange('F8');
    targetRange.setValue(item);
  }
}