I want to understand how can i run a google app-script to extract information of schools in a certain state : Im trying to create a data base for all the school in a certain state. I have written a google app-script that pulls the details of a school and inserts it in a spreadsheet. The problem is that I want to automate the process of changing the name of the school in the url based on the ones I have.

I have looking also for to extract the place_id based on a Lat and Long and with type=school but is not working, only pulls 20 schools

    function onOpen() {
    var ui = SpreadsheetApp.getUi();
  

    ui.createMenu('Google Place Search')
          .addItem('Buscar Informacion','callgooglemapsapi')
          .addToUi();
    }
    function callgooglemapsapi() 
    {
      
      var response = UrlFetchApp.fetch("https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=El%20Colegio%20de%20Tamaulipas&inputtype=textquery&fields=formatted_address,type,place_id,geometry,icon,id,name,permanently_closed,photos,place_id,plus_code,user_ratings_total&key=AIzaSyDQlB5xlLhSQZhdIkBGR0WXiWPLVqMwKkM");
      // Parse the JSON reply
      var json = response.getContentText();
      var data = JSON.parse(json);
        
      Logger.log(data);
      Logger.log(data["candidates"]);
      Logger.log(data["candidates"][0]);
      var sheet = SpreadsheetApp.getActiveSheet();
      sheet.getRange(sheet.getLastRow() + 1,1).setValue(data["candidates"][0]["name"]);
      sheet.getRange(sheet.getLastRow() + 0,2).setValue(data["candidates"][0]["formatted_address"]);
      sheet.getRange(sheet.getLastRow() + 0,3).setValue(data["candidates"][0]["geometry"]["location"]["lng"]);
      sheet.getRange(sheet.getLastRow() + 0,4).setValue(data["candidates"][0]["geometry"]["location"]["lat"]);
      sheet.getRange(sheet.getLastRow() + 0,5).setValue(data["candidates"][0]["geometry"]["viewport"]["southwest"]["lng"]);
      sheet.getRange(sheet.getLastRow() + 0,6).setValue(data["candidates"][0]["geometry"]["viewport"]["southwest"]["lat"]);
      sheet.getRange(sheet.getLastRow() + 0,7).setValue(data["candidates"][0]["geometry"]["viewport"]["northeast"]["lng"]);
      sheet.getRange(sheet.getLastRow() + 0,8).setValue(data["candidates"][0]["geometry"]["viewport"]["northeast"]["lat"]);
      sheet.getRange(sheet.getLastRow() + 0,9).setValue(data["candidates"][0]["place_id"]);
      sheet.getRange(sheet.getLastRow() + 0,10).setValue(data["candidates"][0]["photo_reference"]);
      sheet.getRange(sheet.getLastRow() + 0,11).setValue(data["candidates"][0]["plus_code"]);
      sheet.getRange(sheet.getLastRow() + 0,12).setValue(data["candidates"][0]["types"]);

I expect to extrat the detail information and photos and insert them to a spreadsheet, I have 4,000 school names.
