# WebMD Health Condition & Drug Information Scraper (`vexaloom-labs/webmd-health-condition-and-drug-information`) Actor

Search WebMD's medical-condition and drug reference pages by name and get a plain-language description plus symptoms, body system, drug class, or brand names when WebMD publishes them.

- **URL**: https://apify.com/vexaloom-labs/webmd-health-condition-and-drug-information.md
- **Developed by:** [vexaloom-labs](https://apify.com/vexaloom-labs) (community)
- **Categories:** Automation, Developer tools, Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## WebMD Health Condition & Drug Information Scraper

WebMD publishes consumer-facing reference material on medical conditions and on prescription and over-the-counter medicines. This actor collects those public pages without an account, API key, cookie or login: it searches the A-Z condition topic index, searches WebMD's drug catalogue, browses either collection letter by letter, and opens each matched page to add the details WebMD actually publishes.

### What this actor does

- **Two collections** — `conditions` (medical-condition topics from WebMD's All Health Topics A-Z index) and `drugs` (drug monographs from WebMD's A-Z drug catalogue).
- **Search or browse** — pass a name, brand name or keyword, or leave the query blank and browse one letter at a time.
- **Letter filter and pagination** — the `letter` control restricts work to one A-Z letter, and the actor walks every matching index page (including the two-letter sub-index pages in the drug catalogue) until `maxItems` is reached or the source is exhausted.
- **Drug-type filter** — keep only prescription drugs, only OTC drugs, or both.
- **Detail enrichment** — optionally open each matched page for descriptions, symptom lists, body system, drug class, brand names, availability, dosage forms, treated conditions, common side effects and review metadata.
- **Omit-empty output** — a field appears only when WebMD publishes it for that record; no placeholders or nulls.

### Modes

#### `conditions`

Searches WebMD's All Health Topics index. A keyword filters topic names; the actor scans the A-Z index (or the one letter you choose), then optionally opens each topic page.

#### `drugs`

Searches WebMD's drug catalogue. A keyword uses WebMD's drug search; a blank query browses the A-Z catalogue. The actor walks the letter's sub-index pages (`a/ab`, `a/ac`, …) so long letters are paginated rather than truncated. OTC brand-product pages are skipped; records link to the full drug monograph.

### Output fields

Every record includes `recordType` (`conditions` or `drugs`) and `scrapedAt` (ISO 8601).

#### Condition records

| Field | Description |
|---|---|
| `name` | Topic name as listed in the A-Z index |
| `pageTitle` | Heading shown on the WebMD page |
| `conditionUrl` | Absolute WebMD URL |
| `description` | WebMD's summary of the topic |
| `symptoms` | Symptom list when the page has a Symptoms section |
| `causes` | Causes list when the page has a Causes section |
| `diagnosis` | Diagnosis list when the page has a Diagnosis section |
| `treatment` | Treatment list when the page has a Treatment section |
| `bodySystem` | WebMD section the topic belongs to, e.g. `Skin Problems & Treatments` |
| `writtenBy` | Author named on the page |
| `reviewedBy` | Medical reviewer named on the page |
| `lastReviewed` | Review date in `YYYY-MM-DD` form |

#### Drug records

| Field | Description |
|---|---|
| `name` | Drug name as listed in the catalogue |
| `genericName` | Generic name when WebMD publishes one |
| `brandNames` | Known brand names |
| `drugClass` | Drug class or classes |
| `drugType` | `prescription` or `otc` |
| `description` | Plain-language summary of what the drug is used for |
| `conditionsTreated` | Conditions listed in the "used for" section |
| `commonSideEffects` | Common side effects listed by WebMD |
| `warnings` | Warning and precaution list when WebMD publishes one |
| `interactions` | Interaction notes when WebMD lists them |
| `availability` | Prescription/OTC status and generic availability |
| `dosageForms` | How the drug is taken or supplied |
| `writtenBy` | Author named on the page |
| `reviewedBy` | Medical reviewer named on the page |
| `lastReviewed` | Review date in `YYYY-MM-DD` form |
| `drugUrl` | Absolute WebMD URL |

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | select | `conditions` | `conditions` or `drugs` |
| `searchQuery` | string | – | Name, brand name or keyword; blank browses the A-Z index. The daily prefill uses `diabetes`. |
| `letter` | select | `all` | Restrict to one letter (A–Z) or search all letters |
| `drugType` | select | `all` | `all`, `prescription` or `otc`; ignored in conditions mode |
| `includeDetails` | boolean | `true` | Open matched pages for the detail fields |
| `maxItems` | integer | `20` | Stop after this many records (1–500) |

#### Search a condition

```json
{
  "mode": "conditions",
  "searchQuery": "high blood pressure",
  "letter": "all",
  "includeDetails": true,
  "maxItems": 20
}
```

#### Search a drug by brand name

```json
{
  "mode": "drugs",
  "searchQuery": "Advil",
  "drugType": "otc",
  "includeDetails": true,
  "maxItems": 10
}
```

#### Browse a letter without a query

```json
{
  "mode": "drugs",
  "searchQuery": "",
  "letter": "m",
  "drugType": "prescription",
  "includeDetails": false,
  "maxItems": 100
}
```

### Use cases

- **Patient-education libraries** — build a searchable catalogue of plain-language condition summaries.
- **Medication reference tools** — collect drug class, brand names, availability and dosage forms.
- **Content QA** — compare your own health content with WebMD's current descriptions and review dates.
- **Research inventories** — enumerate WebMD's A-Z condition or drug catalogue by letter.

### Data source and access

All data comes from public WebMD pages: the All Health Topics A-Z index, the drug A-Z index, and the individual condition and drug pages linked from them. No WebMD account, API key or cookie is required. If WebMD blocks a request from the run's network, the actor automatically retries through Apify Proxy; you do not need to configure a proxy.

### Limits and FAQ

**Why does a condition lack `symptoms`?**
Only pages with a distinct Symptoms section expose a symptom list. Health-centre landing pages and some short articles do not, so the field is omitted rather than guessed.

**Why does a drug lack `conditionsTreated` or `brandNames`?**
WebMD uses different monograph layouts for different medicines. Fields the page does not publish are omitted. The same applies to condition `causes`, `diagnosis` and `treatment`: only pages with those sections include them.

**Does the actor return drug interactions and warnings?**
It returns the interaction and warning lists WebMD publishes on each monograph. WebMD describes interaction categories rather than a pair-by-pair severity table, so pair-level interaction data is not available from these pages.

**Are ratings, reviews or pill images included?**
No. Those live on separate review and pill-identification pages and are outside this reference-data actor.

**Are vitamins and supplements included?**
No. `drugs` mode returns drug monographs. WebMD's vitamin and supplement ingredient pages use a different reference system and are out of scope.

**Are OTC product pages included?**
WebMD's drug search also lists product-family pages (for example, "Advil Children's Products"). Those pages are not full monographs and are skipped; the actor keeps the matching monograph (for example, "Ibuprofen (Advil, Caldolor, Motrin)").

**How many records can I get?**
`maxItems` caps a run at 500. The A-Z sources contain thousands of topics and drugs, so use the letter filter to split a large harvest into smaller runs.

**Is this affiliated with WebMD?**
No. This is an independent third-party actor that reads publicly available WebMD pages. It is not affiliated with or endorsed by WebMD LLC.

# Actor input Schema

## `mode` (type: `string`):

Whether to collect medical-condition topics or drug monographs.

## `searchQuery` (type: `string`):

Condition or drug name, brand name, or keyword. Leave blank to browse the A-Z index. Multiple words must all appear in the name.

## `letter` (type: `string`):

Limit results to one A-Z letter. Use All letters to let the search decide where to look.

## `drugType` (type: `string`):

Filter drug results by availability. Ignored in conditions mode.

## `includeDetails` (type: `boolean`):

Open each matched page to add description, symptoms, drug class, brand names, review date and other details. Turn off for a faster index-only run.

## `maxItems` (type: `integer`):

Stop after this many records.

## Actor input object example

```json
{
  "mode": "conditions",
  "searchQuery": "diabetes",
  "letter": "all",
  "drugType": "all",
  "includeDetails": true,
  "maxItems": 1
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset containing all scraped WebMD condition/drug records.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "conditions",
    "searchQuery": "diabetes",
    "letter": "all",
    "drugType": "all",
    "includeDetails": true,
    "maxItems": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("vexaloom-labs/webmd-health-condition-and-drug-information").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "conditions",
    "searchQuery": "diabetes",
    "letter": "all",
    "drugType": "all",
    "includeDetails": True,
    "maxItems": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("vexaloom-labs/webmd-health-condition-and-drug-information").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "conditions",
  "searchQuery": "diabetes",
  "letter": "all",
  "drugType": "all",
  "includeDetails": true,
  "maxItems": 1
}' |
apify call vexaloom-labs/webmd-health-condition-and-drug-information --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,vexaloom-labs/webmd-health-condition-and-drug-information"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/re7p9YaPoByafnaA1/builds/jJGMzuchPTefg5AYq/openapi.json
