A powerful Python tool for extracting and enriching B2B contact information using the Apollo.io API. Perfect for sales teams, recruiters, and marketers looking to build targeted contact lists.
- Smart Contact Discovery - Find executive contacts by company name or domain
- Title-Based Filtering - Prioritize contacts by job titles (Founder, Growth, etc.)
- Email Enrichment - Unlock personal emails when available
- CSV Export - Easy integration with your existing workflow
- Rate Limiting - Built-in rate limiting to respect API usage policies
- Error Handling - Robust error handling and logging
- CLI Interface - Simple command-line interface for easy integration
- Python 3.7 or higher
- Valid Apollo.io API key with sufficient credits
-
Clone the repository:
git clone https://github.com/sajdakabir/ContactHarvest.git cd ContactHarvest
-
Create and activate a virtual environment:
# On macOS/Linux python3 -m venv venv source venv/bin/activate # On Windows # python -m venv venv # .\venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Configure your Apollo.io API key:
cp .env.example .env # Edit .env and add your API key
Create a .env
file in the project root with the following variables:
APOLLO_API_KEY=your_api_key_here
You can modify the following constants in app.py
to customize the behavior:
# Preferred job titles (in order of priority)
PREFERRED_TITLES = ["Founder", "Growth"]
# API settings
PER_PAGE = 3 # Number of results per page
MAX_PAGES = 1 # Max pages to fetch per company
SLEEP_SECS = 1 # Delay between API calls (in seconds)
-
Clone the repository:
git clone <repository-url> cd <repository-name>
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.env
file in the project root and add your Apollo.io API key:APOLLO_API_KEY=your_apollo_api_key_here
# Process a single company
python app.py input.csv output.csv
# Example with test mode (processes only the first company)
python app.py --test input.csv output.csv
# Show help
python app.py --help
Argument | Description | Default |
---|---|---|
input.csv |
Path to input CSV file | Required |
output.csv |
Path to save output CSV | output.csv |
--test |
Test mode (process first company only) | False |
--limit N |
Limit number of companies to process | None (all) |
Your input CSV should include these columns:
Column | Required | Description |
---|---|---|
company_name |
Yes | The name of the company |
company_website_url |
No | Company website (improves match accuracy) |
clutch_profile_url |
No | Original Clutch profile URL |
The generated CSV will contain these columns:
Column | Description |
---|---|
clutch_profile_url |
Original Clutch profile URL |
company_name |
Company name |
company_website |
Company website |
person_name |
Contact's full name |
role |
Job title |
email |
Email address |
linkedin_url |
LinkedIn profile URL |
-
Prepare your input CSV (
companies.csv
):company_name,company_website_url Google,google.com Microsoft,microsoft.com
-
Run the script:
python app.py companies.csv results.csv
-
Check the results (
results.csv
):clutch_profile_url,company_name,company_website,person_name,role,email,linkedin_url ,Google,google.com,Sundar Pichai,CEO,[email protected],linkedin.com/in/sundarpichai ,Microsoft,microsoft.com,Satya Nadella,CEO,[email protected],linkedin.com/in/satyanadella
The script includes built-in rate limiting to prevent hitting Apollo.io's API limits. You can adjust these settings in app.py
:
# Adjust these values as needed
PER_PAGE = 3 # Results per page (max 100)
MAX_PAGES = 1 # Pages to fetch per company (set to None for all)
SLEEP_SECS = 1 # Delay between API calls (in seconds)
Modify the PREFERRED_TITLES
list in app.py
to prioritize different job titles:
PREFERRED_TITLES = [
"Founder", "CEO", "CTO", "Growth", "Marketing",
"Sales", "Business Development", "VP"
]
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the file for details.
- API Credits: Each API call consumes credits from your Apollo.io account
- Rate Limits: Be mindful of Apollo.io's rate limits to avoid temporary bans
- Data Privacy: Ensure compliance with data protection regulations when storing contact information
- Testing: Always test with the
--test
flag when making changes - Backup: Keep backups of your input and output files
- Clutch Profile Scraper - Scrape company profiles from Clutch.co
- Apollo.io API Documentation
- Requests Library
- Pandas Documentation
- Built with β€οΈ using Python and β coffee
- Thanks to Apollo.io for their powerful API
- Inspired by the need for better sales intelligence tools