Google Sheets Domain Tracker: Simple API Setup

Michael Cyger August 28, 2025 (Updated: September 1, 2025) 4 min read

Want a hassle-free way to collect all your domain registrations in a single spreadsheet?

Easily centralize and review your domain name portfolio in a Google Sheets template.

Follow this step-by-step guide to duplicate the sheet, add your Nerve.io API credentials, and refresh your portfolio with instant, automatic domain updates.

Step 1 — Get the Google Sheet Template

  1. Click here to open the template:
    📄 Open Google Sheets Domain Tracker Template
  2. In the menu, go to File → Make a copy.
  3. Save it with your own name (e.g., “My Domain Portfolio”).
  4. Your copied sheet will already have two tabs:
    Domains → where data will be displayed.
    Setup → for your credentials.

Step 2 — Fill in Setup Sheet Values

At the bottom of the window tab, you’ll find a sheet named Setup. Click it.

Setup Sheet

In the Setup sheet, replace key and pwd with your real credentials from your account’s Access Keys that include the registrars you desire.

A (Label) B (Value)
X-Nerve-Access-Key key
X-Nerve-Password pwd

Step 3 — Add the Apps Script

Note: You’ll only need to do this step once, the first time you run it.

In order to skip all of the scare code warnings about using a Sheet with code already installed, you’re going to follow a few simple steps to add the Apps Script.

  1. In Google Sheets, go to Extensions → Apps Script.
    This will open Apps Script in a new browser tab.
  2. In the Apps Script editor, delete any existing code you see.
  3. Copy the code provided below and paste it into the editor.
    Tip: You can review and fully inspect the code before using it to confirm it is safe and does only what you expect.
  4. Save your changes (Command + S on Mac or Ctrl + S on Windows).
  5. Close the Apps Script tab and return to your spreadsheet.
function fetchDomainData() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var setupSheet = ss.getSheetByName("Setup / Run");
  var domainSheet = ss.getSheetByName("Domains");

  // Always switch to the "Domains" sheet immediately (ensures UI focus)
  ss.setActiveSheet(domainSheet);

  // Get API credentials
  var apiKey = setupSheet.getRange("B1").getValue();
  var apiPwd = setupSheet.getRange("B2").getValue();

  // API request
  var url = "https://api.nerve.io/v1/domains?full=1";
  var options = {
    method: "GET",
    headers: {
      "X-Nerve-Access-Key": apiKey,
      "X-Nerve-Password": apiPwd
    },
    muteHttpExceptions: true
  };

  // Fetch data
  var response = UrlFetchApp.fetch(url, options);
  var data = JSON.parse(response.getContentText());

  // Prepare to clear (remove all old data, including headers)
  domainSheet.clearContents();

  if (data.result && Array.isArray(data.result)) {
    // Determine the maximum number of nameservers
    var maxNameservers = 0;
    data.result.forEach(function(item) {
      var nsCount = (item.nameservers || []).length;
      if (nsCount > maxNameservers) {
        maxNameservers = nsCount;
      }
    });

    // Prepare new headers (columns order must match your spreadsheet)
    var headers = [
      "Domain",
      "Registrar",
      "Created",
      "Expires",
      "Status",
      "Locked"
    ];
    for (var i = 0; i < maxNameservers; i++) {
      headers.push("Nameserver " + (i + 1));
    }
    domainSheet.appendRow(headers);

    // Append data rows
    data.result.forEach(function(item) {
      var row = [
        item.domain || "",
        item.registrar || "",
        item.created || "",    // use .created: adjust if API is different
        item.expires || "",    // use .expires: adjust if API is different
        item.status || "",
        item.locked !== undefined ? String(item.locked) : ""
      ];
      var nsArray = item.nameservers || [];
      for (var j = 0; j < maxNameservers; j++) {
        row.push(nsArray[j] || "");
      }
      domainSheet.appendRow(row);
    });
  } else {
    domainSheet.appendRow(["No domain data found or API error"]);
  }
}

Step 4 — Press the “Run” Button

The template includes a “Run” button on the Setup sheet. Press it to start your sheet.

Note: You'll only need to authorize it following the instructions below the first time you run it.

You will be required to authorize the script that you just pased, click "OK":
Authorize Google Sheets

Choose your Google account to associate the Sheet with:
Choose an account

Google will tell you that it hasn't verified this app (the code you've pasted), so you need to click "Show Advanced" (where the graphic below shows "Hide Advanced"), and then click on the "Go to Untitled project (unsafe)" link:
Google hasn't verified this app

The final approval will require you to click the "Select all" checkbox, then click the "Continue" button on the bottom of the page:
Untitled project wants access to your Google Account

It will update the Domains sheet in real time, operating at about 30 seconds per 100 domain names. Google Sheets scripting isn't the fastest.


Step 5 — Optional Automation

After authorization, you can make the sheet update automatically:

  1. Go to Extensions → Apps Script.
  2. Click Triggers in the left panel.
  3. Add a Trigger for fetchDomainData → choose “Time-driven” → set your preferred interval (hourly, daily, weekly).

Use an AI assistant like ChatGPT, Claude or Perplexity to modify your code to accomplish anything you can think of like a dashboard sheet with "days until expiry," automatic color‑coded alerts, and summary metrics like total domains and those expiring soon.