Overview
This recipe demonstrates how to use Airtop to automate the process of finding LinkedIn profiles for a list of contacts. While email addresses are relatively easy to obtain, finding the corresponding LinkedIn profiles can be challenging and time-consuming. This project shows how to leverage Airtop’s parallel processing capabilities to efficiently search and extract LinkedIn profile URLs from Google search results.
The script processes a CSV file containing basic contact information (email, first name, last name), searches for each person on Google, and uses AI to identify and extract their LinkedIn profile URL from the search results. By running multiple browser sessions in parallel, we can process large lists of contacts efficiently.
Prerequisites
To get started, ensure you have:
- Node.js installed on your system
- An Airtop API key. You can get one for free.
Getting Started
- Clone the repository:
- Install dependencies:
- Configure your environment: Create a
.env
file in the project root:
- Prepare your input data: Place your CSV file in the
data
directory with the following format:
Script Walkthrough
1. Initialize the Airtop Client
First, we set up the AirtopClient with your API key:
2. Load and Process Profiles
The script reads profiles from a CSV file and generates Google search queries for each person:
3. Parallel Processing Setup
To optimize performance, the script processes profiles in parallel batches. You can control the batch size through the BATCH_SIZE
constant:
4. AI-Powered Profile Extraction
The script uses Airtop’s AI capabilities to identify and extract LinkedIn profile URLs from search results. The AI is specifically instructed to:
- Look for URLs starting with “https://www.linkedin.com/in/”
- Consider country-specific LinkedIn domains
- Match profiles based on name and email domain
- Exclude LinkedIn post URLs
- Return only the profile URL or ‘Error’ if not found
5. Results Processing
The script saves the enriched profiles to a CSV file in the output
directory:
Running the Script
Execute the script with:
The script will:
- Read profiles from your input CSV
- Create parallel browser sessions based on the
BATCH_SIZE
- Search for each person on Google
- Extract LinkedIn profile URLs using AI
- Save the results to a new CSV file
Best Practices and Considerations
Parallel Processing
- The
BATCH_SIZE
parameter lets you control resource usage - Setting
BATCH_SIZE = 1
processes all profiles in parallel (fastest) - Increase
BATCH_SIZE
to reduce concurrent sessions if needed
Profile Matching Accuracy
The AI prompt is designed to:
- Prioritize exact name matches
- Consider email domain correlation
- Handle international LinkedIn domains
- Exclude non-profile LinkedIn URLs
Error Handling
The script includes robust error handling for:
- Session creation failures
- Window creation issues
- Profile search timeouts
- Invalid or missing profile data
- Retries for when timeouts happen or the AI is unable to find a match.
Summary
This recipe demonstrates how Airtop can automate the tedious process of finding LinkedIn profiles for your contacts. By combining parallel processing capabilities with AI-powered data extraction, you can efficiently enrich your contact database with valuable LinkedIn profile information. The script is particularly useful for sales teams, recruiters, or anyone needing to build comprehensive contact databases with LinkedIn presence.