# Medlineplus Health Topics Scraper (`zerobreak/medlineplus-health-topics-scraper`) Actor

MedlinePlus Health Topics Scraper is a Python tool to extract health topic titles, patient summaries, mapped MeSH vocabulary, category groups, and primary NIH institute sources from the NLM MedlinePlus Web Service and daily XML feeds. It exports  into clean CSV or JSON formats

- **URL**: https://apify.com/zerobreak/medlineplus-health-topics-scraper.md
- **Developed by:** [ZeroBreak](https://apify.com/zerobreak) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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

### MedlinePlus Health Topics Scraper — English and Spanish Consumer Health Information

![MedlinePlus Health Topics Scraper cover](https://images.bigibyte.com/cdn-cgi/image/width=1260,height=540,fit=cover,format=webp/apify-actors-covers/medlineplus-health-topics-scraper-cover.png)

MedlinePlus Health Topics Scraper collects publicly available consumer health information from the US National Library of Medicine's MedlinePlus service. Search health topics in English or Spanish, retrieve detailed topic descriptions and metadata, and export structured results as JSON, CSV, Excel, or other supported Apify dataset formats.

### Features

- **Health topic search:** Find consumer health topics using keywords.
- **English and Spanish support:** Search both English and Spanish topic collections.
- **Detailed topic information:** Collect titles, summaries, alternate titles, organizations, and related medical subject terms.
- **Topic categorization:** Retrieve associated health topic groups.
- **Search result ranking:** Preserve the rank of each matching result.
- **Pagination:** Retrieve multiple search results within the configured collection limit.
- **Collection limits:** Control the number of records with `maxItems`.
- **Flexible exports:** Save results in JSON, CSV, Excel, and other supported formats.

### Collection Mode

| Mode | Description |
|---|---|
| Health topics search | Search English or Spanish MedlinePlus health topics using a keyword. |

### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `term` | String | — | Keyword or phrase used to search health topics. |
| `db` | String | `healthTopics` | Select `healthTopics` for English or `healthTopicsSpanish` for Spanish topics. |
| `retmax` | Integer | — | Number of results requested per search page. |
| `maxItems` | Integer | — | Maximum number of records to collect. |
| `requestDelayMs` | Integer | — | Delay between requests in milliseconds. |

### Example Input

**English health topics**

```json
{
  "term": "diabetes",
  "db": "healthTopics",
  "retmax": 50,
  "maxItems": 25,
  "requestDelayMs": 500
}
```

**Spanish health topics**

```json
{
  "term": "diabetes",
  "db": "healthTopicsSpanish",
  "maxItems": 10,
  "requestDelayMs": 500
}
```

### What Data Does This Actor Extract?

Each search result is converted into a structured dataset record.

| Field | Description |
|---|---|
| `rank` | Position of the topic in the search results. |
| `topicUrl` | Public page URL for the health topic. |
| `topicTitle` | Health topic title. |
| `organizationName` | Organization associated with the topic. |
| `altTitle` | Alternative topic names and related titles. |
| `FullSummary` | Full summary text returned for the topic. |
| `mesh` | Related Medical Subject Headings (MeSH) terms. |
| `groupName` | Associated health topic categories or groups. |
| `snippet` | Short search result description. |
| `scraped_at` | Date and time the record was collected. |

The published topic name is stored as `topicTitle` to avoid reserved dataset field names. The original topic page address is retained as `topicUrl`.

### Example Output

```json
{
  "rank": "2",
  "topicUrl": "https://medlineplus.gov/diabetes.html",
  "topicTitle": "Diabetes",
  "organizationName": "National Library of Medicine",
  "altTitle": "Diabetes Mellitus; Sugar Diabetes; DM",
  "FullSummary": "What is diabetes? Diabetes, also known as diabetes mellitus, is a disease in which your blood glucose, or blood sugar, levels are too high...",
  "mesh": "Diabetes Mellitus",
  "groupName": "Older Adults; Endocrine System; Metabolic Problems",
  "snippet": "What is diabetes? Diabetes, also known as diabetes mellitus, is a disease in which your blood glucose, or blood sugar, levels are too high...",
  "scraped_at": "2026-10-26T00:00:00+00:00"
}
```

### Use Cases

- **Health research:** Discover consumer health information related to specific medical topics.
- **Content research:** Organize health topic summaries and related terminology.
- **Healthcare applications:** Build searchable collections of public health information.
- **Medical topic discovery:** Explore related MeSH terms and health categories.
- **Dataset building:** Create structured English or Spanish health topic collections.
- **Educational resources:** Organize reliable consumer health information for educational projects.

### Working with Your Dataset

After the actor finishes:

1. Open the **Dataset** tab in your Apify run.
2. Review the collected health topic records.
3. Export the results as JSON, CSV, Excel, or another supported format.
4. Use the exported information for research, analysis, or content organization.

### FAQ

**Who is this actor for?**

It is designed for researchers, health writers, educators, product teams, and developers who need structured consumer health topic information.

**Can I search in Spanish?**

Yes. Set `db` to `healthTopicsSpanish` to search Spanish health topics.

**Can I search for a specific medical topic?**

Yes. Enter a keyword or phrase in the `term` parameter, such as `diabetes`.

**Does the dataset include full topic summaries?**

The actor collects the summary information returned for each matching topic, along with available metadata.

**Can I run recurring collections?**

Yes. You can configure Apify Schedules to refresh your selected health topic searches automatically.

**Which export formats are supported?**

You can export the dataset as JSON, CSV, Excel, and other formats supported by Apify.

### Disclaimer

This actor is an independent tool and is not affiliated with, endorsed by, sponsored by, or officially associated with MedlinePlus or the US National Library of Medicine. It collects publicly available information. Users are responsible for complying with applicable data-use terms, attribution requirements, and licensing conditions. Health information is provided for research and informational purposes and should not replace professional medical advice.

### Is Web Scraping Legal?

Collecting information that is already public is generally legal. There is no single law that bans all forms of web scraping. The limits are the usual ones: do not break into accounts, do not take private or confidential data, and be careful with personal data and copyrighted works. A site's terms can also restrict how you access it. Facts such as a public name, price, or rating are not the same thing as republishing someone's article or photo.

This actor collects information from public pages. It does not log in and it does not bypass access controls.

For a longer explanation, see Apify's article [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

## `term` (type: `string`):

Health topic search term sent to the MedlinePlus web service.

## `db` (type: `string`):

MedlinePlus database. Use healthTopics or healthTopicsSpanish.

## `retmax` (type: `integer`):

How many documents to request per page (MedlinePlus retmax).

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

Stop after this many successful rows. Hard max is 1000.

## `requestDelayMs` (type: `integer`):

Polite pacing in milliseconds. MedlinePlus allows about 85 requests per minute.

## `userAgent` (type: `string`):

User-Agent header sent with each request.

## `timeoutSecs` (type: `integer`):

Overall run budget in seconds.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout in seconds.

## `proxyConfiguration` (type: `object`):

Optional proxy. Leave off unless you need it.

## Actor input object example

```json
{
  "term": "diabetes",
  "db": "healthTopics",
  "retmax": 50,
  "maxItems": 100,
  "requestDelayMs": 500,
  "userAgent": "ActorResearch/1.0",
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Dataset rows in the overview table.

## `dataset` (type: `string`):

Full dataset for this run.

## `items` (type: `string`):

Dataset items as JSON.

# 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 = {
    "term": "diabetes",
    "db": "healthTopics",
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("zerobreak/medlineplus-health-topics-scraper").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 = {
    "term": "diabetes",
    "db": "healthTopics",
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("zerobreak/medlineplus-health-topics-scraper").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 '{
  "term": "diabetes",
  "db": "healthTopics",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call zerobreak/medlineplus-health-topics-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zerobreak/medlineplus-health-topics-scraper"
        }
    }
}
```

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/xcwIeNoL88d6ejkxH/builds/b5UxKL3prTY7Ao2YB/openapi.json
