Find leads on small and medium businesses
This notebook teaches you how to use the Sixtyfour API to find and enrich businesses via our API. To get started, go to https://app.sixtyfour.ai and sign up to create an account with an API key.
Notebook Versions
You can access this notebook in different formats:
Prerequisites
Before you begin, make sure you have:
- A Sixtyfour API key (get it from the dashboard after signing up)
- Python 3.7+ installed
- Required Python packages:
- pandas
- requests
- python-dotenv
- httpx
- nest-asyncio
Set up
First, let’s import the necessary libraries and set up our environment:
Make sure to create a .env
file in your project directory with your API key:
Searching for businesses
Let’s start by defining our search query. The search query can be any natural language description of the businesses you want to find:
We can define the fields we want to collect for each business. These fields will be populated by the API based on available information:
Now let’s make the API call to search for businesses. The API will return a list of businesses matching your search criteria:
Example search results:
company_name | address | phone_number | website |
---|---|---|---|
Maria V Photography | 13634 Vian Rd, Poway, CA 92064 | +18133352197 | https://www.mariavphotography.com/ |
Zeena Gregg Photography | 15604 Riparian Rd, Poway, CA 92064 | +18587800510 | http://www.zeenagregg.com/ |
Enriching company data
Let’s first enrich one company to see how it works. We’ll select a company from our search results:
Example enrichment results:
company_name | address | phone_number | website | num_employees | instagram_url |
---|---|---|---|---|---|
Elle G Photography | 1070 Sapphire St, San Diego, CA 92109 | +18583441068 | https://ellegphotography.com/ | Less than 10 core staff members | https://www.instagram.com/ellegphotography/ |
name | title | phone | score | ||
---|---|---|---|---|---|
Lisa Gisczinski | ellegphotography@me.com | Owner and Principal Photographer | +18583441068 | 9 | https://www.linkedin.com/in/studioellephotography |
Processing all companies
Now let’s create functions to process all companies asynchronously. This allows us to enrich multiple companies in parallel:
Extracting individual leads
Let’s create a function to extract individual leads from the enriched data. This will help us create a more detailed contact list:
Example lead extraction results:
name | company | title | phone | score | |
---|---|---|---|---|---|
Maria Velasquez | Maria V Photography | Owner, Primary Photographer | maria@mariavphotography.com | +18133352197 | 9 |
Zeena Gregg | Zeena Gregg Photography | Owner / Lead Photographer | zeena@zeenagregg.com | +18587800510 | 8 |
Finding email addresses
Let’s create functions to find email addresses for the leads. This will help us verify and find additional contact information:
Saving the results
Finally, you can save the enriched data to CSV files for use in your CRM or other systems:
Summary
This notebook demonstrates how to:
- Search for businesses using the Sixtyfour API
- Enrich company data with additional information
- Extract individual leads from company data
- Find email addresses for leads
- Save the results for use in your CRM or other systems
The process is designed to be scalable and efficient, using asynchronous processing to handle multiple companies simultaneously. The results can be used for:
- Sales prospecting
- Market research
- Lead generation
- Business development
- Competitive analysis
Best Practices
- Rate Limiting: The code includes a semaphore to limit concurrent requests to 100. Adjust this based on your API plan limits.
- Error Handling: The code includes retry logic with exponential backoff for failed requests.
- Data Quality: The email cleaning step helps ensure data quality by removing unverified email addresses.
- Scalability: The async processing allows for efficient handling of large datasets.
- Data Export: Results are saved in CSV format for easy integration with other tools.
Next Steps
- Integrate with your CRM system
- Set up automated lead scoring
- Create email campaigns
- Track engagement metrics
- Refine search criteria based on results