AI Lead Qualifier
Turn every inbound inquiry into scored, CRM-ready JSON with Claude.
- Python
- FastAPI
- Pydantic
- Anthropic Python SDK
- Uvicorn
Screenshots
One-off price
- ₹1,499+ GST at checkout
- $29
- Download it from your library as soon as your payment is confirmed.
- Every later release of this project is included, at no extra cost.
- Latest release
- 1.0.0 · Oct 14, 2026
- Licence
- Source Code Licence
Overview
A lean Python and FastAPI service that sends a short sales inquiry to the Claude API and returns structured JSON: the key details, the intent, a 0–100 lead score with a priority and the reasons behind it, a short summary and a suggested reply, ready to pass to your CRM.
Sorting incoming inquiries by hand is slow, and good leads wait while someone reads spam. AI Lead Qualifier does that first pass for you. Send one inquiry to a single API endpoint and get back clean, structured JSON in a few seconds.
Claude extracts the sender's name, email, phone, company, role, location, budget, timeline and requirements exactly as written. Nothing is guessed: anything the message does not say comes back as null. It classifies the intent as a sales inquiry, support request, partnership, job application, vendor pitch, spam or other, writes a one- or two-sentence summary, and drafts a reply signed with your business name for a person to review before sending.
The score is calculated by plain Python, not by the model. A transparent scorecard turns the signals Claude finds (budget, urgency, decision-making authority, a specific need, a meeting request) into a 0–100 score, a high, medium or low priority, and a list of reasons such as "+20 Budget mentioned". Scores are consistent, explainable and easy to tune, and a message cannot talk its way to high priority. Inquiries are treated as data, never as instructions, so prompt-injection attempts are classified instead of obeyed.
It is built to run in production. Results always match the schema thanks to Claude structured outputs. Every Claude API problem becomes a clear HTTP status (422, 502, 503 or 504) with a request ID, and logs record intent, score, tokens and duration without any customer data. The system prompt is cached to keep costs down, and you can switch between Claude models and effort levels in one settings file.
The code is small, typed and fully tested. 39 pytest tests run in under a second with a fake analyzer, so they never call Claude and cost nothing. Change the prompt, the extracted fields or the scorecard in clearly marked files to fit your business.
Want to see how it was built? The free, step-by-step tutorial series "Build an AI Lead Qualification Agent with Claude and Python" walks through every file in this project: https://devblogs.dewiride.com/series/claude-api/ai-lead-qualification-agent-claude-python (opens in a new tab)
Free tutorial series
Build an AI Lead Qualification Agent with Claude and Python
Prefer to learn by building it? This free, step-by-step guide on our blog shows how the project is made.
What you get
Everything in the archive, at a glance.
- Complete Python source code for version 1.0.0
- A FastAPI app with one endpoint, POST /api/v1/leads/qualify, plus a health check
- Claude structured outputs driven by Pydantic models
- A transparent 0–100 scorecard with priority and reasons, computed in Python
- Clear error responses (422, 502, 503, 504) with request IDs on every response
- Safe logs with token usage and no customer data
- A cached system prompt you can edit in one Markdown file
- 39 offline pytest tests that never call the Claude API
- uv.lock with the exact package versions it was tested on
- A README with setup, configuration, API reference and customization guide
- A .env.example template for every setting
Built with
The exact runtimes and versions it was built and tested against.
- Python3.14
- FastAPI0.143.0
- Pydantic2.14.1
- Anthropic Python SDK1.13.0
- Uvicorn0.54.0
- pytest9.1.1
What is in the archive
The file tree you get once you unzip it.
ai-lead-qualifier/
- src/
- lead_qualifier/
- __init__.py
- main.py
- config.py
- models.py
- prompts.py
- system_prompt.md
- analyzer.py
- scoring.py
- logging_config.py
- api/
- __init__.py
- health.py
- leads.py
- errors.py
- middleware.py
- lead_qualifier/
- tests/
- conftest.py
- test_api.py
- test_models.py
- test_prompts.py
- test_scoring.py
- data/
- greenleaf-analysis.json
- .env.example
- .gitignore
- .python-version
- pyproject.toml
- uv.lock
- README.md
What it needs from you
The accounts and services it expects to find, so nothing is a surprise.
- uv, which installs Python 3.14 for you
- A Claude API key on an Anthropic account with credit (API usage is billed by Anthropic)
- Basic comfort running commands in a terminal
- macOS, Windows or Linux
Releases
Every version so far, newest first.
1.0.0Latest
First release. Send a short lead message to one API endpoint and get back CRM-ready JSON: the contact details it mentions, the intent, a 0-100 lead score with priority and plain-language reasons, a short summary and a suggested reply. Includes clear error responses, request IDs, logs without personal data, and a full test suite that runs without calling the Claude API.
Source Code Licence
What you may do with it
What you may and may not do with the source code you buy.
Read the full licence
- What this licence covers
This licence governs every file included in a product you buy from Dewiride Store: source code, configuration, database scripts, sample data, documentation and any other file in the download. It takes effect when your payment is confirmed and applies to every release of that product that reaches your library. Files that reach your library through an annual updates membership are governed in exactly the same way.
It forms part of the Terms of Sale and Use. Where a product page states different or additional licence terms for that product, those terms prevail for that product. The membership page may likewise state different or additional licence terms for the files a membership carries, and those terms then prevail for those files.
- The licence we grant you
We grant you a perpetual, worldwide, non-exclusive, non-transferable licence to use, reproduce, adapt, translate and modify the files, and to include the result in your own work, on the conditions set out below.
Perpetual means it does not expire. Worldwide means it is not limited to any country. Non-exclusive means we license the same product to other customers. Non-transferable means you cannot pass it on to someone else.
The licence is granted to you — either you personally, or the organisation you identified when buying. Everyone working within that organisation may use the files for that organisation’s projects. Nobody outside it may.
- What you may do
- Use and change the files in your own projects, commercial or otherwise, with no limit on the number of projects.
- Build a product or a service on them and charge your own customers for it.
- Deploy the result for a client, as part of work you are doing for that client.
- Distribute the result in compiled, deployed or otherwise non-source form.
- Keep as many back-up copies as you reasonably need.
- Study, observe and test how the code works, and obtain the information you need to make it work with your own software.
The last two are yours by law under sections 52(1)(aa) to (ac) of the Indian Copyright Act, 1957, and nothing in this licence is intended to take them away.
- What you may not do
- Resell, sublicense, redistribute or publish the files themselves, in whole or in substantial part, in source form.
- Include them in a template, starter kit, course, tutorial repository or component library that you sell or give away, where the code is the thing being supplied.
- Share your account, your download links or your invoices with anyone outside your organisation.
- Publish the files in a public repository, or in any other place where they can be obtained without buying them.
- Remove or obscure the copyright and attribution notices in the source files.
- Use the files to build something whose main purpose is to compete with Dewiride Store as a supplier of the same code.
The distinction that matters is simple: you may sell what you build with the code; you may not sell the code.
- Third-party components
Our products depend on open-source libraries, frameworks and services that we did not write. Those remain under their own licences, which we do not and cannot change. Where a product includes or requires such a component, its licence is named in the product’s documentation, and complying with it is your responsibility.
- Releases
Every release of a product you own is covered by this same licence and appears in your library at no extra cost. A release you have already downloaded remains licensed to you even if we later stop publishing the product. A release that reached your library through an annual updates membership is licensed to you on these same terms, and stays licensed after the period that carried it has ended.
- Ownership
We keep ownership of the files and of the copyright in them. You own whatever you create with them: your changes, your additions and the product you build are yours.
- If this licence ends
This licence ends if you materially breach it and do not put the breach right within thirty days of us asking you to in writing. It also ends if your payment is reversed or refunded, because the purchase it depends on no longer stands. Where a membership period is refunded or reversed, the licence ends for the releases that period carried and for nothing else: anything you bought separately, or that another period carried, is unaffected.
If it ends, you must stop using the files and delete the copies you hold. Work you had already delivered to a client before that point may continue in use, so that ending this licence never breaks something your own customer relies on.
- No warranty beyond the description
The warranties and limits in section 19 and section 20 of the Terms of Sale and Use apply to this licence as well.
- Governing law
This licence is governed by the law of India, and section 24 of the Terms of Sale and Use applies to any dispute about it. If a translation and the English version differ in meaning, the English version governs.
AI Lead Qualifier
- ₹1,499+ GST at checkout
- $29