API works for simple company names, but fails for longer name in google sheet. How to fix? [closed]

Subject: Help Needed: API Doesn’t Fetch Domain for Complex Company Names

Hi everyone,

I recently watched a video (https://www.youtube.com/watch?v=M7N_tBcwEDI) where the API works well for company names that consist of one or two words, like “Google” or “IBM.” However, for more complex names, such as those including “Pvt Ltd” or longer company names, it fails to find the domain, even though Google search can easily find it.

Could someone kindly suggest the necessary changes to the API to handle more complex company names effectively?

Thanks in advance for your help!

IN Google sheet:
Cell A2 has Company name

In the App Script:

const base_url_clearbit = "https://autocomplete.clearbit.com/v1/companies/";

function clearbit_getDomain(name) {
  var suggest_url = base_url_clearbit + 'suggest?query=' + name;
  var suggest_response = UrlFetchApp.fetch(suggest_url);
  var suggest_response_text = JSON.parse(suggest_response.getContentText());
  var domain = suggest_response_text[0]['domain'];
  return domain;
}

in the google sheet cell C2:

=clearbit_getDomain(A2)

Kindly amend the coding of API to get the required result