TypeError: UrlFetchApp.fetch(…).then is not a function

I am trying to make an API call from this website to my google sheet but getting this error. Can someone guide me in the right direction.

Thanks in advance

function myFunction() {

var myHeaders = {
     "Accept":"application/JSON, text/javascript, */*;q=0.01"
}; 

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

var response = UrlFetchApp.fetch("http://vixcentral.com/ajax_historical?n1=2023-10-17", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
  
}