# ClinicalTrials.gov Protocol & Recruitment Intelligence Scraper (`slavako/clinicaltrials-gov-scraper`) Actor

Scrape official US ClinicalTrials.gov study registries: clinical trial phases, conditions, drug interventions, eligibility, and recruitment locations.

- **URL**: https://apify.com/slavako/clinicaltrials-gov-scraper.md
- **Developed by:** [Sviatoslav](https://apify.com/slavako) (community)
- **Categories:** Business, Developer tools, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 clinical trial records

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

## ClinicalTrials.gov Protocol & Recruitment Intelligence Scraper

Scrape official US ClinicalTrials.gov study registries (U.S. National Library of Medicine / NIH) with **100% zero API key requirements**.

Track clinical trial phases, medical conditions, experimental drugs, sponsor organizations, recruitment locations, and patient eligibility criteria in clean, structured JSON.

***

### 🌟 Key Features

- **Direct NIH / NLM API v2 Integration**: Access official, real-time records from the world's largest clinical trial registry.
- **Flexible Medical & Drug Search**: Search by condition (e.g. `oncology`, `diabetes`, `alzheimer`), drug / compound name (e.g. `pembrolizumab`, `semaglutide`), or sponsor institution.
- **Recruitment Status Filters**: Filter by `RECRUITING`, `NOT_YET_RECRUITING`, `ACTIVE_NOT_RECRUITING`, `COMPLETED`, or `TERMINATED`.
- **Deep Protocol Metadata**: Extracts trial phases (Phase 1 through Phase 4), study type, intervention arms, and detailed descriptions.
- **Patient Eligibility Breakdown**: Capture inclusion/exclusion criteria, gender, minimum/maximum age limits, and healthy volunteer status.
- **Study Site Locations**: Facility names, cities, states, and countries where the trial is actively conducted.
- **128 MB RAM & Zero-Cost Architecture**: Runs as a lightweight HTTP micro-scraper without paid proxies or residential IP requirements.

***

### 📥 Input Configuration

| Parameter | Type | Default | Description |
|---|---|---|---|
| `query` | String | `"diabetes"` | Disease, condition, drug name, or sponsor to search. |
| `overallStatus` | Array | `["RECRUITING"]` | Statuses to filter (`RECRUITING`, `COMPLETED`, etc.). |
| `maxResults` | Integer | `20` | Max trial records to retrieve (1 to 200). |
| `includeEligibility` | Boolean | `true` | Include patient eligibility criteria. |
| `includeLocations` | Boolean | `true` | Include hospital/facility trial locations. |

#### Example Input

```json
{
  "query": "oncology pembrolizumab",
  "overallStatus": ["RECRUITING"],
  "maxResults": 15,
  "includeEligibility": true,
  "includeLocations": true
}
```

***

### 📤 Output Format

Each dataset record contains structured study protocol information:

```json
{
  "nctId": "NCT03856515",
  "url": "https://clinicaltrials.gov/study/NCT03856515",
  "briefTitle": "Gender Differences in Switching From Regular Cigarettes to E-Cigarettes",
  "officialTitle": "Gender Differences in Standardized Research E-Cigarette Product Use",
  "overallStatus": "RECRUITING",
  "leadSponsor": "M.D. Anderson Cancer Center",
  "sponsorClass": "OTHER",
  "studyType": "INTERVENTIONAL",
  "phases": ["PHASE2"],
  "conditions": ["Tobacco Use Disorder", "Nicotine Dependence"],
  "interventions": [
    {
      "type": "BEHAVIORAL",
      "name": "E-Cigarette Substitution Protocol",
      "description": "Standardized research vapor protocol."
    }
  ],
  "briefSummary": "This randomized trial investigates gender differences in nicotine dependence symptoms...",
  "startDate": "2022-06-02",
  "completionDate": "2026-06-01",
  "eligibility": {
    "criteria": "Inclusion Criteria:\n- Age 21 or older\n- Regular daily smoker...",
    "healthyVolunteers": true,
    "sex": "ALL",
    "minimumAge": "21 Years",
    "maximumAge": "65 Years"
  },
  "locationsCount": 3,
  "locations": [
    {
      "facility": "MD Anderson Cancer Center",
      "city": "Houston",
      "state": "Texas",
      "country": "United States",
      "status": "RECRUITING"
    }
  ],
  "scrapedAt": "2026-11-22T18:00:00.000Z",
  "dataSource": "ClinicalTrials.gov Public API v2 (U.S. NIH/NLM)"
}
```

***

### 💡 Use Cases

- **Biotech & Pharma Competitive Intelligence**: Monitor competitor clinical trial pipelines, drug phases, and completion milestones.
- **Clinical Research Organizations (CROs)**: Identify patient recruitment bottlenecks and active trial study sites.
- **Healthcare AI & RAG**: Feed accurate, up-to-date medical trial data into healthcare knowledge graphs and patient-matching models.

# Actor input Schema

## `query` (type: `string`):

Medical condition, drug name, sponsor, or keyword to search (e.g. diabetes, oncology, pembrolizumab, GLP-1).

## `overallStatus` (type: `array`):

Filter by clinical trial recruitment status.

## `maxResults` (type: `integer`):

Maximum number of study records to retrieve (1 to 200).

## `includeEligibility` (type: `boolean`):

Include patient eligibility criteria (gender, age limits, inclusion/exclusion rules).

## `includeLocations` (type: `boolean`):

Include medical centers, hospital facilities, cities, and countries conducting the trial.

## Actor input object example

```json
{
  "query": "diabetes",
  "overallStatus": [
    "RECRUITING"
  ],
  "maxResults": 20,
  "includeEligibility": true,
  "includeLocations": true
}
```

# Actor output Schema

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

Extracted clinical trial study protocols, recruitment statuses, interventions, and eligibility criteria.

# 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("slavako/clinicaltrials-gov-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("slavako/clinicaltrials-gov-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 slavako/clinicaltrials-gov-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,slavako/clinicaltrials-gov-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/FcfFktuOvsLcqDEDX/builds/wp3LKp2lXb6qEsgHM/openapi.json
