MikaelMonjour/outbound-lead-scoring-v2
0
Lead Scoring API
A FastAPI application that calculates a lead score based on multiple weighted parameters. The API is stateless and deployed on Hugging Face Spaces.
Features
- Intelligent Lead Scoring: Calculates scores based on carefully weighted parameters
- Business Type Analysis: Prioritizes hospitality businesses with higher scores
- Status Awareness: Automatically filters out permanently closed businesses
- Technical Validation: Checks for MX records on websites to verify legitimacy
- Categorization System: Classifies leads as Hot, Warm, or Cold for easy prioritization
- Interactive Documentation: Includes Swagger UI for easy testing and integration
- Stateless Architecture: Designed for scalability and reliability
Input Parameters
The API accepts a JSON payload with the following fields:
Scoring Logic
The lead score is calculated using a sophisticated algorithm:
- Business Type Evaluation:
- Hospitality businesses (salons, restaurants, hotels, etc.) receive maximum points
- Other businesses receive a moderate score
- Status Check:
- Permanently closed businesses automatically receive a score of 0
- Open or temporarily closed businesses proceed to full evaluation
- Weighted Calculation:
- Each parameter contributes to the final score based on its assigned weight
- Review count is logarithmically scaled to handle wide ranges of values
- Categorization:
Hotif score ≥ 7Warmif 4 ≤ score ≤ 6Coldif score < 4
API Endpoints
POST /calculate-score: Calculate a lead score based on the provided dataGET /: API informationGET /docs: Swagger documentation
Input Parameters
The API accepts a JSON payload with the following fields:
{
"type": "Business type (e.g., 'Beauty salon')",
"business_status": "Business status (OPEN, CLOSED_TEMPORARILY, or PERMANENTLY_CLOSED)",
"website": "Business website URL (optional)",
"phone_number": "Business phone number (optional)",
"email": "Business email (not used in scoring, optional)",
"rating": "Business rating 0-5 (optional)",
"review_count": "Number of reviews (optional)"
}Log git updates to Hugging Face Space
Last GitHub commits:
7392610 - refactor: replace DNS MX record check with static domain validation using common TLDs (MikaelGrowthEngineer, il y a 13 minutes)
89db14d - docs: add section about logging git updates to Hugging Face Space (MikaelGrowthEngineer, il y a 37 minutes)
e18b7a2 - Modify reviews score allocation of points and creating documentation files (MikaelGrowthEngineer, il y a 4 mois)
8ec6763 - Adapt README.md for hugging 3 (MikaelGrowthEngineer, il y a 6 mois)
bea23df - Adapt README.md for hugging 2 (MikaelGrowthEngineer, il y a 6 mois)