case study · Pharmaceutical equipment manufacturer
A national lead list of compounding pharmacies, built in code
2 weeks
end-to-end vs agency timelines
March 2025
ai-consulting

A complete, enriched, contact-ready list of every compounding pharmacy in the target market — combining Google Maps, Apollo, and a Python enrichment pipeline. A market-mapping job that would have taken a research firm weeks.
The headline
A pharmaceutical equipment manufacturer needed to map every compounding pharmacy in its primary national market as a sales target list — names, locations, contact details, decision-maker emails. The off-the-shelf databases were incomplete and the agency quotes were six-figure. I built it in code: Google Maps API for discovery, Apollo for enrichment, Python for the orchestration and deduplication. End-to-end in under two weeks.
Context
- Total addressable market for the product was concentrated in compounding pharmacies — a specialist segment within the wider pharmacy industry
- No clean public register that combined location, ownership, and decision-maker data
- Existing list providers: incomplete coverage, stale data, or both
- Agency quotes for bespoke market mapping were running into the six figures
- The sales team was working off a list they suspected covered well under half the addressable market — which meant most of their pipeline efforts were aimed at the same fraction of the market everyone else was already calling
The opportunity
This is a problem that used to require a research firm and a budget. With current APIs and a few hundred lines of Python, it's a two-week build. The interesting question wasn't "can we do this" — it was "how clean can we make the output."
Approach
1. Discovery layer — Google Maps API
- A state-by-state geographic sweep using the Places API
- Search terms tuned to identify compounding pharmacies specifically, not retail chains
- Raw results captured with name, address, phone, website, and Google place ID
- Several thousand pharmacies surfaced before deduplication
2. Enrichment layer — Apollo
- Each pharmacy enriched with company-level data (size, ownership, technology footprint where relevant)
- Decision-maker identification: owners, pharmacists-in-charge, operations leads
- Verified email addresses where available
- LinkedIn profile URLs for outbound research
3. Orchestration — Python
- Pipeline scripts to run discovery, enrichment, deduplication, and export in sequence
- Deduplication on a combination of place ID, phone, and address — the messy bit
- Quality scoring on each record so the sales team could prioritise high-confidence rows first
- Output to CSV and direct sync to the CRM
4. Validation
- A manual sample of a few hundred records was checked end-to-end against pharmacy websites and public registers
- Accuracy on the sample held comfortably above the threshold the sales team needed to work the list confidently — high enough to call without second-guessing, with the quality score doing the triage on the rest
Outcome
- Thousands of compounding pharmacies identified across the national market
- Thousands of enriched decision-maker contacts, scored and segmented
- Build cost — compute, API spend, and time — came in at a small fraction of the agency quote. Measured against the agency benchmark, the saving was an order of magnitude.
- Output landed directly in the sales team's CRM, segmented and ready to work
- The pipeline is rerunnable — a refresh costs hours, not weeks. Six months on, it's been rerun more than once.
What we learned
- Deduplication is the work. Discovery and enrichment are commodity; getting one clean row per real-world entity is where the time goes.
- Quality scoring matters more than completeness. The sales team needs to know which rows to trust without checking each one, and a confidence number on the row does that work better than a "verified" / "unverified" binary.
- The rerun is the point. A one-off list goes stale in a quarter. A pipeline that costs hours to rerun is a market map you can keep in step with the market.
Stack
- Discovery: Google Maps Places API
- Enrichment: Apollo API
- Orchestration: Python
- Output: CSV plus direct sync into the group's HubSpot tenant
- Compute: Cloud functions on demand, no standing compute cost
Related capability
This is a clean example of what the AI consulting practice does best — turning a problem that previously required an agency into a repeatable script. Similar patterns apply to competitor mapping, partner discovery, and any market-mapping task where the data exists but isn't connected.
Ready to use AI seriously?
A 30-minute call. No deck, no follow-up nurture sequence. I'll tell you whether I can help.