# ClinicalTrials.gov API v2 — Trials & Contacts (`yannabadie/clinical-trials-api-mcp`) Actor

Official NIH ClinicalTrials.gov REST API v2 scraper & MCP tool. Free count mode, URL/NCT lookup, central & site contact emails/phones, sponsors, phases, eligibility & results. $5/1k, zero proxy.

- **URL**: https://apify.com/yannabadie/clinical-trials-api-mcp.md
- **Developed by:** [Yann Abadie](https://apify.com/yannabadie) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.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 API v2 — Trials, Contacts & Sponsors](https://raw.githubusercontent.com/yannabadie/yannabadie/main/assets/banner_clinical_trials.png)

## ClinicalTrials.gov API v2 — Trials, Contacts & Sponsors (MCP)

**Deterministic, zero-proxy NIH ClinicalTrials.gov REST API v2 scraper & MCP tool** covering **500,000+ clinical studies worldwide** with direct central & site contact emails, phone numbers, sponsors, phases, eligibility, locations, and posted results.

> **Bookmark this Actor** to run daily pharma/biotech pipeline alerts, patient-matching datasets, or sponsor contact exports at **$5 / 1,000 trials** (**61% cheaper** than competing scrapers) with **FREE count previews**.

***

### Why Teams Choose This Scraper

| Feature | This Actor (`yannabadie`) | Typical ClinicalTrials Scrapers |
|---|---|---|
| **Price per 1,000 trials** | **$5.00 / 1,000 trials** (`$0.005/record`) | `$12–$15 / 1,000` trials |
| **FREE Count Preview (`mode: "count"`)** | **Yes** (`0` trial charges) | Not available or billed |
| **Direct NIH API v2 (Zero Proxy / Zero Browser)** | **Yes** — `< 1s` runs, deterministic reliability | Browser / proxy flakiness (`~85%` success) |
| **Paste ClinicalTrials.gov Search or Study URL** | **Yes** (`startUrl`) + structured filters + `NCT` batch | Partial |
| **Primary Contact Email & Phone** | **Yes** (central contacts + facility fallback) | Nested or missing |
| **Incremental Daily Watch (`updatedSince`)** | **Yes** (`AREA[LastUpdatePostDate]`) | Manual post-filtering |
| **MCP & n8n Ready** | **Yes** — [Free n8n Pharma Watch template](https://github.com/yannabadie/yannabadie/blob/main/templates/n8n_clinical_trials_sponsor_watch.json) | Manual setup |

***

### Pricing (Transparent Pay-Per-Event)

| Event | Price | Charged When |
|---|---|---|
| `apify-actor-start` | `$0.005` | Once per run start |
| `clinical-trial-record` | `$0.005` (`$5 / 1k`) | Per returned clinical trial in `search` or `lookup_ncts` (**`$0` in `count` mode**) |

*Free Apify accounts include `$5/month` in credits (~1,000 clinical trials/month free).*

***

### Example Inputs

#### 1. FREE Trial Count & Cost Preview (`count` mode — `$0` trial charge)

```json
{
  "mode": "count",
  "condition": "non-small cell lung cancer",
  "phases": ["PHASE2", "PHASE3"],
  "overallStatus": ["RECRUITING"],
  "funderType": "INDUSTRY"
}
```

#### 2. Daily Incremental Pharma / Biotech Watch (`updatedSince`)

```json
{
  "mode": "search",
  "condition": "diabetes",
  "location": "France",
  "overallStatus": ["RECRUITING", "NOT_YET_RECRUITING"],
  "phases": ["PHASE3"],
  "funderType": "INDUSTRY",
  "updatedSince": "2026-11-01",
  "maxResults": 100
}
```

#### 3. Paste a ClinicalTrials.gov URL or Lookup Exact NCT IDs

```json
{
  "mode": "lookup_ncts",
  "nctIds": ["NCT07900633", "NCT06694935"]
}
```

***

### Sample JSON Output (`clinical_trial`)

```json
{
  "recordType": "clinical_trial",
  "nctId": "NCT07900633",
  "briefTitle": "A Study of Eloralintide (LY3841136) in Participants With Obesity or Overweight",
  "overallStatus": "NOT_YET_RECRUITING",
  "studyType": "INTERVENTIONAL",
  "phases": ["PHASE3"],
  "enrollmentCount": 3000,
  "leadSponsor": "Eli Lilly and Company",
  "leadSponsorClass": "INDUSTRY",
  "conditions": ["Obesity", "Overweight"],
  "interventions": ["Eloralintide", "Placebo"],
  "lastUpdatePostedDate": "2026-11-17",
  "hasResults": false,
  "countries": ["United States", "France", "Germany"],
  "locationsCount": 308,
  "primaryContactEmail": "LillyTrials@Lilly.com",
  "primaryContactPhone": "317-615-4559",
  "studyUrl": "https://clinicaltrials.gov/study/NCT07900633"
}
```

***

### Python, MCP & n8n Integration

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("yannabadie/clinical-trials-api-mcp").call(run_input={
    "condition": "oncology",
    "phases": ["PHASE3"],
    "funderType": "INDUSTRY",
    "overallStatus": ["RECRUITING"],
    "maxResults": 50,
})
trials = list(client.dataset(run["defaultDatasetId"]).iterate_items())
```

- **Free ready-to-import n8n template**: [Daily ClinicalTrials.gov Sponsor & Phase 3 Watch -> Google Sheets & Slack (JSON)](https://github.com/yannabadie/yannabadie/blob/main/templates/n8n_clinical_trials_sponsor_watch.json)
- **MCP Server**: Connect directly via `https://mcp.apify.com` from Claude, Cursor, or Antigravity.

***

### FAQ

- **Do I need a ClinicalTrials.gov API key?** No — this Actor calls the official U.S. NIH/NLM REST API v2 directly with zero API key and zero proxy costs.
- **How do I avoid overpaying on broad queries?** Run once with `"mode": "count"` — it returns `totalMatches` and `estimatedCostUsd` with `$0` per-trial charge.
- **Can I paste a search URL from ClinicalTrials.gov?** Yes — paste any `https://clinicaltrials.gov/search?...` or `https://clinicaltrials.gov/study/NCT...` link into `startUrl`.
- **Does it include contact emails and phone numbers?** Yes — `primaryContactEmail`, `primaryContactPhone`, and full `centralContacts` are extracted automatically (falling back to site contacts if central contacts are omitted).

***

### Explore Our Official Open-Data Actor Suite

- **[NPI Registry Scraper — US Doctors & Clinics API](https://apify.com/yannabadie/npi-healthcare-providers-mcp)** (`$2.50/1k` all-inclusive, 8M+ U.S. doctors & clinics, phones, fax & authorized officials)
- **[Pappers / SIRENE Scraper — French Companies API](https://apify.com/yannabadie/french-company-intelligence-mcp)** (`$6/1k`, free count mode, GPS radius, BODACC KYC & BOAMP)
- **[TED Europa & BOAMP — EU Public Tenders & Contacts](https://apify.com/yannabadie/eu-public-tenders-ted-boamp)** (`$3–$4/1k`, 27 EU countries + France, buyer emails & award winners)
- **[Free n8n Templates, MCP Config & Python CLI (GitHub)](https://github.com/yannabadie/official-opendata-mcp-n8n-templates)**

# Actor input Schema

## `mode` (type: `string`):

Search studies ('search'), preview exact match count for FREE ('count' — 0 trial charges), or fetch specific NCT IDs ('lookup_ncts').

## `startUrl` (type: `string`):

Paste any https://clinicaltrials.gov/search?... URL or single study page (https://clinicaltrials.gov/study/NCT...) to auto-extract its filters or NCT ID.

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

Disease or medical condition (e.g. 'diabetes', 'non-small cell lung cancer', 'alzheimer').

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

Drug name, biologic, device, or procedure (e.g. 'pembrolizumab', 'GLP-1', 'CRISPR').

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

Pharmaceutical company, university, or institution (e.g. 'Eli Lilly', 'Pfizer', 'INSERM').

## `location` (type: `string`):

Filter trials with study sites in this country, state, or city (e.g. 'France', 'United States', 'Boston').

## `queryTerm` (type: `string`):

Free-text keywords or ClinicalTrials.gov Essie expression matched across all study fields.

## `nctIds` (type: `array`):

List of NCT identifiers (e.g. \['NCT07900633', 'NCT06694935']).

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

Filter by study recruitment status. Leave empty for all statuses.

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

Filter interventional studies by phase (e.g. \['PHASE2', 'PHASE3']). Leave empty for all phases.

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

Restrict to Interventional, Observational, or Expanded Access studies.

## `funderType` (type: `string`):

Filter by funder organization type.

## `hasResults` (type: `string`):

Keep only trials with posted results, without posted results, or all.

## `updatedSince` (type: `string`):

Optional ISO date (YYYY-MM-DD) for incremental daily/weekly trial monitoring via AREA\[LastUpdatePostDate].

## `sort` (type: `string`):

Sort results by relevance, newest updates, first posted date, or target enrollment.

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

Hard cap on output trials to control spend (1 to 10,000).

## Actor input object example

```json
{
  "mode": "search",
  "startUrl": "",
  "condition": "diabetes",
  "intervention": "",
  "sponsor": "",
  "location": "",
  "queryTerm": "",
  "nctIds": [],
  "overallStatus": [
    "RECRUITING"
  ],
  "phases": [],
  "studyType": "",
  "funderType": "",
  "hasResults": "",
  "updatedSince": "",
  "sort": "LastUpdatePostDate:desc",
  "maxResults": 25
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "condition": "diabetes"
};

// Run the Actor and wait for it to finish
const run = await client.actor("yannabadie/clinical-trials-api-mcp").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" }

# Run the Actor and wait for it to finish
run = client.actor("yannabadie/clinical-trials-api-mcp").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"
}' |
apify call yannabadie/clinical-trials-api-mcp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,yannabadie/clinical-trials-api-mcp"
        }
    }
}
```

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/6j8dMeHKyduWj9tco/builds/WfKb5dmhzM4pGYpPG/openapi.json
