# Healthline Article Scraper - Text, Authors & Medical Review (`xtracto/healthline-article-scraper`) Actor

Scrape Healthline articles: headline, full body text, authors, publication and modification dates, keywords and section — plus the medical reviewer and last-reviewed date, which is what makes health content auditable. HTTP-only, no account.

- **URL**: https://apify.com/xtracto/healthline-article-scraper.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 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

## Healthline Article Scraper — Text, Authors & Medical Review

Scrape Healthline articles: headline, **full body text**, authors, dates, keywords — plus the
**medical reviewer and last-reviewed date**, which is what makes health content auditable.
HTTP-only, no account, no browser.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `articleUrls` | array | *required* | Healthline article URLs |
| `maxRounds` | integer | `2` | TLS ladder repeats on a refused page |
| `maxConcurrency` | integer | `4` | Articles in parallel |
| `proxyConfiguration` | object | Apify proxy | Optional — a bare IP answered in testing |

### Output

```jsonc
{
  "_input": "https://www.healthline.com/health/type-2-diabetes",
  "_source": "S1-jsonld+article",
  "_scrapedAt": "2026-09-08T…Z",

  "url": "https://www.healthline.com/health/type-2-diabetes",
  "headline": "Understanding Type 2 Diabetes",
  "description": "Everything you've wanted to know about type 2 diabetes…",
  "authors": ["Ann Pietrangelo"],
  "reviewedBy": ["Alana Biggers, M.D., MPH"],
  "lastReviewed": "2025-06-27T10:17:00Z",
  "datePublished": "2020-06-17T09:49:00Z",
  "dateModified": "…",
  "articleSection": "Uncategorized",
  "keywords": "…",

  "bodyText": "Heart disease is the leading cause of death…",
  "wordCount": 644,
  "paragraphCount": 22,
  "headings": ["Symptoms", "Causes", …],
  "otherSchemaTypes": ["VideoObject", "MedicalCondition"]
}
```

Failure rows carry `_error` (`not_found`, `bad_input`, `blocked`, `unexpected_shape`) and no payload.

### How it works

Metadata comes from the page's `MedicalWebPage` JSON-LD node; the body is read from the rendered
`<article>` element, because Healthline does **not** put `articleBody` in the JSON-LD.

**Body text is joined with a separator, deliberately.** Reading paragraph text without one
concatenates inline elements: `According to the <a>Centers for Disease Control</a>` comes out as
`According to theCenters`. The result still reads as prose, which is exactly why that bug survives
a casual look at the output — so paragraphs are extracted with an explicit space separator and the
result was checked for glued-word artefacts (zero remaining).

**A 404 here is not small.** A missing article still returns ~148 KB of site chrome, so neither a
200 nor a large body proves anything. The actor requires both a JSON-LD block and an `<article>`
element before it will parse, and reports `not_found` otherwise.

### Known limits

| Limit | Detail |
|---|---|
| Not every article is medically reviewed | `reviewedBy` and `lastReviewed` were present on 2 of 3 test articles — that reflects the source, not a parse failure |
| `articleSection` is often "Uncategorized" | Passed through as Healthline publishes it |
| No comments | Healthline does not publish reader comments |
| URLs only | There is no search or sitemap crawl here — supply the article URLs you want |

# Actor input Schema

## `articleUrls` (type: `array`):

Healthline article URLs, e.g. https://www.healthline.com/health/type-2-diabetes. One row is emitted per entry, including for failures.

## `maxRounds` (type: `integer`):

How many times to repeat the TLS profile ladder on a refused page.

## `maxConcurrency` (type: `integer`):

Articles fetched in parallel.

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

Optional. A bare IP answered in testing; use a proxy for sustained volume.

## Actor input object example

```json
{
  "articleUrls": [
    "https://www.healthline.com/nutrition/vitamin-d-101"
  ],
  "maxRounds": 2,
  "maxConcurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `articles` (type: `string`):

Dataset items shown in the 'Articles' view.

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

Every record this run produced, with all fields, 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 = {
    "articleUrls": [
        "https://www.healthline.com/health/type-2-diabetes"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/healthline-article-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 = { "articleUrls": ["https://www.healthline.com/health/type-2-diabetes"] }

# Run the Actor and wait for it to finish
run = client.actor("xtracto/healthline-article-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 '{
  "articleUrls": [
    "https://www.healthline.com/health/type-2-diabetes"
  ]
}' |
apify call xtracto/healthline-article-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xtracto/healthline-article-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/mcgZ8cGG6NP8OQsvu/builds/xA6cONHxjRxcwAoii/openapi.json
