Pharmaceutical data scraping
Pharmaceutical data scraping collects drug prices, formulary placement, regulatory approvals and patient-reported signals from public websites. Zenrows fetches pharmacy product pages, formulary tools and FDA or EMA records in each country where prices differ, and returns structured JSON. Batch reruns the full price grid to show every change by pharmacy, pack size and date.
Updated
{
"drug": "atorvastatin",
"strength": "20 mg",
"form": "tablet",
"ndc": "12345-678-90",
"quantity": 30,
"market": "US",
"observed_at": "2026-10-16",
"prices": [
{ "pharmacy": "Online pharmacy A", "price": 14.20, "type": "cash", "in_stock": true },
{ "pharmacy": "Retail chain B", "price": 18.99, "type": "cash", "in_stock": true },
{ "pharmacy": "Discount program C", "price": 9.85, "type": "coupon", "in_stock": true }
],
"currency": "USD",
"formulary": {
"plan": "Example Health Plan 2026",
"tier": 1,
"prior_authorization": false,
"quantity_limit": "90 per 90 days"
}
}
What pharmaceutical data teams collect
Market teams want prices, coverage and competitors; safety teams want what patients say.
The sources barely overlap.
| Job | Data you collect | Typical sources |
|---|---|---|
| Drug price monitoring | Cash price, coupon price, pack size, stock status | GoodRx, Cost Plus Drugs, CVS, |
| Formulary and coverage tracking | Tier, prior authorization, step therapy, quantity limits | Insurer and PBM formularies, Medicare Plan Finder |
| Regulatory approvals and labels | Approval date, indication, label changes, generic and biosimilar entry | Drugs@FDA, Orange Book, Purple Book, EMA EPARs, Health Canada Drug Product Database |
| Competitor pipeline | Phase changes, readouts, partnerships | Pipeline pages, press wires, BioSpace, trial registries |
| Pharmacovigilance signals | Side effects, product, dosage, post date | Drugs.com and WebMD reviews, patient forums, |
| OTC product tracking | Price, rating, review count, availability |
Why pharma data collection breaks
A price needs strength, quantity, pharmacy and location, and each site shows them differently.
Prices differ by ZIP code, pharmacy and 30 or 90 count
One URL per grid cell; geotargeting per country
Cloudflare challenges, or an empty price element
Adaptive Stealth Mode adds rendering and Zenrows' stealth only when needed
Tier shown only after picking plan year and drug
Browser runs the search; the links output filter lists formulary documents
Brand, generic, salt and pack text differ by site
CSS selectors for NDC, strength and form; normalise on your side
Thousands of weekly posts, mostly off-product
Markdown output gives clean text to classify
How to collect pharmaceutical data with Zenrows
- Build the price grid: drug, strength, quantity, pharmacy and location; one URL per cell.
- Name the fields once (price, pack size, NDC, stock), or skip selectors with Extract.
- Run the grid as a job in Batch daily, each result stored with cell and date.
- Pull regulatory pages as text: approvals, labels and EPARs as Markdown from the CLI, diffed per version.
# pip install requests
import json
import requests
# Example selectors: match them to the pharmacy's product page
fields = {
"name": "h1",
"price": ".price",
"pack_size": ".pack-size",
"ndc": ".ndc",
"stock": ".availability",
}
params = {
"apikey": "YOUR_ZENROWS_API_KEY",
"url": "PHARMACY_PRODUCT_URL",
"mode": "auto",
"proxy_country": "us",
"css_extractor": json.dumps(fields),
}
response = requests.get("https://api.zenrows.com/v1/", params=params)
print(response.json())curl -X POST "https://async.api.zenrows.com/v1/jobs" \
-H "X-API-Key: YOUR_ZENROWS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "regular",
"status": "closed",
"zenrows_params": { "mode": "auto", "extract": "auto" },
"tasks": [
{ "url": "PHARMACY_A_PRODUCT_URL", "external_id": "atorvastatin-20mg-30-pharmacy-a" },
{ "url": "PHARMACY_B_PRODUCT_URL", "external_id": "atorvastatin-20mg-30-pharmacy-b" }
]
}'npx -y @zenrows/cli init
# Approval and EPAR pages as Markdown, ready to diff against the last version
zenrows fetch EPAR_PAGE_URL --output markdown --out epar-today.md
# Formulary documents linked from a plan page
zenrows extract PLAN_PAGE_URL --outputs links# Connect once
claude mcp add zenrows -e ZENROWS_API_KEY=YOUR_ZENROWS_API_KEY -- npx -y @zenrows/mcp
# Then ask:
Use Zenrows to look up atorvastatin 20 mg, 30 tablets, on GoodRx and Cost Plus Drugs
for ZIP code 10001, and return each pharmacy's name and price as a table.Which Zenrows product fits
- Read a pharmacy product or label page FetchThe rendered page from protected pharmacies
- Get price and pack data without selectors ExtractStructured fields that survive a redesign
- Price the whole grid every day BatchThousands of URLs, one job, an external_id per cell
- Pull approval and EPAR pages into scripts CLIOne command, a page as Markdown
- Search a formulary by plan and drug BrowserA real browser for forms and dropdowns
What success looks like
| Measure | What good looks like | How to check it |
|---|---|---|
| Grid coverage | Every cell priced for the day | Filled cells over planned cells, per run |
| Normalisation rate | Nearly every row maps to an NDC or your product ID | Unmapped rows per pharmacy |
| Approval lead time | FDA approvals and EMA opinions ingested same day | Publication against ingestion date |
| Formulary change capture | Tier changes caught the cycle they appear | Diff each plan per run |
| Price freshness | Every price from the latest daily run | Cells whose newest price is over a day old |
Pharmaceutical data FAQ
-
Public web information on medicines: prices, formulary placement, approvals and labels, pipeline news, and what patients and clinicians say. Commercial, market access and safety teams each use a slice.
-
Pharmacy and discount sites: GoodRx, Cost Plus Drugs, CVS, Walgreens, Amazon Pharmacy in the US; DocMorris, Shop Apotheke in Europe. CMS offers NADAC, a weekly survey of pharmacy acquisition costs, free. Retail pages show what patients pay.
-
Prices, formularies and regulatory records are public. Patient posts are special-category health data under GDPR: drop usernames, keep only what you need, check forum terms. HIPAA does not cover patients' own posts; other laws may. Ask your legal team.
-
Your pharmacovigilance team decides. EMA's good pharmacovigilance practice guidance covers digital media screening, and companies document how monitored posts are reviewed. URL and date on each post make that review possible.
-
Drugs@FDA, the Orange Book and openFDA offer downloads and an API. Labels, press releases, EMA committee highlights and EPARs are web pages: fetch as Markdown on a schedule and diff.
-
Which drugs a plan covers, at which tier, with which restrictions (prior authorization, step therapy, quantity limits). Plans publish search tools and PDF or spreadsheet files. Collect the files, run search-only tools in a browser session, diff each plan for tier changes.
-
Yes. Geotargeting requests each market from its country (Germany for German pharmacies, the UK for UK chains) for local prices and currency. Keep market and currency per row; convert in your pipeline, keeping the original.