# Doctolib scraper (`codingfrontend/doctolib-scraper`) Actor

Extract medical professionals data from Doctolib.fr, Doctolib.it, and Doctolib.de. Scrapes doctor profiles, contact information, specializations, and clinic details across France, Italy, and Germany. Supports multiple cities, professions, and automated pagination with structured JSON output.

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

## Pricing

from $3.99 / 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.

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

### What this Doctolib scraper does

This Actor extracts public medical professional and clinic information from Doctolib.fr, Doctolib.it, and Doctolib.de pages. It reads public HTML and JSON-LD only; it never logs in, books appointments, solves human checks, or requests patient information.

Normal rows contain `sourceId`, `name`, `specialty`, `address`, `telephone`, `city`, `country`, `url`, `canonicalUrl`, `sourceUrl`, `sourceDomain`, and `scrapedAt`. Opt-in reader rows additionally carry `provenance=public-doctolib-reader` and `readerUrl`. They omit row-type, extraction, transport, and run instrumentation fields. When a page cannot be read or contains no public professional evidence, the Actor emits a diagnostic row with `recordType: "diagnostic"`, `diagnosticType`, source provenance, `url`, `error`, `errorCode`, and `scrapedAt`.

### Input

`startUrls` accepts doctor, clinic, specialty, city, and search pages on the three supported country domains. The compatibility aliases `urls`, `searchUrls`, and `url` are also accepted. Each URL must use HTTPS and a Doctolib.fr, Doctolib.it, or Doctolib.de hostname.

| Field | Default | Limits |
| --- | --- | --- |
| `startUrls` | `https://www.doctolib.fr/` | At most 20 public URLs |
| `maxItems` | `20` | 1–200 normal professional rows |
| `followProfileLinks` | `true` | Bounded enrichment of discovered profile links |
| `maxRequests` | `20` | Listing plus profile requests |
| `requestTimeoutSecs` | `30` | 5–120 seconds per request |

The Actor uses HTTPS requests with a descriptive user agent and does not bypass access controls. `proxyConfiguration` optionally enables standard Apify Proxy routing for public requests; `publicReaderFallback` optionally performs a bounded reader request after that source attempt, using the supplied official public URL and an explicitly labeled Jina Reader representation. `OUTPUT_SUMMARY` reports source/reader counts and preserves the original boundary in `fallbackEvidence`. A non-success response, Cloudflare/human-check page, timeout, or empty public page becomes an explicit diagnostic rather than a fabricated professional.

### Example input

```json
{
  "startUrls": [
    { "url": "https://www.doctolib.fr/cardiologue/paris" },
    { "url": "https://www.doctolib.it/cardiologo/roma" }
  ],
  "maxItems": 25,
  "maxRequests": 30,
  "followProfileLinks": true,
  "requestTimeoutSecs": 30
}
```

### Output

Normal rows contain only public business fields plus source provenance. Diagnostic rows use the shape below:

```json
{
  "recordType": "diagnostic",
  "diagnosticType": "ACCESS_BOUNDARY",
  "url": "https://www.doctolib.fr/cardiologue/paris",
  "sourceUrl": "https://www.doctolib.fr/cardiologue/paris",
  "error": "access_restricted_http_403",
  "errorCode": "ACCESS_RESTRICTED",
  "scrapedAt": "2026-09-10T00:00:00.000Z"
}
```

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel. The Actor's `OUTPUT_SUMMARY` key-value entry contains the local run summary with counts, request usage, duplicates, and dropped-record reasons and is mirrored to the legacy `OUTPUT` key.

### Local development

```bash
npm install
npm test
npm run lint
npm run validate
npm run check
```

For a local fixture run, set `APIFY_LOCAL_STORAGE_DIR` to an isolated directory and use `test/fixtures/doctolib-page.html` with a small JSON input. The repository's local contract test covers JSON-LD parsing, aliases, schema-safe sanitization, diagnostic shape, and Cloudflare classification.

### Responsible use

Doctolib pages can contain personal and professional information protected by GDPR and other laws. Use public directory data for a legitimate, lawful purpose, keep request budgets modest, respect the site's terms and robots guidance, and do not use this Actor for patient profiling, appointment activity, or access-control circumvention.

# Actor input Schema

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

Doctor, specialty, city, or search pages on Doctolib.fr, Doctolib.it, or Doctolib.de.

## `urls` (type: `array`):

Compatibility alias for startUrls. When supplied alongside the default start URL, these URLs are used.

## `searchUrls` (type: `array`):

Compatibility alias for startUrls.

## `url` (type: `string`):

Compatibility alias for one public Doctolib URL.

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

Maximum doctor or clinic records emitted across all pages.

## `followProfileLinks` (type: `boolean`):

Fetch a bounded number of public profile links discovered on search pages.

## `maxRequests` (type: `integer`):

Bound listing and profile requests.

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

Maximum wait for each public request.

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

Optional standard Apify Proxy configuration for public Doctolib requests; no access-control bypass is attempted.

## `publicReaderFallback` (type: `boolean`):

After a bounded direct/standard Proxy failure, optionally read the supplied official public profile through the explicitly labeled Jina Reader representation; no login, CAPTCHA, or access-control bypass is attempted.

## `testMode` (type: `boolean`):

Read a local fixture instead of the network. Use only for local QA.

## `fixtureFile` (type: `string`):

Relative local HTML fixture path; testMode must be true.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.doctolib.fr/"
    }
  ],
  "maxItems": 20,
  "followProfileLinks": true,
  "maxRequests": 20,
  "requestTimeoutSecs": 30,
  "publicReaderFallback": false,
  "testMode": false
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

No description

## `legacySummary` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("codingfrontend/doctolib-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("codingfrontend/doctolib-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 '{}' |
apify call codingfrontend/doctolib-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,codingfrontend/doctolib-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/69a6vZEkKkcXi3krp/builds/2hUIjuJ7iG8RJbc7c/openapi.json
