# Clinical Trials Scraper - Phases, Sponsors & Sites (`eliai/clinical-trials-scraper`) Actor

Search ClinicalTrials.gov and get one row per trial: NCT id, status, phase, enrollment, sponsor, conditions, interventions, eligibility and site countries. Status, phase and location filters. $0.01 per trial; empty searches are free.

- **URL**: https://apify.com/eliai/clinical-trials-scraper.md
- **Developed by:** [Broke to Built](https://apify.com/eliai) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 trials scrapeds

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

## Clinical Trials Scraper — ClinicalTrials.gov, Phases & Sites

Search **ClinicalTrials.gov** and get **one row per trial**: NCT id, recruitment status, phase,
enrollment, sponsor, conditions, interventions, eligibility and the countries with sites.

No API key, no account. **$0.01 per trial** — a search that matches nothing is recorded and
**not charged**.

### Input

```json
{ "query": "melanoma", "status": "RECRUITING", "phase": "PHASE3", "maxTrials": 100 }
```

Bulk, restricted to a country:

```json
{
  "queries": ["semaglutide", "tirzepatide"],
  "status": "RECRUITING",
  "country": "Germany",
  "maxTrials": 250
}
```

| Field | Type | Notes |
|---|---|---|
| `query` | string | Condition, intervention, sponsor or free text — `melanoma`, `semaglutide`, `Pfizer`. |
| `queries` | string\[] | Up to 10 searches per run. |
| `maxTrials` | integer | 1–500 per term. **You are charged per trial returned.** |
| `status` | enum | `ANY`, `RECRUITING`, `COMPLETED`, `TERMINATED`, … |
| `phase` | enum | `ANY`, `EARLY_PHASE1`, `PHASE1`–`PHASE4`. |
| `country` | string | Country or city with a trial site. Empty = worldwide. |

### Output

```json
{
  "ok": true,
  "nctId": "NCT00920907",
  "url": "https://clinicaltrials.gov/study/NCT00920907",
  "title": "Comparison of Ipilimumab Manufactured by 2 Different Processes…",
  "status": "COMPLETED",
  "phases": ["PHASE1"],
  "studyType": "INTERVENTIONAL",
  "enrollment": 99,
  "conditions": ["Advanced Melanoma"],
  "interventions": ["Ipilimumab"],
  "sponsor": "Bristol-Myers Squibb",
  "startDateRaw": "2009-08",
  "startDate": null,
  "locationCount": 7,
  "countries": ["United States"],
  "eligibilitySex": "ALL",
  "minimumAge": "18 Years",
  "briefSummary": "The purpose of this clinical research study is to…"
}
```

### What it gets right

- ⭐ **Partial dates are not invented.** ClinicalTrials.gov returns `"2009-08"` when the sponsor
  only ever committed to a month. That is real information. The raw value is kept in
  `startDateRaw`, and `startDate` stays **null** rather than silently becoming the 1st — so a
  date you can compute with is always a date somebody actually stated.
- **Filters are really applied**, server-side. `status: "COMPLETED"` means every row is completed,
  not a full result set you then have to filter yourself and pay for.
- **It pages past the API's 100-per-request ceiling** via `nextPageToken`, stops when the token
  stops advancing, and is bounded so it cannot spin.
- **Nested modules are flattened** into one flat row — sponsors, conditions, interventions,
  eligibility and site countries all sit at the top level, ready for a spreadsheet.
- **`countries` is de-duplicated** from the site list, so a 40-site trial gives you 3 countries,
  not 40 repeats.

### Pricing

**$0.01 per trial returned.** No start fee. A search matching nothing produces a `trialCount: 0`
record and **is not charged**.

### Limits

- 10 search terms per run, up to 500 trials each.
- Returns the protocol record: status, design, sponsor, eligibility, locations. **Posted results
  data (outcome measures, adverse events) is not included.**
- `country` matches trial **sites**, not the sponsor's country.
- Data is US-government public domain, updated by sponsors — `lastUpdateRaw` tells you when.

### FAQ

**Do I need an API key?** No.

**Why is `startDate` null when `startDateRaw` has a value?** The source gave a month, not a day.
See above — we do not guess.

**Can I get outcome results?** Not in this Actor; it returns the protocol section.

### Changelog

- **0.1 (2026-09-10)** — first release. One row per trial, token paging, server-side status/phase/
  location filters, partial dates preserved.

# Actor input Schema

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

A condition, intervention, sponsor or free-text term, e.g. melanoma, semaglutide, Pfizer.

## `queries` (type: `array`):

Several searches in one run. Up to 10.

## `maxTrials` (type: `integer`):

Pages 100 at a time. You are charged per trial returned.

## `status` (type: `string`):

Limit to one recruitment status, or ANY for all of them.

## `phase` (type: `string`):

Limit to a single trial phase, or ANY for all phases.

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

Restrict to trials with a site in this country or city, e.g. Germany or Boston. Leave empty for worldwide.

## Actor input object example

```json
{
  "query": "melanoma",
  "queries": [],
  "maxTrials": 25,
  "status": "ANY",
  "phase": "ANY"
}
```

# Actor output Schema

## `results` (type: `string`):

Every item this run produced, as JSON.

## `resultsCsv` (type: `string`):

The same items as a spreadsheet-ready CSV.

# 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": "melanoma",
    "queries": []
};

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

# Run the Actor and wait for it to finish
run = client.actor("eliai/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 '{
  "query": "melanoma",
  "queries": []
}' |
apify call eliai/clinical-trials-scraper --silent --output-dataset

```

## MCP server setup

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