If you sell into hospitals, recruit clinicians or run a research team, you have probably wondered how much of the healthcare web you can pull into a spreadsheet without getting into trouble. Healthcare data scraping covers more ground than most people expect. Provider registries, hospital directories, trial registries, price files and published research are all public, and a lot of it is published specifically so people can download and reuse it. Patient information is the part you leave alone, every time.
Below is the line we draw when someone asks us to build a healthcare scraper: what is fine to collect, what isn’t, where HIPAA and GDPR actually apply, and how the scraper is set up so it only extracts what you need. None of this is legal advice; for a specific project, ask your lawyer.
The short version: provider and facility data, yes. Patient data, no.
Most of the healthcare data companies ask for describes organizations, and professionals in their work role. Who a provider is, where they practice, which specialty they list, which hospital has a cardiology department, which sites are recruiting for a trial. Governments and hospitals publish this on purpose, often in bulk.
Patient data sits on the other side. Medical records, appointment details, lab results and anything that ties a named or identifiable person to a health condition stay out of every project. If a page needs a patient login to see, a scraper has no business there.
Between the two is a grey zone (doctor reviews, patient forums, social posts), which we come back to below.
What healthcare data scraping can collect
These are the public sources we see requested most, with the fields a scraper, API or bulk download usually pulls from each.
| Source | What it publishes | Typical fields | How it’s collected |
|---|---|---|---|
| NPI Registry (NPPES) | Every US provider with an NPI | npi, name, credential, taxonomy code, practice address, phone | Monthly bulk file and weekly updates from CMS, or the registry API |
| State licensing boards | License status and board actions | license_number, status, expiry_date, actions | A scraper per state; many boards use search forms or PDFs |
| Hospital and clinic websites | Departments, services, locations, physician directories | facility, department, specialty, address, listed physicians | A custom crawler per hospital system |
| Hospital price transparency files | Standard charges and negotiated rates | billing_code, description, payer, rate | Downloading and parsing the machine-readable files |
| ClinicalTrials.gov | Registered studies | nct_id, condition, phase, status, sponsor, site locations | Official API with JSON output |
| PubMed and DOI registries | Published research | title, authors, affiliations, journal, date, MeSH terms | PubMed E-utilities, Crossref, publisher pages |
| Congress programs | Sessions, abstracts, posters | session, track, date, room, abstract title, authors | A scraper per congress website, timed to release dates |
| Google Maps and pharmacy locators | Clinics, practices, pharmacies | name, category, address, phone, hours, rating | Ready-made Google Maps scraper or a custom store-locator scraper |
The NPI file is the starting point for most provider lists. CMS publishes it as a monthly ZIP of more than 1 GB, plus weekly incremental files and a monthly deactivation file (see the NPPES download page). It’s free, but it’s big, and the specialty arrives as a taxonomy code you have to translate. CMS also points out that an NPI doesn’t confirm a provider is licensed, so a serious list cross-checks state boards.
Hospital price files are the source people underestimate. Under the federal hospital price transparency rule, hospitals post their standard charges in machine-readable files. Opening one is easy. Comparing three hundred of them, each laid out a little differently, is a parsing project.
For clinic and practice listings by city, our Google Maps scraper already does the job, and you can try it with 1,000 free credits. We cover more sources in 10 public healthcare professional data sources, and congress programs in our guide to medical conference data. If you already know which sites you need, send us the list and we’ll build a free sample.
What to leave alone
Some things are visible on the web and still don’t belong in a dataset. We turn these down or strip them out:
- Patient records and anything behind a patient portal login.
- Posts where an identifiable person describes their own health, on forums, support groups or social media. Under GDPR, health data gets extra protection even when someone shared it publicly.
- The text of patient reviews. Patients often describe their diagnosis or treatment in them, so we keep the rating and review count and drop the text.
- Providers’ personal details outside their professional listing, such as home addresses, personal mobile numbers and dates of birth. CMS itself leaves Social Security numbers and birth dates out of the NPI data it publishes.
- Anything you would have to log in, pay or get around a block to see.
A quick test we use: if a record would tell a stranger something about a person’s health, it shouldn’t be in a scraped dataset.
Where HIPAA and GDPR fit into healthcare data scraping
HIPAA is narrower than its reputation. It covers protected health information held by covered entities (health plans, clearinghouses and most providers) and their business associates. A provider’s public NPI listing is business information that CMS publishes, so it isn’t PHI. HIPAA comes back into play as soon as patient-level data is involved, which is one more reason to keep it out of any scraping job.
GDPR reaches further. It applies to personal data about people in the EU even when that data is public, so a European doctor’s name and hospital email address are personal data. Health data is a special category under Article 9 with stricter rules. For European sources we extract only the professional fields a project needs, store the source URL for every record, and sign a data processing addendum on request (details on our GDPR page).
Two more things decide whether a particular source is fine to scrape: the site’s terms and your jurisdiction. Both vary, so for anything beyond public registries, run the plan past your lawyer before the first crawl.
How we build a healthcare scraper that only takes what you need
Rules on paper only help if the scraper enforces them. This is how we set up healthcare projects.
- We agree the exact columns before writing code, for example npi, provider_name, specialty, practice_address, phone, source_url and scraped_at. The scraper extracts those fields and ignores the rest of the page.
- Official files and APIs come first. If CMS publishes a bulk file or ClinicalTrials.gov offers an API, we use it, and only scrape what those don’t cover, like a hospital’s own department pages or a state board’s search form.
- Public pages only: no logins, no paywalls, and no working around a site that has clearly blocked automated access. Request rates stay low enough that a small clinic’s website doesn’t notice.
- Every row keeps its source URL and collection date, so anyone on your team can check where a record came from.
- Scheduled refreshes also remove records. If a physician leaves a hospital directory or an NPI is deactivated, the next run reflects it.
- Delivery fits how you work: CSV, JSON, JSONLines or XML, sent by API, email, AWS S3, Google Drive, Dropbox, FTP/SFTP or Google Cloud Storage, on an hourly, daily, weekly or custom schedule.
Step 5 is what keeps a sales or recruiting list usable. Without it, the file slowly fills with people who changed jobs, and your team finds out through bounced emails.
The hard parts of scraping healthcare websites
Bot protection is rarely the problem on healthcare sites. The trouble is that the same thing gets written ten different ways.
- Names don’t match across sources. “Robert J. Smith MD”, “Smith, Robert” and “Dr. Bob Smith” can be one person. Matching on NPI where it exists, and on name plus address where it doesn’t, removes most duplicates.
- Specialties use different vocabularies: NPI taxonomy codes, hospital department names, board certifications. A mapping table puts “Cardiovascular Disease” and “Cardiology” in the same column.
- A lot of it lives in PDFs, including board actions, older directories and some congress programs. We extract data from PDFs and scanned documents too, and flag rows the parser wasn’t sure about.
- Physician finders and store locators often load results with JavaScript and paginate by ZIP code or radius, so the crawler has to walk a grid of searches to get full coverage.
- Hospital sites get redesigned. A new template can break a scraper overnight. With a managed scraper, we repair it and your scheduled file keeps arriving.
Have a list of healthcare sources in mind? Send us the sites and the fields you want. We’ll build a free sample from public pages and quote the full run. Request a free sample
What you get when Scrapeak builds it
You tell us the sources and the columns. We build the scraper, run it on your schedule and keep it working when sites change. Simple projects are delivered in 2-3 days, and we sign an NDA if your target list is confidential. Pricing depends on the number of sites, the data volume and how often it runs, with discounts for scheduled runs (see pricing).
An example of a first project: cardiology providers in five states from the NPI file, matched to the hospital directories that list them, with each hospital’s address and department page. One CSV, refreshed monthly, delivered to a shared Google Drive folder.
Frequently asked questions
Is healthcare data scraping legal?
Collecting public, non-patient data such as provider registries, hospital directories and trial registries is common and generally low risk. The answer still depends on the site’s terms, the country and what you do with the data, so get legal advice for your specific project.
Does HIPAA apply to scraped healthcare data?
HIPAA covers protected health information held by covered entities and their business associates. Public provider listings such as the NPI Registry are not PHI. HIPAA could apply once patient-level data is involved, which is why patient data should stay out of any scraping project.
Is NPI data public?
Yes. CMS publishes NPI Registry data, which anyone can search online or download as a monthly file with weekly updates. The published data leaves out items such as Social Security numbers and dates of birth.
Does GDPR apply to public data about doctors?
Yes. The names, work emails and phone numbers of healthcare professionals in the EU are personal data even when a hospital publishes them. Collect only the fields you need, have a lawful basis for using them, and keep a record of where each one came from.
Can you scrape doctor reviews?
Star ratings and review counts on a public profile are often collected. The review text is different, because patients regularly describe their own treatment in it, so we leave the text out.
How often should a scraped provider list be refreshed?
Monthly works for most sales and recruiting lists, and it lines up with the monthly NPI file. Trial registries and congress programs change faster around big dates, so weekly or daily scraping runs make more sense there.
Get a healthcare dataset built from public sources
Tell us which registries, hospital sites or programs you need and which fields matter. We’ll send a free sample and a quote. Prefer to start on your own? Our ready-made scrapers come with 1,000 free credits and no credit card.