# RateMDs Doctor Scraper (`moving_beacon-owner1/ratemds-doctor-scraper`) Actor

RateMDs Doctor Scraper is an Apify Actor that extracts doctor profiles, ratings, specialties, contact details, and practice information from RateMDs.com. It supports both location-based searches and individual doctor profiles, returning clean, structured data without browser automation.

- **URL**: https://apify.com/moving\_beacon-owner1/ratemds-doctor-scraper.md
- **Developed by:** [Jamshaid Arif](https://apify.com/moving_beacon-owner1) (community)
- **Categories:** Developer tools, Lead generation, Other
- **Stats:** 2 total users, 1 monthly users, 50.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $9.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.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## RateMDs Doctor Scraper (Apify Actor)

Scrapes doctor profiles and ratings from RateMDs.com listing pages (server-rendered HTML) — no browser automation. The site's /api/ routes reject anonymous callers, so this actor parses the /best-doctors/ pages instead, using curl\_cffi TLS impersonation + residential proxies to pass Cloudflare. A tiered parser tries embedded page JSON first (richest fields), then JSON-LD, then the rendered HTML cards.

### Modes

**Search mode** — paginated listing pages (`/best-doctors/{state}/{city}/?page=N`):

```json
{
    "mode": "search",
    "location": "tx/houston",
    "specialty": "dentist",
    "maxRecords": 100,
    "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

Location is the state/city path from the listing URL: `ratemds.com/best-doctors/tx/houston/` → `tx/houston` (state alone like `tx` also works; old `us-tx-houston` slugs are auto-converted; a full URL can be pasted). Specialty is the query slug, e.g. `?specialty=dentist` → `dentist`. If the slug is invalid, RateMDs redirects to the global listing — the actor logs a warning when that happens.

**Doctor mode** — fetches individual profile pages (`/doctor-ratings/{slug}/`) and parses embedded JSON or JSON-LD:

```json
{
    "mode": "doctor",
    "doctorIds": ["dr-angelo-ayar-tamarac-fl-us"],
    "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

### Output

Each dataset item is a flat record:

```json
{
    "name": "Dr. Jane Doe",
    "profile_url": "https://www.ratemds.com/doctor-ratings/...",
    "gender": "F",
    "specialty": "Dentist",
    "practice_name": "Smile Clinic",
    "school": "University of Toronto",
    "graduation_year": 2004,
    "street_address": "123 Main St",
    "city": "Toronto",
    "state": "Ontario",
    "state_slug": "ON",
    "country": "Canada",
    "zip_code": "M5V 1A1",
    "phone": "(416) 555-0123",
    "review_count": 42,
    "average_score": 4.6
}
```

Search mode pushes results page-by-page, so partial data survives aborts and timeouts.

# Actor input Schema

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

Search the paginated listing API, or fetch specific doctors by ID/slug.

## `location` (type: `string`):

State/city path from the RateMDs URL, e.g. <code>tx</code>, <code>tx/houston</code>, <code>on/toronto</code> (from ratemds.com/best-doctors/<b>tx/houston</b>/). Old-style slugs like <code>us-tx-houston</code> are auto-converted. You can also paste a full listing URL.

## `specialty` (type: `string`):

Specialty slug, e.g. <code>dentist</code>, <code>family-gp</code>, <code>dermatologist</code>. Copy it from the RateMDs URL. Optional; used in search mode.

## `doctorIds` (type: `array`):

Profile slugs or full profile URLs, e.g. <code>dr-angelo-ayar-tamarac-fl-us</code> or <code>https://www.ratemds.com/doctor-ratings/...</code> (the part after /doctor-ratings/).

## `maxRecords` (type: `integer`):

Stop after this many doctors (search mode).

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

RateMDs sits behind Cloudflare — residential proxies are strongly recommended.

## `cookies` (type: `object`):

Extra cookies to send, e.g. a <code>cf\_clearance</code> value harvested from a browser if you keep getting challenged: <code>{"cf\_clearance": "..."}</code>

## `minDelaySecs` (type: `string`):

Lower bound of the random politeness delay.

## `maxDelaySecs` (type: `string`):

Upper bound of the random politeness delay.

## `impersonate` (type: `string`):

curl\_cffi browser profile used to defeat Cloudflare TLS fingerprinting.

## Actor input object example

```json
{
  "mode": "search",
  "location": "tx/houston",
  "doctorIds": [],
  "maxRecords": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "minDelaySecs": "0.8",
  "maxDelaySecs": "2.0",
  "impersonate": "chrome"
}
```

# 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 = {
    "location": "tx/houston",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("moving_beacon-owner1/ratemds-doctor-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 = {
    "location": "tx/houston",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("moving_beacon-owner1/ratemds-doctor-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "location": "tx/houston",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call moving_beacon-owner1/ratemds-doctor-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=moving_beacon-owner1/ratemds-doctor-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/FkMSVSCKzJgObR4TA/builds/M7ldfLcDsGBCjUQWD/openapi.json
