# ClinicalTrials.gov Scraper and Clinical Trials API (`capable_coach/clinicaltrials-gov-scraper`) Actor

Search ClinicalTrials.gov by condition, drug, sponsor, phase or status and get NCT ID, phase, interventions, sponsor, enrollment, eligibility criteria and sites as clean JSON. Official API v2, no key. $1.50 per 1,000 studies, up to 1,000 studies per run.

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

## Pricing

from $1.50 / 1,000 clinical studies

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

Search ClinicalTrials.gov by disease, drug, sponsor or phase and download every matching study as one flat JSON record, ready for a database, a spreadsheet or a monitoring pipeline.

### What you get

- Registry identifier (`nctId`), titles, acronym, status and last known status, study type and phases.
- Conditions, interventions and their types, lead sponsor, sponsor class and collaborators.
- Enrollment count and type (estimated or actual), start, primary completion and completion dates, first-posted and last-update dates.
- Eligibility criteria text, sex, age range, healthy-volunteer flag, primary outcome measures and brief summary.
- Countries, site count and site labels (first 50 sites per study).
- A `SUMMARY` record per run with query, pages read, rows written and errors.

Real output shape (trimmed):

```json
{
  "nctId": "NCT06694935",
  "title": "A Phase 1b Study of QX1206 in T2DM Patients With NAFLD",
  "status": "RECRUITING",
  "studyType": "INTERVENTIONAL",
  "phases": ["PHASE1"],
  "conditions": ["Type 2 Diabetes Mellitus (T2DM)", "Non-Alcoholic Fatty Liver Disease (NAFLD)"],
  "interventions": ["QX1206"],
  "leadSponsor": "1Globe Health Institute",
  "sponsorClass": "INDUSTRY",
  "enrollmentCount": 52,
  "enrollmentType": "ESTIMATED",
  "startDate": "2025-01-06",
  "lastUpdatePosted": "2025-01-13",
  "countries": ["Canada"],
  "url": "https://clinicaltrials.gov/study/NCT06694935"
}
```

### Who it's for

- **Clinical operations teams** looking for recruiting trials in one indication and the countries where they run.
- **Pharma competitive intelligence** following one sponsor's trials by status and phase.
- **Market researchers** sizing a landscape: trials per condition, phase and country.
- **Data engineers** feeding a trial-monitoring pipeline without writing a ClinicalTrials.gov client.

### How to use

1. Enter a `query` (disease, treatment, sponsor or NCT ID) and, optionally, `statuses` such as `RECRUITING`.
2. Set `maxItems` (1 to 1,000). For precise filters add an `advancedFilter` Essie expression, for example `AREA[Phase]PHASE3`.
3. Run it and export JSON, CSV or Excel, or schedule it and compare `status` and `lastUpdatePosted` between runs.

Example input:

```json
{
  "query": "type 2 diabetes GLP-1",
  "statuses": ["RECRUITING"],
  "maxItems": 20
}
```

### Pricing

Pay per event, no subscription: **$0.0005 per run start** (one event per GB of memory, minimum one) plus **$0.0015 per study** written to the dataset.

| Volume (Free plan) | Cost |
|---|---|
| 100 studies | $0.1505 |
| 1,000 studies | $1.5005 |

Example: the input above returning 20 studies costs $0.0305. Charges apply to rows actually written.

Set the run's *Maximum cost per run* in Apify to cap spending in advance.

### FAQ

**Does it use the official ClinicalTrials.gov API?**
Yes, API v2 (`/api/v2/studies`), the feed behind the website. Fields are re-mapped, values are not recomputed.

**Do I need an API key?**
No key, no login, no proxy.

**How do I search by sponsor or drug?**
Put the name in `query`; it is sent as the search term, so sponsors, interventions and conditions all match.

**Can I filter by country or phase?**
There is no dedicated field; use `advancedFilter` (for example `AREA[LocationCountry]France` or `AREA[Phase]PHASE3`) or filter the `countries` and `phases` columns afterwards.

**Can I monitor a topic over time?**
Yes. Save the input as a task, add an Apify schedule, and compare `status` and `lastUpdatePosted` between datasets.

### Limits

- Only data published by sponsors in the registry; results tables and documents are not downloaded.
- One search term per run and at most 1,000 studies per run.
- `locations` stops at 50 sites per study; `locationCount` and `countries` stay complete.
- Full `eligibilityCriteria` text makes rows large.
- Not affiliated with ClinicalTrials.gov or the U.S. National Library of Medicine.

# Changelog

This Actor's version history is a separate document: https://apify.com/capable_coach/clinicaltrials-gov-scraper/changelog.md

# Actor input Schema

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

Termes recherches (maladie, traitement, sponsor, promoteur). Ex. diabetes, CAR-T lymphoma, Novo Nordisk.

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

Filtre optionnel sur le statut : RECRUITING, ACTIVE_NOT_RECRUITING, COMPLETED, ENROLLING_BY_INVITATION, NOT_YET_RECRUITING, SUSPENDED, TERMINATED, WITHDRAWN, UNKNOWN.

## `maxItems` (type: `integer`):

Plafond d'essais recuperes (pagination automatique).

## `advancedFilter` (type: `string`):

Optionnel, ex. AREA\[Phase]PHASE3 AND AREA\[StartDate]RANGE\[2026-01-01, MAX]. Voir la doc Essie/CT.gov pour la syntaxe.

## Actor input object example

```json
{
  "query": "diabetes",
  "statuses": [
    "RECRUITING"
  ],
  "maxItems": 50
}
```

# Actor output Schema

## `studies` (type: `string`):

Une ligne par essai : NCT ID, titre, statut, phase, conditions, sponsor, localisations.

## `overview` (type: `string`):

Tableau pret a lire dans la console Apify.

## `summary` (type: `string`):

Requete, pages lues, essais ecrits, erreurs.

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

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

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

```

## MCP server setup

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