Case study · Real estate lead generation
A lead data platform that turns messy property data into searchable leads
A real estate lead generation business finds property leads such as deeds and notices. Its data came from CSV files, ATTOM, web scrapers and scanned documents, and every source looked different. We built the pipeline that brings it all into one PostgreSQL database on Supabase, the matching that ties records to owners and properties, and the Retool screens the team searches every day.
The challenge
What wasn’t working
Leads came in from four kinds of source: CSV files, the ATTOM property API, web scrapers and scanned documents. No two of them used the same format.
The same property or owner often showed up more than once. Records with an empty owner field were the worst, because they matched things they shouldn’t.
The team needed to filter more than 600,000 records, and the first version of the search was too slow to use. Checking and sorting leads by hand ate the rest of the day.
The solution
What we built
One intake pipeline
An n8n pipeline that reads CSV, ATTOM and scraper data. GPT-4o-mini puts each record into the same structure, whatever source it came from.
OCR for scanned documents
Scanned deeds and notices go through the Gemini Batch API, so paper records end up as searchable data too.
A proper database
We replaced the early JSONB-based setup with a clean multi-table PostgreSQL schema on Supabase. Bulk upserts mean a re-run never creates duplicates.
Record matching
A database function matches scraped records to owners and properties. We fixed the false matches caused by empty owner data along the way.
Search that keeps up
A search view with trigram and covering indexes, LATERAL joins instead of slow DISTINCT ON queries, and keyset paging for long result lists.
Screens the team works in
Retool search screens with lots of filters, a map, checkbox selection for bulk actions and lead cards that show the deed or notice details.
How it works
How a lead gets from source to screen
- 1
Data arrives
A CSV, an ATTOM pull, a scraper run or a scanned document lands in the pipeline.
- 2
AI structures it
n8n sends structured data through GPT-4o-mini and scanned pages through Gemini OCR.
- 3
Stored once
Records are upserted into the PostgreSQL tables on Supabase, so nothing is stored twice.
- 4
Matched
The matching function links each record to its owner and property.
- 5
Searched
The team filters, maps and works through leads in Retool.
Screens
Inside the build
Real screenshots from the project. Client names, logos and personal details are blurred.

The result
What changed
- Leads from every source land in one database, in one format
- Search across 600,000+ records with many filters stays quick
- Fewer duplicates and false owner matches
- Less time spent checking leads by hand
More work
More case studies
From thousands of Excel workbooks to one survey-to-order system
Read the case study →Tire collection & exportOne CRM and mobile app for a tire collection and export business
Read the case study →Care-sector training (LMS)An admin console that lets a training company run its LMS without SQL
Read the case study →Have a project like this?
Tell us what you need to build. In 30 minutes we’ll map what to build first and follow up with a fixed-scope estimate.
Official Retool Agency Partner5.0 on Clutch, 9 reviewsBuilding software since 2015Reply within one business day