# 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 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/docs.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.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/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

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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "ClinicalTrials.gov Scraper (Trials, Sponsors & Investigators)",
        "description": "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.",
        "version": "0.1",
        "x-build-id": "90eTjPGb0WdPGJBxQ"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/cblu~clinical-trials-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-cblu-clinical-trials-scraper",
                "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/cblu~clinical-trials-scraper/runs": {
            "post": {
                "operationId": "runs-sync-cblu-clinical-trials-scraper",
                "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/cblu~clinical-trials-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-cblu-clinical-trials-scraper",
                "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",
                "properties": {
                    "condition": {
                        "title": "Condition / disease",
                        "type": "string",
                        "description": "Condition or disease, e.g. <code>diabetes</code>, <code>breast cancer</code>, <code>Alzheimer</code>."
                    },
                    "intervention": {
                        "title": "Intervention / treatment",
                        "type": "string",
                        "description": "Intervention, drug, or device, e.g. <code>semaglutide</code>, <code>immunotherapy</code>."
                    },
                    "sponsor": {
                        "title": "Sponsor",
                        "type": "string",
                        "description": "Lead sponsor or collaborator, e.g. <code>Pfizer</code>, <code>Mayo Clinic</code>."
                    },
                    "locationTerm": {
                        "title": "Location term",
                        "type": "string",
                        "description": "Free-text location (city, facility, region), e.g. <code>Boston</code>, <code>MD Anderson</code>."
                    },
                    "searchTerm": {
                        "title": "Other search terms",
                        "type": "string",
                        "description": "General free-text search across the whole study record."
                    },
                    "statuses": {
                        "title": "Recruitment status",
                        "type": "array",
                        "description": "Filter by overall recruitment status.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "RECRUITING",
                                "NOT_YET_RECRUITING",
                                "ACTIVE_NOT_RECRUITING",
                                "COMPLETED",
                                "ENROLLING_BY_INVITATION",
                                "SUSPENDED",
                                "TERMINATED",
                                "WITHDRAWN",
                                "UNKNOWN"
                            ],
                            "enumTitles": [
                                "Recruiting",
                                "Not yet recruiting",
                                "Active, not recruiting",
                                "Completed",
                                "Enrolling by invitation",
                                "Suspended",
                                "Terminated",
                                "Withdrawn",
                                "Unknown"
                            ]
                        }
                    },
                    "phases": {
                        "title": "Phase",
                        "type": "array",
                        "description": "Filter interventional trials by phase.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "EARLY_PHASE1",
                                "PHASE1",
                                "PHASE2",
                                "PHASE3",
                                "PHASE4",
                                "NA"
                            ],
                            "enumTitles": [
                                "Early Phase 1",
                                "Phase 1",
                                "Phase 2",
                                "Phase 3",
                                "Phase 4",
                                "Not applicable"
                            ]
                        }
                    },
                    "studyType": {
                        "title": "Study type",
                        "enum": [
                            "INTERVENTIONAL",
                            "OBSERVATIONAL",
                            "EXPANDED_ACCESS"
                        ],
                        "type": "string",
                        "description": "Interventional, observational, or expanded access."
                    },
                    "sponsorClasses": {
                        "title": "Sponsor class",
                        "type": "array",
                        "description": "Filter by lead-sponsor class (e.g. Industry for pharma-sponsored trials).",
                        "items": {
                            "type": "string",
                            "enum": [
                                "NIH",
                                "FED",
                                "OTHER_GOV",
                                "INDIV",
                                "INDUSTRY",
                                "NETWORK",
                                "AMBIG",
                                "OTHER",
                                "UNKNOWN"
                            ],
                            "enumTitles": [
                                "NIH",
                                "Federal",
                                "Other government",
                                "Individual",
                                "Industry",
                                "Network",
                                "Ambiguous",
                                "Other",
                                "Unknown"
                            ]
                        }
                    },
                    "state": {
                        "title": "US state (site location)",
                        "type": "string",
                        "description": "Full US state name of a study site, e.g. <code>Texas</code>, <code>California</code>."
                    },
                    "country": {
                        "title": "Country (site location)",
                        "type": "string",
                        "description": "Country of a study site, e.g. <code>United States</code>."
                    },
                    "includeRawData": {
                        "title": "Include raw study record",
                        "type": "boolean",
                        "description": "Attach the complete raw ClinicalTrials.gov study to every record under <code>raw</code>.",
                        "default": false
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 1,
                        "maximum": 100000,
                        "type": "integer",
                        "description": "Maximum number of study records to return. You are only charged for records actually returned.",
                        "default": 500
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
