Skip to main content

Overview

This guide walks you through automating contact enrichment in Google Sheets using the Lusha API. You’ll be able to send contact data in bulk, retrieve detailed information, and track the status of each enrichment request in real-time.
This guide uses the Lusha V3 API (/v3/contacts/search-and-enrich), which is the current recommended version. If you are still using the V2 script, see the Legacy V2 Script section at the bottom of this page.

How it Works

1. Create a New Google Sheet

Start by creating a new, blank Google Sheet. You’ll use this sheet to store and enrich contact data with the Lusha API. The required column headers will be added automatically after you complete the setup and refresh the sheet.

2. Add the Script to Google Sheet

Open the Script Editor

Go to Extensions > Apps Script in your Google Sheets file.

Paste the Script

In the script editor, paste the code below. If there’s any existing code, delete it before pasting.

Save the Script

Click the save icon or press Ctrl+S (Windows) / Cmd+S (Mac) to save.

3. Add Your API Key

I. Go to Project Settings (gear icon in the script editor). II. Under Script Properties, add a new property:
  • Key: api_key
  • Value: your actual Lusha API key
This keeps your API key secure and out of the main code.

4. Refresh the Spreadsheet

After saving the script and adding your API key, refresh the Google Sheets page. You’ll see a new menu option: Lusha Enrichment, and your sheet will automatically populate the required headers across rows 1-4:
  • Row 1: Status bar (enrichment progress and final stats)
  • Rows 2-3: Control panel (Reveal Emails, Reveal Phones, run/email/phone counts)
  • Row 4: Column headers
  • Row 5+: Your data
Input columns (A-G):
  • Column A: First Name
  • Column B: Last Name
  • Column C: Company Name
  • Column D: Company Domain
  • Column E: Email Address
  • Column F: LinkedIn URL
  • Column G: Lusha ID (stable Lusha contact ID from a previous run)

Control Panel

Before running enrichment, check the control panel in rows 2-3:
  • Reveal Emails (checkbox): Include email addresses in results. Checked by default.
  • Reveal Phones (checkbox): Include phone numbers in results. Checked by default.
If both checkboxes are unchecked, the script omits the reveal filter entirely and Lusha returns all available data. The control panel also tracks Total Runs, Total Emails, and Total Phones across all enrichment sessions.

Minimum Input Requirements

Each row must include at least one of the following:
  • Lusha ID (most precise - from a prior enrichment run)
  • LinkedIn URL
  • Email Address
  • Full Name (First + Last) and Company Name or Domain
Rows that don’t meet these requirements are automatically marked as Failed with a descriptive message.

Use the Script

The Lusha Enrichment menu provides:
  • Enrich All Contacts: Enriches every row with data, re-processing even previously successful rows.
  • Enrich From Specific Row: Prompts for a starting row number and enriches all rows from that point onward. Useful for resuming after an interruption or adding new rows.

Review and Analyze Results

Once enrichment is complete, results are written starting at Column H:
  • Column H (Status): Success, Could not find requested data, or a specific error message.
  • Columns I onward: Contact ID, name, emails, phones, job title, location, company, social links, previous employment, tags, and more.
The status bar in Row 1 updates in real-time and displays final counts for Success, No Data, and Failed.

Troubleshooting

  • Status shows Failed: Insufficient data: The row is missing a required identifier. Check that at least one of the combinations in Minimum Input Requirements is present.
  • Status shows Could not find requested data: Lusha processed the contact but found no matching record. Shown in orange.
  • Status shows ⚠️ Stopped: Out of Lusha credits: Enrichment halted due to no remaining credits. Add credits and use Enrich From Specific Row to resume from where it stopped.
  • API key errors: Confirm the key is correctly entered in Project Settings > Script Properties with the key name api_key.
  • Use Diagnose Contact Data: This tool (in the Lusha Enrichment menu) logs exactly what payload would be sent for a given row, helping you identify data issues before running enrichment.

Automate with Triggers (Optional)

To keep contact data continuously updated, you can set up a time-driven trigger:
  1. In the Apps Script editor, go to Triggers (clock icon in the left sidebar).
  2. Add a new trigger set to Time-driven.
  3. Choose your desired frequency (e.g., daily or weekly).
This runs enrichment automatically without manual intervention.

Legacy V2 Script

This script uses the Lusha V2 API (/v2/person), which is no longer the recommended version. New integrations should use the V3 script above. The V2 script is preserved here for teams that have not yet migrated.

Additional Resources

If you have any questions, feel free to reach out to the support team: