# ClinicalTrials.gov Scraper (Trials, Sponsors & Investigators) (`cblu/clinical-trials-scraper`) Actor

Search ClinicalTrials.gov (official NIH API v2): filter by condition, intervention, phase, status, sponsor type, and site location. Flat JSON with sponsor, sites, and named principal investigators with contacts. Pay per study.

- **URL**: https://apify.com/cblu/clinical-trials-scraper.md
- **Developed by:** [Steven Carleton](https://apify.com/cblu) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 study records

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/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

## ClinicalTrials.gov Scraper — Trials, Sponsors, Sites & Investigators API

Search and export **clinical study records from the official ClinicalTrials.gov API** — the US National Library of Medicine's registry of clinical trials worldwide. Get the **NCT number, title, status, phase, study type, enrollment, conditions, interventions, lead sponsor and sponsor class, central contacts (phone + email), overall officials, and every study site with its principal investigators**. Filter by **condition, intervention, sponsor, location, recruitment status, phase, study type, and sponsor class**, then download clean JSON, CSV, or Excel.

This Actor reads the **official ClinicalTrials.gov API v2** (`clinicaltrials.gov/api/v2`) — **no login, no API key** — and returns **flattened, normalized records** instead of the registry's deeply nested JSON. Most "clinical trials" scrapers either dump the raw nested payload or stop at the summary; this one extracts the parts that matter for outreach and intelligence — **sponsor, site facilities, and named principal investigators with their contact details** — into flat fields you can filter and merge.

### What data do you get?

One result per clinical study:

| Field | Example |
|---|---|
| `nctId` / `studyUrl` | `NCT06739122` + direct study link |
| `title` / `officialTitle` / `acronym` | Brief and official titles |
| `status` / `whyStopped` | `RECRUITING`, `COMPLETED`, `TERMINATED`... |
| `studyType` / `phases` | `INTERVENTIONAL` / `["PHASE3"]` |
| `enrollmentCount` / `enrollmentType` | `55` / `ESTIMATED` |
| `conditions` / `interventions` | `["Type 2 Diabetes"]` / drug & device list |
| `leadSponsor` / `leadSponsorClass` | `Eli Lilly and Company` / `INDUSTRY` |
| `collaborators` | Collaborating organizations |
| `centralContacts` | **Name, role, phone, email** for study contacts |
| `overallOfficials` | Study directors / principal investigators |
| `locations` | Every site: facility, city, state, ZIP, country, status, **principal investigators** |
| `eligibility` | Sex, age range, healthy-volunteers flag, age groups |
| `firstPostedDate` / `lastUpdatePostedDate` | Registry dates |

### Use cases

- **Pharma & biotech competitive intelligence** — track every trial a competitor sponsors by condition, phase, and status; monitor the pipeline in your therapeutic area (`sponsorClasses: ["INDUSTRY"]`).
- **Site selection & CRO business development** — find active sites and named principal investigators for a given condition and geography; build investigator target lists with facility contacts.
- **Patient recruitment** — surface `RECRUITING` trials for a condition near a location, with central-contact phone and email for referral.
- **KOL & investigator mapping** — extract principal investigators and study directors across a disease area for medical-affairs and advisory-board outreach.
- **Market & landscape research** — quantify trial activity by sponsor, phase, enrollment, and region for diligence or strategy.
- **AI agents / MCP** — a clean, filterable interface to the global trial registry for agent-driven research and enrichment.

### How to use it

Every recruiting, industry-sponsored cancer trial with a site in Texas:

```json
{
    "condition": "cancer",
    "state": "Texas",
    "statuses": ["RECRUITING"],
    "sponsorClasses": ["INDUSTRY"],
    "maxResults": 500
}
```

Every Phase 3 diabetes trial currently recruiting:

```json
{
    "condition": "diabetes",
    "statuses": ["RECRUITING"],
    "phases": ["PHASE3"],
    "maxResults": 500
}
```

**Filters:** `condition`, `intervention`, `sponsor`, `locationTerm`, `searchTerm`, `statuses` (recruiting, completed, terminated...), `phases` (early phase 1 → phase 4), `studyType`, `sponsorClasses` (industry, NIH, federal...), `state`, `country`, `maxResults`. At least one narrowing criterion is required.

### Data source & freshness

Every run queries the **official ClinicalTrials.gov API v2** live. ClinicalTrials.gov is maintained by the US National Library of Medicine (NIH) and updated continuously as sponsors submit and revise records — you get whatever the registry has at the moment of your call. Because it reads the official structured API rather than scraping a website, it does not break the way HTML scrapers do; the v2 API has been stable since its 2024 launch.

### Pricing

This Actor uses **pay per result**: you are charged **one `study-record` event per study returned**, and only for records actually delivered. Suggested price **$0.003 per record ($3.00 / 1,000 studies)**.

Why this price: clinical-trials competitors on the store either hide their pricing or use clunky multi-event models — one leading incumbent charges a **$0.10 actor-start fee plus $0.01 per search operation**. At **$0.003 per delivered record with no start fee**, this Actor is dramatically cheaper for real extraction while returning richer records (sponsor, every site, and named investigators flattened out). Start low; you only pay for the studies you keep.

### Why this Actor

- **Official NIH/NLM API v2, no key** — no login, no scraping, no anti-bot arms race.
- **Investigators & site contacts extracted** — principal investigators, facilities, and central contacts pulled into flat fields, not buried in nested JSON.
- **Sponsor-class & phase filtering** — isolate industry-sponsored pipelines or a specific phase in one call.
- **Pay only for results**, transparent per-record pricing, JSON/CSV/Excel export, and an MCP-ready interface for AI agents.

# Actor input Schema

## `condition` (type: `string`):

Condition or disease, e.g. <code>diabetes</code>, <code>breast cancer</code>, <code>Alzheimer</code>.

## `intervention` (type: `string`):

Intervention, drug, or device, e.g. <code>semaglutide</code>, <code>immunotherapy</code>.

## `sponsor` (type: `string`):

Lead sponsor or collaborator, e.g. <code>Pfizer</code>, <code>Mayo Clinic</code>.

## `locationTerm` (type: `string`):

Free-text location (city, facility, region), e.g. <code>Boston</code>, <code>MD Anderson</code>.

## `searchTerm` (type: `string`):

General free-text search across the whole study record.

## `statuses` (type: `array`):

Filter by overall recruitment status.

## `phases` (type: `array`):

Filter interventional trials by phase.

## `studyType` (type: `string`):

Interventional, observational, or expanded access.

## `sponsorClasses` (type: `array`):

Filter by lead-sponsor class (e.g. Industry for pharma-sponsored trials).

## `state` (type: `string`):

Full US state name of a study site, e.g. <code>Texas</code>, <code>California</code>.

## `country` (type: `string`):

Country of a study site, e.g. <code>United States</code>.

## `includeRawData` (type: `boolean`):

Attach the complete raw ClinicalTrials.gov study to every record under <code>raw</code>.

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

Maximum number of study records to return. You are only charged for records actually returned.

## Actor input object example

```json
{
  "condition": "diabetes",
  "statuses": [
    "RECRUITING"
  ],
  "includeRawData": false,
  "maxResults": 500
}
```

# 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 = {
    "condition": "diabetes",
    "statuses": [
        "RECRUITING"
    ],
    "maxResults": 500
};

// Run the Actor and wait for it to finish
const run = await client.actor("cblu/clinical-trials-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 = {
    "condition": "diabetes",
    "statuses": ["RECRUITING"],
    "maxResults": 500,
}

# Run the Actor and wait for it to finish
run = client.actor("cblu/clinical-trials-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 '{
  "condition": "diabetes",
  "statuses": [
    "RECRUITING"
  ],
  "maxResults": 500
}' |
apify call cblu/clinical-trials-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/UopWqNE2gfHNHZkYZ/builds/90eTjPGb0WdPGJBxQ/openapi.json
