- Render.com Deploy
This project is a Lead Qualification System designed to automatically evaluate and score potential sales leads based on various data points. It combines information from multiple sources, including social media profiles and professional networks, to provide a comprehensive assessment of each lead.
The system can be used by sales and marketing teams to:
- Prioritize high-value leads
- Automate the initial qualification process
- Gain insights into leads' professional and social profiles
- Generate qualification summaries for each lead
- Python: The main backend logic is implemented in Python, utilizing FastAPI for the API server.
- PHP: A client script is provided in PHP to interact with the Python backend.
- FastAPI: Used to create the RESTful API endpoints.
- Guzzle: PHP HTTP client used in the client script to make requests to the API.
- Various APIs and Libraries:
- LinkedIn API
- Instagram API (via instaloader)
- Facebook Scraper
- Twitter API (via tweepy)
-
Lead Qualification Machine (
LeadQualificationMachine
class inmain.py
):- Handles the core logic for scraping data from various sources
- Calculates lead scores
- Generates qualification summaries
-
FastAPI Application (in
main.py
):- Provides the
/qualify
endpoint for lead qualification
- Provides the
-
PHP Client (
lead_qualify.php
):- Demonstrates how to interact with the API from a PHP environment
-
Data Models (Pydantic models in
main.py
):LeadInput
: Defines the structure of input lead dataQualifiedLead
: Defines the structure of the qualified lead output
- Ensure Python 3.7+ is installed.
- Install required packages:
pip install fastapi uvicorn python-dotenv linkedin-api instaloader facebook-scraper tweepy
- Set up environment variables in a
.env
file with necessary API keys and credentials. - Run the FastAPI server:
python main.py
- Ensure PHP 7.4+ is installed with Composer.
- Install Guzzle:
composer require guzzlehttp/guzzle
- Update the
$apiUrl
inlead_qualify.php
to point to your running FastAPI server. - Run the PHP script:
php lead_qualify.php
- The Python backend exposes a
/qualify
endpoint that accepts a list of lead data. - Send a POST request to this endpoint with lead information.
- The system will process each lead, scraping available data from social profiles.
- A qualification score and summary will be generated for each lead.
- The response will include detailed information about each qualified lead.
Note: Ensure all necessary API keys and credentials are properly set up in the .env
file for full functionality.