info@axonoid.com

Domain availability formula for Google Sheets

Domain availability formula for Google Sheets

A great name is a key step toward establishing your startup business or personal website.

You may begin with compiling a list of unique candidate names and perhaps check for the availability of your desired domain names.

Google Sheets allows you to create your own custom formulas via their Apps Script feature which you can use to automatically lookup domain names.

Here’s how:

1. Select the Tools menu and choose Script editor.

2. Replace the contents with the following JavaScript domain lookup function and save the file. This custom formula makes an API call that determines whether or not your domain is available. Feel free to change the top level domain (TLD) to suite your needs.

function checkDomain(input) {
  if(input.length){
    var domain = input.toLowerCase().trim()+".com";
    var res = UrlFetchApp.fetch("https://madchecker.com/domain/api/"+ domain);
    var content = res.getContentText();
    var json = JSON.parse(content);
    if(json.data.available == true){
      return 'Available ('+domain+')';
    }else if(json.data.available == false){
      return 'Taken ('+domain+')';
    }else{
      return 'Unknown';
    }
  }else{
     return '';    
  }
}

3. Go back to your spreadsheet and type in the new custom formula we just created.
For example:

=checkDomain(A2)

You can also add conditional formatting to highlight the available and taken domain names.