Skip to main content
This script polls Supersonic for recently created contacts, enriches each one using a web search API (Tavily), and writes the enrichment data back to the contact record. Run it every 15 minutes on cron.

How it works

  1. Fetch contacts sorted by created_at descending.
  2. Check which ones were created since the last run (tracked via a timestamp file).
  3. For each new contact, search the web for their name + company.
  4. Extract title, LinkedIn URL, and company info from search results.
  5. Update the contact record in Supersonic.

Prerequisites

You need a Contacts object type with fields for enrichment data:
You also need a Tavily API key (free tier available). Any search API works — substitute your preferred provider.

The script

Setup

1

Install dependencies

2

Set environment variables

3

Test with a single run

Check a contact to verify enrichment data was written:
4

Schedule with cron

Every 15 minutes:

Using a different search API

The search_person function is the only part that depends on Tavily. Swap it out for any provider. Here’s the same function using SerpAPI:
This script processes up to 50 contacts per run. If you’re importing large batches, increase the limit parameter or run more frequently. Each records.list and records.update call counts toward the 1,000 calls/min rate limit.
To enrich existing contacts (not just new ones), remove the since filter and the “already enriched” check. Run it once as a backfill, then switch back to incremental mode.