# ClinicalTrials.gov Scraper — Trial Search & Bulk Export API (`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:** 3 total users, 1 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/actors/running/actors-in-store.md#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

**Get every recruiting trial for a condition in your region — with the sponsor, every study site, and the named principal investigators and their contact details — as flat rows you can filter and merge.** Site selection, investigator targeting, competitive pipeline tracking, and patient-referral lists all come out of the same run.

Data comes from the official ClinicalTrials.gov API v2, run by the US National Library of Medicine. No login, no API key, no HTML scraping.

### See real studies for 8 cents before you commit

Set `maxResults` to `25` and run it once. You are charged **$0.003 per study record** — so a 25-record look costs **$0.075**, and a run that matches nothing costs only Apify's fraction-of-a-cent start event.

### What one record actually looks like

Real output from a live run — a Phase 3 Lilly trial, trimmed to the fields most people check first:

```json
{
    "nctId": "NCT07222137",
    "title": "A Study of Baricitinib (LY3009104) for the Delay of Stage 3 Type 1 Diabetes in At-Risk Children and Adults",
    "acronym": "BARICADE-DELAY",
    "status": "RECRUITING",
    "studyType": "INTERVENTIONAL",
    "phases": ["PHASE3"],
    "enrollmentCount": 150,
    "startDate": "2026-01-12",
    "conditions": ["Diabetes Mellitus, Type 1"],
    "interventions": [{ "type": "DRUG", "name": "Baricitinib" }],
    "leadSponsor": "Eli Lilly and Company",
    "leadSponsorClass": "INDUSTRY",
    "lastUpdatePostedDate": "2026-07-20"
}
```

The full record also carries `centralContacts` (name, role, phone, email), `overallOfficials`, `eligibility`, and a `locations` array giving **every study site** with facility, city, state, ZIP, country, status, and its **principal investigators**.

### The actual differentiator: investigators and sites, flattened

ClinicalTrials.gov returns deeply nested JSON. Most scrapers either dump that raw payload on you or stop at the study summary — which is useless if what you need is *the name of the PI at the site in Houston*.

This Actor pulls the parts that matter for outreach and intelligence — sponsor, site facilities, and named principal investigators with their contact details — into flat fields you can sort, filter, and join.

### What a real job costs

Pricing is **$3.00 per 1,000 study records** ($0.003 each), charged only on records actually returned:

| What you pull | Records | Cost |
|---|---|---|
| A look at the output before buying | 25 | **$0.08** |
| Every recruiting trial in a therapeutic area | 500 | **$1.50** |
| A capped landscape study | 5,000 | **$15.00 maximum** |

`maxResults` is a hard ceiling, so a run can never cost more than `maxResults` × $0.003 plus Apify's fraction-of-a-cent platform events (about 0.3% on top). There is no subscription.

> **On very large pulls:** Apify caps each run with a maximum-charge limit. If a run reaches it, the run stops early and returns fewer records than your `maxResults` — the run's status message will tell you when this happens. For big pulls, raise the maximum-charge setting on the run (or your plan limit) before starting it.

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

Pay per result: **$0.003 per study record** ($3.00 per 1,000). You are charged per record actually returned, plus Apify's small platform events: a fraction-of-a-cent Actor start event and $0.00001 per dataset item — about 0.3% on top of the per-record price. No subscription; a run that finds nothing costs only the fraction-of-a-cent start event.

# 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(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 '{
  "condition": "diabetes",
  "statuses": [
    "RECRUITING"
  ],
  "maxResults": 500
}' |
apify call cblu/clinical-trials-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,cblu/clinical-trials-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/UopWqNE2gfHNHZkYZ/builds/doSFo2jPVVIArJUDh/openapi.json
