Overview
This guide walks you through automating your prospecting process by searching and enriching contact data directly in Google Sheets using the Lusha V3 API. With this setup, you’ll be able to populate a list of contacts based on specific filters, retrieve detailed contact data, and track enrichment progress efficiently.This guide uses the Lusha V3 API (
/v3/contacts/prospecting and /v3/contacts/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.Setup Instructions
Step 1: Create a Google Sheet
Create a new Google Sheet and name the tab “Sheet1”, or update theSHEET_NAME variable at the top of the script to match your tab name.
Step 2: Add the Script
- In your Google Sheet, go to Extensions > Apps Script.
- Delete any existing code in the editor.
- Paste the script below and click Save (Ctrl+S / Cmd+S).
Step 3: Add Your API Key
- In the Apps Script editor, go to Project Settings (gear icon).
- Under Script Properties, add a new property:
- Key:
api_key - Value: your actual Lusha API key
- Key:
Step 4: Customize Your Filters
Before running Search Contacts, update thepayload object inside populateContacts() to match your ICP. The template includes example filters for:
- Location: United States, New York
- Company size: 51-500 employees
Step 5: Refresh the Sheet and Run
Refresh your Google Sheet. You’ll see a Lusha Actions menu appear in the toolbar. When the sheet first loads, the script automatically sets up:- Rows 1-2: A dashboard with live counters for Total Contacts, Total Emails, Total Phones, and an estimated credit cost for the next enrichment run. Row 2 also shows the current page, last search/enrich timestamps, and the configurable Batch Size (default: 25).
- Row 3: A spacer row.
- Row 4: Column headers for all input and output fields.
- Row 5+: Your data.
- Custom (default): respects the per-row Enrich Email and Enrich Phone checkboxes.
- Enrich Only Emails: reveals emails for all rows, regardless of checkboxes.
- Enrich Only Phones: reveals phones for all rows, regardless of checkboxes.
Running the Script
Search Contacts
Click Lusha Actions > Search Contacts to populate the sheet with contacts matching your filters. Each run fetches one page of results (default: 25 contacts) and increments the page counter in A2 automatically, so successive runs pull the next page. Each contact is written to a new row starting at row 5, with:- Basic contact info in columns A-H
- Per-row Enrich Email and Enrich Phone checkboxes in columns K-L (both checked by default)
- Enriched status set to
Noin column M
Enrich Contacts
Click Lusha Actions > Enrich Contacts to retrieve full contact details for all rows where Enriched is not yetYes.
The script reads the per-row checkboxes and the Global Override setting to determine what to reveal for each contact, then groups rows into batches and sends them to the API. Results are written to columns N-AU. The Enriched column (M) updates to:
Yes(green) - enrichment succeededExcluded(grey) - both checkboxes were unchecked for that rowError: [code]- the API returned an error for that contact
Minimum Input Requirements for Enrichment
The enrich step uses the stable Contact ID (column J) populated by the search step. As long as Search Contacts ran successfully, no additional input is needed per row.Data Fields Returned
Core contact columns (A-M): First Name, Last Name, Full Name, Job Title, Company Name, Company Website, Has Work Email, Has Phones, Request ID, Contact ID, Enrich Email checkbox, Enrich Phone checkbox, Enriched status. Enrichment output columns (N-AU): Emails (up to 2) with type and confidence, Phones (up to 2) with type and Do Not Call flag, Job Title, Departments, Seniority, full Location breakdown, LinkedIn URL, X (Twitter) URL, Previous Employment (title, departments, seniority, company), and Company Domain, Industry, and ID.Troubleshooting
Error: Credit limit reached: Your account has no remaining credits. Add credits and re-run enrichment - already enriched rows are skipped automatically.Error: Invalid API key: Confirm the key is correctly set in Project Settings > Script Properties with the key nameapi_key.Error: Rate limit exceeded: Too many requests in a short window. Wait a moment and re-run.- Contacts not appearing after search: Check the Apps Script logs under View > Logs for the raw API response. Confirm your filters are valid by testing them in the Lusha API documentation.
- Enriched column shows
Excluded: Both the Enrich Email and Enrich Phone checkboxes are unchecked for that row. Check at least one to include it in the next enrichment run.
Automate with Triggers (Optional)
To run search or enrichment on a schedule:- In the Apps Script editor, go to Triggers (clock icon in the left sidebar).
- Click Add Trigger.
- Choose
populateContactsorenrichContactsas the function. - Set the trigger type to Time-driven and choose your frequency.
Legacy V2 Script
Additional Resources
If you have any questions, feel free to reach out to the support team:- Via live chat from the Lusha website
- Your Lusha Dashboard
- Via email: support@lusha.com