Skip to content
All case studies

CASE STUDY / Pharmaceutical equipment manufacturer

A national lead list of compounding pharmacies, built in code

2 weeksend-to-end vs agency timelines
Flat illustration showing three icons on the left — a map pin over a small map, the Python logo, and a magnifying glass with filter controls — converging via arrows into a document on the right containing a national map outline with a pharmacy symbol and rows of contact details (phone and email icons). Warm tan background.

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

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.

Explore more of our work

YOUR NEXT CHAPTER STARTS HERE

What could work better in your business?

A website that does more. An app that saves time. A clearer technology plan. Let’s find your next step.

Let’s talk about your business

An introductory conversation. A practical next step.