Advanced Search API Not Working Using Javascript

I am trying to access the advanced search from front end Javascript fetch(). This call works for all endpoints I have tried apart from the advanced search endpoint. Here is the code.

var url = '';

    var headers = new Headers({
      Authorization: "Basic " + btoa(API_KEY + ':'),
      "Content-Type": "text/json",

    var obj = {
      mode: "cors",
      method: "GET",
      cache: "no-cache",
      headers: headers,

    fetch(url, obj)
      .then((resp) => resp.json())
      .then((data) => console.log(data))
      .catch(function(err) {

This code works for most endpoints for example ‘’.

However when calling the ‘’ endpoint I get a CORS error. However it isn’t a 401.

I have whitelisted my domain on my REST API key and there are no IP restrictions and as I say the authorization works for other endpoints so I’m not sure what I am missing here.

Does the advanced search have a different authorization method than the other endpoints. All endpoints work when performing the calls through Postman.

Many thanks