Skip to content

Repository files navigation

Intent Engine — B2B Lead Generation by Niche & Location

Intent Engine is an open-source B2B lead generation tool that scrapes Google Maps by niche and city, extracts decision makers from company websites, enriches contacts with Hunter.io/Apollo fallbacks, and generates 3-step AI cold email sequences — with CSV export, scrape history, and CRM webhooks.

Built for sales teams, agencies, and founders doing outbound prospecting, cold email, and local B2B lead gen (dentists, HVAC, law firms, real estate, etc.).


GitHub repo setup (copy & paste)

Repo name:intent-engine

Description (GitHub → Settings → About):

Intent Engine — open-source B2B lead scraper: find decision makers by niche & location, AI email sequences, Hunter.io fallback, CSV export & webhooks.

Topics (add under About → Topics):

intent-engine
b2b-leads
lead-generation
lead-scraper
web-scraping
playwright
cold-email
sales-prospecting
decision-maker
outreach-automation
fastapi
nextjs
celery
llm
hunter-io
google-maps-scraper

What it does

  1. Search — Enter a business niche + location (city autocomplete via OpenStreetMap).
  2. Discover — Playwright scrapes Google Maps for matching businesses with websites.
  3. Enrich — LLM (Groq/OpenAI-compatible) extracts CEO/founder names, titles, tech stack, and recent news from /about, /team, and similar pages.
  4. Fallback — Hunter.io → Apollo when scraping finds no decision maker.
  5. Outreach — AI generates a 3-step email sequence (initial, follow-up, breakup) plus a one-line icebreaker.
  6. Export — Download leads as CSV or POST to a CRM webhook (Zapier, Make, etc.).
  7. History — Authenticated users save past scrape jobs in PostgreSQL.

Features

FeatureDetails
Niche + location searchGoogle Maps discovery via Playwright
Decision maker extractionLLM + regex fallback from public team/about pages
Intent signalsTech stack detection, recent news/blog titles
Email validationSMTP checks on discovered addresses
API enrichmentHunter.io and Apollo.io domain search fallbacks
AI email sequences3-step personalized cold outreach (Groq, OpenAI, etc.)
Proxy rotationResidential proxy support with stealth evasion
Background jobsCelery + Redis — scrape without blocking the UI
AuthClerk sign-in, JWT-protected API, per-user history
CRM webhooksAuto-deliver completed leads to your stack

Tech stack

LayerTools
FrontendNext.js 14, TypeScript, Tailwind CSS, Clerk
BackendFastAPI, Celery, Redis, SQLAlchemy
DatabasePostgreSQL
ScrapingPlaywright, playwright-stealth, BeautifulSoup
AIGroq / OpenAI-compatible LLM API
EnrichmentHunter.io, Apollo.io (optional)
DeployDocker Compose (Postgres, Redis, API, worker, frontend)

Quick start

Prerequisites

  • Python 3.11 – 3.13
  • Node.js 20+
  • Docker (Postgres + Redis)
  • Clerk account (free tier)
  • Optional: LLM API key (Groq, OpenAI), Hunter.io / Apollo keys

1. Clone & start infrastructure

git clone https://github.com/YOUR_USERNAME/intent-engine.git
cd intent-engine
docker compose up -d

2. Backend

cd backend
python3.13 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
playwright install chromium
cp .env.example .env
# Edit .env — see Environment variables below

Terminal A — API:

uvicorn app.main:app --reload --port 8000

Terminal B — Celery worker:

celery -A app.celery_app.celery_app worker --loglevel=info

3. Frontend

cd frontend
npm install
cp .env.local.example .env.local
# Add Clerk keys from dashboard.clerk.com
npm run dev

Open http://localhost:3000 — sign in, run a scrape, export CSV.


Environment variables

Backend (backend/.env)

VariableRequiredDescription
DATABASE_URLYesPostgreSQL connection string
REDIS_URLYesRedis URL (default redis://localhost:6379/0)
CLERK_JWKS_URLYes*Clerk JWKS endpoint
CLERK_ISSUERYes*Clerk JWT issuer URL
AUTH_DISABLEDNoSet true to skip JWT in local dev
LLM_API_KEYNoGroq/OpenAI key for AI extraction & emails
LLM_BASE_URLNoDefault OpenAI-compatible endpoint
LLM_MODELNoModel id (e.g. llama-3.3-70b-versatile)
HUNTER_API_KEYNoHunter.io domain search fallback
APOLLO_API_KEYNoApollo people search fallback
PROXY_URLSNoComma-separated residential proxy URLs

* Not required when AUTH_DISABLED=true

Frontend (frontend/.env.local)

VariableDescription
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYClerk publishable key
CLERK_SECRET_KEYClerk secret key
NEXT_PUBLIC_API_URLBackend URL (default http://localhost:8000)

Never commit .env or .env.local. Use the .example files only.


Clerk setup

  1. Create an app at dashboard.clerk.com
  2. Copy keys into frontend/.env.local
  3. Set backend JWT verification:
    • CLERK_JWKS_URL = https://<your-clerk-domain>/.well-known/jwks.json
    • CLERK_ISSUER = https://<your-clerk-domain>

API

MethodPathAuthDescription
GET/healthNoHealth check
POST/api/scrapeYesEnqueue scrape job
GET/api/tasks/{task_id}YesPoll job progress
GET/api/historyYesList past jobs
GET/api/history/{job_id}YesJob detail + leads
POST/api/webhooks/configureYesSave CRM webhook URL

Authenticated routes require Authorization: Bearer <clerk_jwt>.


Production (Docker)

export NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_...
export CLERK_SECRET_KEY=sk_live_...
docker compose -f docker-compose.prod.yml up --build -d

Services: postgres, redis, api, celery-worker, frontend


Project structure

intent-engine/
├── docker-compose.yml # Local Postgres + Redis
├── docker-compose.prod.yml # Full production stack
├── backend/
│ ├── app/
│ │ ├── main.py # FastAPI routes
│ │ ├── scraper.py # Playwright discovery + enrichment
│ │ ├── llm_extractor.py # AI decision makers + email sequences
│ │ ├── enrichment.py # Hunter.io / Apollo fallback
│ │ ├── proxy_manager.py # Residential proxy rotation
│ │ ├── tasks.py # Celery scrape jobs
│ │ └── auth.py # Clerk JWT verification
│ └── verify_pipeline.py # Standalone pipeline tests
└── frontend/
└── src/
├── app/ # Next.js App Router
├── components/ # Dashboard, history, location autocomplete
└── middleware.ts # Clerk route protection

Verification

Run pipeline tests without the full UI:

cd backend
source .venv/bin/activate
python verify_pipeline.py # all tests
python verify_pipeline.py --test c # LLM email sequence only

Who is this for?

  • Agencies selling websites, automations, AI chat, or AI voice to local businesses
  • SDRs / founders building niche outbound lists (dentists, HVAC, lawyers, etc.)
  • Developers who want a self-hosted alternative to expensive lead databases

Disclaimer

This tool scrapes publicly available business information. You are responsible for complying with applicable laws (CAN-SPAM, GDPR, etc.) and the terms of service of data sources you use. Use ethically — verify contacts and respect opt-outs.


License

MIT — see LICENSE.


Keywords

B2B lead scraper · Intent Engine · lead generation · decision maker finder · Google Maps scraper · cold email tool · sales prospecting · Playwright scraping · AI outreach · Hunter.io · Apollo enrichment · FastAPI · Next.js · Celery · open source CRM leads

About

Intent Engine open-source B2B lead scraper: find decision makers by niche & location, AI email sequences, Hunter.io fallback, CSV export & webhooks

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages