# PsychologyToday Therapist Extractor (`kawsar/psychologytoday-therapist-extractor`) Actor

PsychologyToday therapist scraper that pulls therapist profiles with specialties, insurance, contact details, and session formats from psychologytoday.com, so healthcare recruiters and mental health directories get clean lead data without clicking through profiles manually.

- **URL**: https://apify.com/kawsar/psychologytoday-therapist-extractor.md
- **Developed by:** [Kawsar](https://apify.com/kawsar) (community)
- **Categories:** Lead generation, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

### PsychologyToday Therapist Extractor

A professional Apify actor for extracting structured therapist profile data from PsychologyToday.com. This actor is designed to produce clean JSON records for directory listings and profile pages without exposing internal scraping service details.

### Overview

This actor collects therapist information from Psychology Today's directory, including contact details, licensing, specialties, therapy modalities, availability, and profile summaries. It supports both listing-mode extraction and full-profile scraping, depending on your needs.

### Features

- Extracts therapist directory cards and full profile details
- Supports location-based search by city/state or ZIP code
- Handles pagination automatically
- Cleans output by removing empty fields
- Produces rich, structured JSON records suitable for CRM, analytics, or research
- Keeps service configuration private and does not expose secret scraping backend details in the README

### Extracted fields

Each record may include the following fields when available:

- `name`
- `profileUrl`
- `photoUrl`
- `credentials`
- `licenseType`
- `licenseNumber`
- `location`
- `zipCode`
- `phone`
- `websiteUrl`
- `yearsInPractice`
- `specialties`
- `issuesTreated`
- `therapyTypes`
- `insuranceAccepted`
- `costPerSession`
- `clientTypes`
- `languages`
- `sessionFormats`
- `lgbtqAffirming`
- `bioSnippet`
- `therapistBio`
- `education`
- `officeAddress`
- `scrapedAt`
- `error`

### Inputs

This actor accepts structured input parameters to control the search and extraction behavior.

#### Example parameters

```json
{
  "searchLocation": "New York, NY",
  "specialty": "Anxiety",
  "insurance": "Aetna",
  "maxItems": 50
}
````

#### Common input fields

- `searchLocation` (string, required): City and state or ZIP code, for example `"New York, NY"` or `"10027"`
- `specialty` (string, optional): Filter therapists by specialty
- `insurance` (string, optional): Filter therapists by accepted insurance plans
- `issueFilter` (string, optional): Filter by issue area such as `"LGBTQ+"`, `"Addiction"`, or `"Grief"`
- `therapyType` (string, optional): Filter by therapy modality such as `"CBT"`, `"EMDR"`, or `"DBT"`
- `maxItems` (integer, optional): Maximum number of profiles to extract (default depends on actor settings)

### Output format

The actor yields JSON records, one per therapist. Records are cleaned to remove empty values so the output remains compact and easy to consume.

#### Example output

```json
{
  "name": "Jane Smith, LCSW",
  "profileUrl": "https://www.psychologytoday.com/us/therapists/jane-smith-lcsw/new-york/123456",
  "photoUrl": "https://cdn.psychologytoday.com/assets/therapy-directory/profiles/123456.jpg",
  "location": "New York, NY",
  "zipCode": "10001",
  "phone": "(212) 555-0100",
  "websiteUrl": "https://www.janesmith-therapy.com",
  "licenseType": "LCSW",
  "yearsInPractice": 12,
  "specialties": ["Anxiety", "Depression", "Trauma"],
  "issuesTreated": ["Anxiety", "PTSD", "Work Stress"],
  "therapyTypes": ["Cognitive Behavioral Therapy (CBT)", "EMDR", "Mindfulness"],
  "insuranceAccepted": ["Aetna", "Blue Cross Blue Shield", "Cigna"],
  "costPerSession": "$150-$200",
  "clientTypes": ["Adults", "Couples"],
  "languages": ["English", "Spanish"],
  "sessionFormats": ["In-person", "Online"],
  "lgbtqAffirming": true,
  "therapistBio": "I specialize in anxiety, depression, and trauma using evidence-based approaches...",
  "education": ["MSW, Columbia University", "BA, NYU"],
  "officeAddress": "123 Main St, New York, NY 10001",
  "scrapedAt": "2026-05-24T12:00:00+00:00"
}
```

### Deployment

- Configure the actor input according to your search criteria.
- Ensure the required service credentials are provided through secure environment variables.
- Run the actor to collect therapist records.

> Sensitive configuration values are managed outside of the repository and are not documented here.

### Use cases

- Build therapist directories and lead lists
- Collect provider availability and specialty coverage data
- Analyze regional mental health resources
- Enrich healthcare CRM and outreach systems
- Support academic or market research

### Notes

- The actor is designed to work with Psychology Today's public therapist directory.
- Output is intentionally cleaned to remove null or empty values.
- If a profile cannot be scraped, the actor includes an `error` field for that record.

### Support

If you need help or want to extend this actor, review `src/main.py` for the scraping logic and the expected output fields.

# Actor input Schema

## `directoryCategory` (type: `string`):

Category of mental health professionals to extract from the directory.

## `usStates` (type: `array`):

One or more locations to search. Use the format 'state-abbr/city' for city-level results, e.g. 'ny/new-york', 'ca/los-angeles', 'tx/houston', 'fl/miami'. You can also use state-only slugs like 'new-york' or 'california'.

## `scrapeMode` (type: `string`):

List page only (fast) extracts all visible data directly from listing cards without visiting individual profiles. Full profile (detailed) visits each profile page for complete data including specialties, insurance, therapy types, education, and more.

## `maxProfiles` (type: `integer`):

Maximum total number of therapist profiles to extract across all selected locations.

## `minDelayMs` (type: `integer`):

Minimum wait time in milliseconds between consecutive requests. Helps avoid rate limiting.

## `maxDelayMs` (type: `integer`):

Maximum wait time in milliseconds between consecutive requests. Actual delay is randomized between min and max.

## `autoRetry` (type: `boolean`):

Automatically retry failed requests when access is temporarily blocked. Up to 3 attempts per request.

## Actor input object example

```json
{
  "directoryCategory": "Therapists",
  "usStates": [
    "ny/new-york",
    "ca/los-angeles",
    "tx/houston"
  ],
  "scrapeMode": "list",
  "maxProfiles": 10,
  "minDelayMs": 800,
  "maxDelayMs": 1500,
  "autoRetry": true
}
```

# 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 = {
    "directoryCategory": "Therapists",
    "usStates": [
        "ny/new-york"
    ],
    "scrapeMode": "list"
};

// Run the Actor and wait for it to finish
const run = await client.actor("kawsar/psychologytoday-therapist-extractor").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 = {
    "directoryCategory": "Therapists",
    "usStates": ["ny/new-york"],
    "scrapeMode": "list",
}

# Run the Actor and wait for it to finish
run = client.actor("kawsar/psychologytoday-therapist-extractor").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 '{
  "directoryCategory": "Therapists",
  "usStates": [
    "ny/new-york"
  ],
  "scrapeMode": "list"
}' |
apify call kawsar/psychologytoday-therapist-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=kawsar/psychologytoday-therapist-extractor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "PsychologyToday Therapist Extractor",
        "description": "PsychologyToday therapist scraper that pulls therapist profiles with specialties, insurance, contact details, and session formats from psychologytoday.com, so healthcare recruiters and mental health directories get clean lead data without clicking through profiles manually.",
        "version": "0.0",
        "x-build-id": "tYvy4HwRpD3nrln9s"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/kawsar~psychologytoday-therapist-extractor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-kawsar-psychologytoday-therapist-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/kawsar~psychologytoday-therapist-extractor/runs": {
            "post": {
                "operationId": "runs-sync-kawsar-psychologytoday-therapist-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/kawsar~psychologytoday-therapist-extractor/run-sync": {
            "post": {
                "operationId": "run-sync-kawsar-psychologytoday-therapist-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "usStates"
                ],
                "properties": {
                    "directoryCategory": {
                        "title": "Directory category",
                        "enum": [
                            "Therapists",
                            "Psychiatrists",
                            "Treatment Centers",
                            "Support Groups"
                        ],
                        "type": "string",
                        "description": "Category of mental health professionals to extract from the directory.",
                        "default": "Therapists"
                    },
                    "usStates": {
                        "title": "US states",
                        "type": "array",
                        "description": "One or more locations to search. Use the format 'state-abbr/city' for city-level results, e.g. 'ny/new-york', 'ca/los-angeles', 'tx/houston', 'fl/miami'. You can also use state-only slugs like 'new-york' or 'california'.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "scrapeMode": {
                        "title": "Scrape mode",
                        "enum": [
                            "list",
                            "full"
                        ],
                        "type": "string",
                        "description": "List page only (fast) extracts all visible data directly from listing cards without visiting individual profiles. Full profile (detailed) visits each profile page for complete data including specialties, insurance, therapy types, education, and more.",
                        "default": "list"
                    },
                    "maxProfiles": {
                        "title": "Maximum profiles to return",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum total number of therapist profiles to extract across all selected locations.",
                        "default": 10
                    },
                    "minDelayMs": {
                        "title": "Minimum delay between requests (ms)",
                        "minimum": 0,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Minimum wait time in milliseconds between consecutive requests. Helps avoid rate limiting.",
                        "default": 800
                    },
                    "maxDelayMs": {
                        "title": "Maximum delay between requests (ms)",
                        "minimum": 0,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum wait time in milliseconds between consecutive requests. Actual delay is randomized between min and max.",
                        "default": 1500
                    },
                    "autoRetry": {
                        "title": "Auto-retry via proxy when blocked",
                        "type": "boolean",
                        "description": "Automatically retry failed requests when access is temporarily blocked. Up to 3 attempts per request.",
                        "default": true
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
