# Healthgrades Provider Scraper (`daftvader/healthgrades-scraper`) Actor

Collect public Healthgrades provider listings and profile details with filters and bounded enrichment.

- **URL**: https://apify.com/daftvader/healthgrades-scraper.md
- **Developed by:** [Sam Towers](https://apify.com/daftvader) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.50 / 1,000 provider-scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Healthgrades scraper

Collect public Healthgrades provider listings and profile details without a browser or login. Results are written to the default dataset and can be filtered by rating, reviews, sponsorship, and phone availability.

### Functional input

Supply either `startUrls` (Healthgrades directory/search URLs) or a grid of non-empty `specialties` and `locations`. Main options are `maxItems` (default 200), `maxPagesPerSearch` (10), `includeProviderDetails` (true), `excludeSponsored`, `minRating`, `minReviewCount`, `requirePhone`, `maxConcurrency` (maximum 5), `requestDelaySeconds`, `maxRetries`, and optional `proxyUrl`.

```json
{"specialties":["Cardiology"],"locations":["Miami, FL"],"maxItems":20,"requirePhone":true}
```

### Functional output and charging

The CLI emits one JSON object per accepted, deduplicated provider. Records include provider/profile identity, listing rating and review data, enrichment fields where available, `detailFetched`, search/page/source/time provenance, and `billableEvent: "provider-scraped"`. The successful row-emission callback is the only billable boundary: duplicates and rows removed by filters are never emitted or counted. If a later request fails, previously emitted rows remain valid billable deliveries.

```bash
python -m healthgrades_scraper.cli input.json > providers.jsonl
```

On Apify, configure the same JSON fields in the Actor input. Each delivered unique provider row is charged as one `provider-scraped` event at the configured pay-per-event price. Duplicate, filtered, or undelivered rows are not charged.

Profile enrichment uses JSON-LD plus DOM fields, paces requests, retries refused/transient requests on a fresh connection, and marks an unsuccessfully enriched row with `detailFetched: false`. Use `requirePhone` when incomplete or phone-free rows must be excluded.

The source is public Healthgrades HTML and may rate-limit high request volume. Keep concurrency and request rates bounded; use a proxy only when direct requests are blocked. The scraper does not require login and does not guarantee that every profile exposes every detail.

### Development

```bash
python -m pytest -q
```

# Actor input Schema

## `specialties` (type: `array`):

Specialties to search when start URLs are not supplied.

## `locations` (type: `array`):

Locations paired with specialties when start URLs are not supplied.

## `startUrls` (type: `array`):

Optional public Healthgrades directory URLs.

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

Maximum number of unique provider rows to deliver.

## `maxPagesPerSearch` (type: `integer`):

Maximum directory pages to fetch for each search.

## `includeProviderDetails` (type: `boolean`):

Fetch and include provider profile details when available.

## `excludeSponsored` (type: `boolean`):

Exclude sponsored directory results from the output.

## `minRating` (type: `number`):

Keep providers whose rating meets this minimum.

## `minReviewCount` (type: `integer`):

Keep providers with at least this many reviews.

## `requirePhone` (type: `boolean`):

Keep only rows with an available phone number.

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

Maximum number of concurrent requests.

## `requestDelaySeconds` (type: `number`):

Delay between requests to reduce rate limiting.

## `maxRetries` (type: `integer`):

Maximum retries for refused or transient requests.

## `proxyUrl` (type: `string`):

Optional proxy URL for environments where direct requests are blocked.

## Actor input object example

```json
{
  "specialties": [
    "Cardiology"
  ],
  "locations": [
    "Miami, FL"
  ],
  "maxItems": 2,
  "maxPagesPerSearch": 1,
  "includeProviderDetails": true,
  "excludeSponsored": true,
  "minReviewCount": 0,
  "requirePhone": false,
  "maxConcurrency": 2,
  "requestDelaySeconds": 0.5,
  "maxRetries": 2
}
```

# Actor output Schema

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

No description

# 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 = {
    "specialties": [
        "Cardiology"
    ],
    "locations": [
        "Miami, FL"
    ],
    "maxItems": 2,
    "maxPagesPerSearch": 1,
    "includeProviderDetails": true,
    "excludeSponsored": true,
    "minReviewCount": 0,
    "requirePhone": false,
    "maxConcurrency": 2,
    "requestDelaySeconds": 0.5,
    "maxRetries": 2
};

// Run the Actor and wait for it to finish
const run = await client.actor("daftvader/healthgrades-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 = {
    "specialties": ["Cardiology"],
    "locations": ["Miami, FL"],
    "maxItems": 2,
    "maxPagesPerSearch": 1,
    "includeProviderDetails": True,
    "excludeSponsored": True,
    "minReviewCount": 0,
    "requirePhone": False,
    "maxConcurrency": 2,
    "requestDelaySeconds": 0.5,
    "maxRetries": 2,
}

# Run the Actor and wait for it to finish
run = client.actor("daftvader/healthgrades-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 '{
  "specialties": [
    "Cardiology"
  ],
  "locations": [
    "Miami, FL"
  ],
  "maxItems": 2,
  "maxPagesPerSearch": 1,
  "includeProviderDetails": true,
  "excludeSponsored": true,
  "minReviewCount": 0,
  "requirePhone": false,
  "maxConcurrency": 2,
  "requestDelaySeconds": 0.5,
  "maxRetries": 2
}' |
apify call daftvader/healthgrades-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,daftvader/healthgrades-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/AZIpGo47HKZe3hCFc/builds/hpePxqQ6DZBJMQpRS/openapi.json
