Google Sheets + Gemini

Custom functions to query Professional datasets directly in Sheets

Prerequisites

  • Google Workspace account
  • Verilex Professional API key (get one here)

Step 1: Add custom functions via Apps Script

Open your Google Sheet, go to Extensions → Apps Script, and paste this code:

// Verilex Professional — Google Sheets custom functions
// Replace YOUR_KEY with your actual API key

const VERILEX_KEY = "pro_YOUR_KEY_HERE";
const VERILEX_API = "https://api.verilexdata.com";

function _verilexGet(path) {
  const r = UrlFetchApp.fetch(VERILEX_API + path, {
    headers: { Authorization: "Bearer " + VERILEX_KEY },
    muteHttpExceptions: true
  });
  return JSON.parse(r.getContentText());
}

/**
 * Look up a nonprofit by EIN. Returns name.
 * @param {string} ein The 9-digit EIN
 * @return {string} Organization name
 * @customfunction
 */
function VERILEX_NONPROFIT(ein) {
  const d = _verilexGet("/api/v1/pro/nonprofit?ein=" + ein);
  return d.data && d.data[0] ? d.data[0].name : "Not found";
}

/**
 * Look up nonprofit revenue by EIN.
 * @param {string} ein The 9-digit EIN
 * @return {number} Total revenue
 * @customfunction
 */
function VERILEX_NONPROFIT_REVENUE(ein) {
  const d = _verilexGet("/api/v1/pro/nonprofit?ein=" + ein);
  return d.data && d.data[0] ? d.data[0].revenue : 0;
}

/**
 * Verify an FDIC bank by name. Returns total assets.
 * @param {string} name Bank name
 * @return {number} Total assets
 * @customfunction
 */
function VERILEX_BANK_ASSETS(name) {
  const d = _verilexGet("/api/v1/pro/banks?name=" + encodeURIComponent(name));
  return d.data && d.data[0] ? d.data[0].total_assets : 0;
}

/**
 * Check SAM.gov vendor registration status.
 * @param {string} name Vendor legal name
 * @return {string} Registration status (ACTIVE/INACTIVE/EXPIRED)
 * @customfunction
 */
function VERILEX_SAM_STATUS(name) {
  const d = _verilexGet("/api/v1/pro/sam?name=" + encodeURIComponent(name));
  return d.data && d.data[0] ? d.data[0].registration_status : "Not found";
}

/**
 * Check if a person is in the Death Master File.
 * @param {string} lastName Last name
 * @param {string} firstName First name (optional)
 * @return {string} "DECEASED" or "NOT FOUND"
 * @customfunction
 */
function VERILEX_DMF_CHECK(lastName, firstName) {
  var url = "/api/v1/pro/dmf?last_name=" + encodeURIComponent(lastName);
  if (firstName) url += "&first_name=" + encodeURIComponent(firstName);
  const d = _verilexGet(url);
  return d.data && d.data.length > 0 ? "DECEASED" : "NOT FOUND";
}

Step 2: Use the functions in your sheet

After saving the script, use the custom functions just like any built-in formula:

Cell Formula Returns
B2=VERILEX_NONPROFIT(A2)Org name for EIN in A2
C2=VERILEX_NONPROFIT_REVENUE(A2)Revenue for that nonprofit
D2=VERILEX_BANK_ASSETS("Chase")Total assets for Chase
E2=VERILEX_SAM_STATUS(A2)ACTIVE / INACTIVE / EXPIRED
F2=VERILEX_DMF_CHECK(A2, B2)DECEASED or NOT FOUND

Using with Gemini in Sheets

If Gemini is enabled in your Workspace, you can ask it to use your custom functions:

"For each EIN in column A, use VERILEX_NONPROFIT to get the org name in column B and VERILEX_NONPROFIT_REVENUE in column C"

"Check if the names in column A are in the Death Master File using VERILEX_DMF_CHECK and put results in column D"

Apps Script rate limits

Google Apps Script has a UrlFetchApp quota of ~20,000 calls/day. For large lists, use the batch scrub endpoint (POST /api/v1/pro/dmf/scrub) from a script instead of one-cell-at-a-time formulas.

Stay in the loop

New datasets, features, and pricing changes. No spam.

How can we help?

Choose a category and tell us what you need.