Skip to content

Latest commit

 

History

History
86 lines (64 loc) · 2.17 KB

File metadata and controls

86 lines (64 loc) · 2.17 KB

FastAPI Backend Setup Complete ✅

What's Been Built

A complete FastAPI backend that integrates:

  • ✅ Apify scraper for lead generation
  • ✅ CrewAI 4-agent workflow for lead processing
  • ✅ RESTful API endpoints
  • ✅ Lead storage and retrieval
  • ✅ Statistics and monitoring

📁 Files Created

  1. api/main.py - Main FastAPI application with all endpoints
  2. api/run_server.py - Server startup script
  3. api/__init__.py - Package init file
  4. test_api.py - API test suite
  5. API_DOCUMENTATION.md - Complete API documentation

🚀 Quick Start

1. Start the Server

cd /Users/oabolade/agents_app_build/lead_sniper_ai
source venv/bin/activate
python api/run_server.py

Server will be available at: http://localhost:8000

2. View API Documentation

Once running, visit:

3. Test the API

# In another terminal
python test_api.py

📡 Available Endpoints

Endpoint Method Description
/health GET Health check
/api/scrape POST Scrape leads only
/api/process POST Process single lead
/api/scrape-and-process POST Complete pipeline
/api/leads GET Get all leads
/api/leads/{id} GET Get specific lead
/api/leads/{id} DELETE Delete lead
/api/stats GET Get statistics

🔄 Complete Pipeline Endpoint

The main endpoint is /api/scrape-and-process which:

  1. Scrapes leads from Reddit and LinkedIn
  2. Processes top leads through 4-agent crew:
    • Intent Data Analyst (Signal Scout)
    • Business Intelligence Analyst (Researcher)
    • Strategic Growth Copywriter (Pitch Architect)
    • Quality Assurance & MCP Bridge (Auditor)
  3. Returns processed leads with buyability scores

📝 Example Request

curl -X POST http://localhost:8000/api/scrape-and-process \
  -H "Content-Type: application/json" \
  -d '{
    "keywords": ["hiring", "looking for"],
    "max_per_source": 5,
    "process_limit": 2
  }'

✅ Status

FastAPI Backend: ✅ Complete and Ready

All endpoints are functional and ready to use!