Automating Lead Qualification
Learn how to automatically research and score your leads using Linkup AI to prioritize high-value prospects
Time-saving Automation: This tutorial shows you how to build a system that can process hundreds of leads automatically, saving 5+ hours of manual research per week while ensuring you focus on the right opportunities.
The Challenge: From Manual Research to Automated Intelligence
Every day, new users sign up for Linkup. When they do, we capture two crucial pieces of information:
- Their company name
- Their email address
When we had a few signups every day, our team could spend time researching each company manually and identify the most important ones. But as we grow and the number of daily signups becomes too high to handle manually, we face a challenge: How do we know which leads to focus on first?
Before automation: Our sales team spent hours manually researching each company, often missing high-value opportunities because of the volume.
After automation: We instantly identify and prioritize the most promising leads based on AI-powered analysis of their company profile and website.
The Solution: An Automated Enrichment Pipeline to Qualify Leads
By the end of this tutorial, you’ll have a working system that:
- Finds Official Websites: Cross-references company names with email domains
- Analyzes Company Websites: Determines how well each company fits your ideal customer profile
- Prioritizes Leads: Assigns a score from 1-5 so your team knows who to contact first
For this tutorial, we are going to use:
- Attio CRM data pull: to generate the input .json file with org names and company domains.
- Linkup API: to search the web and enrich the leads.
The Complete Process: Visual Overview
Here’s how the data transforms throughout this process:
Project Setup: Getting Started
Let’s start with our project structure and requirements:
Create Your Environment
First, let’s set up our environment and install the required packages:
Set Up Your API Keys
Create a .env
file in your project directory with your API keys:
Get your API key
Create a Linkup account for free to get your API key.
Never put your API KEYS directly in your code. Always include them in a .env
file.
Add your input file
Our starting point is a JSON file containing user signup information:
- Organizations
- Email address (or rather: the domains of the email addresses)
In our case, we extracted this file from our CRM (Attio) since this is where we send signup data (and want to send the enriched data back after the process). This file could be the output of a signup form or any lead generation document you’re using.
Let’s look at the structure:
As you can see, data quality might not be optimal:
- Some users provide personal email addresses
- Others do not put the name of their company
This is why we’re combining both information to try and get better results.
We could add a Linkup search for LinkedIn profiles associated with the first part of the emails.
The Enrichment Pipeline: Step-by-Step Implementation
Before we share the whole script (see the end of the tutorial), let’s break down our enrichment pipeline into steps:
Finding Official Websites
Our first challenge is to reliably find the official website for each company. We’ll use Linkup’s API with a carefully crafted prompt:
Understanding key parameters:
- depth: “standard”: For website finding, “standard” depth provides a good balance between speed and accuracy
- outputType: “sourcedAnswer”: Returns a natural language answer with just the URL
- includeImages: “false”: We don’t need images, which speeds up the response
Analyzing Company Fit
Once we have the website, we need to determine how well each company fits our ideal customer profile. For this, we’re using a second prompt to Linkup that gives the domain URL as input and asks for an ICP score as output.
We use ‘deep’ depth for ICP analysis because:
- It provides more thorough analysis of the company website
- It considers more pages and context when making its assessment
- The accuracy of ICP scoring is worth the slightly longer processing time
The output will be an ICP (Ideal Customer Profile) score ranging from 1-5:
- 1 - Perfect match - AI companies, Tech Companies with clear API needs
- 2 - Strong potential - Corporates, Financial Firms, Consulting companies
- 3 - Moderate fit - Universities, Educational Institutions, Research Organizations
- 4 - Might need education - Companies with potential but unclear use cases
- 5 - Probably not a good fit - Consumer businesses, local services, etc.
Notice how we don’t have to explicitly explain our rating system - AIs understand it intuitively.
Checking the results
After we run the script with these two API calls, a new file will be created with two new fields for each company:
- Website domain
- ICP Analysis
Great! As you can see, combining company name and email domain allows us to identify ICPs we would have missed if we had only considered one of the two factors.
The complete script below includes additional functionality beyond the two Linkup API calls shown above. For example:
- We implement logic to skip the ICP analysis call when no website is found, automatically assigning a rating of “1” (as seen in the second example output)
- We include an incremental processing system that only analyzes companies without existing ratings, preventing redundant API calls and allowing you to resume processing after interruptions
- The code handles file operations safely, maintains a processing counter, and includes appropriate rate limiting between API calls
Next Steps and Customization Opportunities
This script is just the beginning! Here are ways you can extend it:
- Additional Enrichment: Add other API calls to find additional information (company industry, value chain positioning, pricing strategy…)
- CRM Integration: Add code to push results back to your CRM automatically (what we’re doing at Linkup)
- Multi-threaded Processing: Speed up processing by handling multiple companies simultaneously
In our case, we’re actually sending the data back to our CRM so that new signups get automatically rated. We then have live alerts that tell us when important customers sign up to our products.
The Complete Code
Below is the complete Python script that implements our lead qualification system. The file is more complex than the two functions to allow for observability, troubleshooting, batch processing, etc. Do not hesitate to reach out if you have any questions.
Try It Yourself
Conclusion
You’ve now built an automated system that transforms basic CRM information into actionable intelligence. By leveraging the Linkup API, you can:
- Save Time: Eliminate manual research
- Improve Targeting: Focus on the most promising leads
- Scale Your Process: Handle hundreds of leads with ease
This approach combines the best of both worlds: AI-powered analysis with your business expertise to define what makes an ideal customer.
For more sophisticated implementations, check out our other tutorials or reach out to our support team!
Facing issues? Reach out to our engineering team at support@linkup.so or via our Discord.