# ClinicalTrials.gov Scraper - Clinical Study Data API (`evpp/clinicaltrials-gov`) Actor

Scrape and export ClinicalTrials.gov study data as a clean JSON API: sponsors, phases, enrollment, conditions, interventions, locations, outcomes, and status.

- **URL**: https://apify.com/evpp/clinicaltrials-gov.md
- **Developed by:** [Evp Labs](https://apify.com/evpp) (community)
- **Categories:** Education, Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 results

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 Scraper - Clinical Study Data API

Search **ClinicalTrials.gov**, the world's largest registry of clinical studies, and get back clean flat JSON records. Filter by keyword, condition, lead sponsor, recruitment status, or country, and pull sponsor, phase, enrollment, site locations, interventions, and primary outcomes for every matching study. Powered by the **official public ClinicalTrials.gov API v2**: no headless browser, no CAPTCHAs, no API key.

### Why use it

- **Pharma & biotech competitive-intelligence teams**: track every trial a competitor sponsors, monitor recruiting pipelines by indication, and watch status changes over time.
- **CROs and clinical-ops teams**: find studies by condition, phase, or geography for feasibility and site-competition analysis.
- **Investors & analysts**: follow the trial portfolios of companies in your coverage universe, including enrollment targets and completion dates.
- **Patient-recruitment agencies**: enumerate actively recruiting studies in a condition and region to map the competitive landscape.
- **Researchers & data teams**: pull a stable, structured snapshot of the registry without parsing the website yourself.

### How it works

| Input | Maps to API parameter | Effect |
|-------|----------------------|--------|
| `query` | `query.term` | Free-text search over titles, interventions, descriptions; supports expert expressions like `AREA[Phase]PHASE3` |
| `condition` | `query.cond` | Condition/disease filter |
| `sponsor` | `query.term = AREA[LeadSponsorName]<name>` | Lead-sponsor filter, e.g. "Pfizer" |
| `status` | `filter.overallStatus` | Recruitment status filter |
| `country` | `query.locn` | Studies with at least one site in that location |

Filters combine with AND, so `condition: "lung cancer"`, `sponsor: "AstraZeneca"`, `status: "RECRUITING"` returns only recruiting AstraZeneca lung-cancer studies. Results are paginated automatically until `maxItems` is reached.

### Quick start input

Target source: `clinicaltrials.gov`. Paste this JSON into the Actor input tab for a fast first run, or use it as the body of the Apify API run call:

```json
{
    "condition": "lung cancer",
    "status": "RECRUITING",
    "country": "United States",
    "maxItems": 10
}
```

The default input is intentionally small. Raise `maxItems` only after validating the first clinical study records.

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `query` | string | `"oncology"` | Free-text / expert search expression. |
| `condition` | string | `""` | Condition or disease, e.g. `"type 2 diabetes"`. |
| `sponsor` | string | `""` | Lead sponsor name, e.g. `"Novartis"`. |
| `status` | enum | `"RECRUITING"` | `any`, `RECRUITING`, `NOT_YET_RECRUITING`, `ACTIVE_NOT_RECRUITING`, `COMPLETED`, `ENROLLING_BY_INVITATION`, `SUSPENDED`, `TERMINATED`, `WITHDRAWN`. |
| `country` | string | `""` | Location filter, e.g. `"United States"`, `"Germany"`, or a city. |
| `maxItems` | integer | `10` | Maximum studies to output (1-1000), strictly enforced. |
| `proxyConfiguration` | object | `{ "useApifyProxy": false }` | Optional. The API is public and needs no proxy. |

### Output

One flat JSON item is produced per clinical study. Download the dataset as JSON, CSV, Excel, or HTML, or consume it through the Apify API.

#### Field reference

| Field | Type | Description |
|-------|------|-------------|
| `nctId` | string | NCT number, the unique ClinicalTrials.gov identifier |
| `briefTitle` | string | Short title of the study |
| `officialTitle` | string | Full official title of the study |
| `orgStudyId` | string | Sponsor's internal study identifier |
| `url` | string | ClinicalTrials.gov study page URL |
| `overallStatus` | string | Recruitment status (RECRUITING, COMPLETED, TERMINATED, ...) |
| `leadSponsor` | string | Name of the lead sponsor organization |
| `leadSponsorClass` | string | Sponsor class (INDUSTRY, NIH, OTHER_GOV, OTHER, ...) |
| `collaborators` | string\[] | Collaborating organizations listed on the study |
| `conditions` | string\[] | Conditions or diseases studied |
| `keywords` | string\[] | Keywords assigned to the study |
| `phases` | string\[] | Trial phases (PHASE1, PHASE2, PHASE3, PHASE4, NA) |
| `studyType` | string | Study type (INTERVENTIONAL, OBSERVATIONAL, EXPANDED_ACCESS) |
| `enrollmentCount` | integer | Planned or actual enrollment size |
| `enrollmentType` | string | Whether enrollmentCount is ESTIMATED or ACTUAL |
| `startDate` | string | Study start date (ISO) |
| `completionDate` | string | Study completion date (ISO, estimated or actual) |
| `lastUpdateDate` | string | Date the record was last updated on ClinicalTrials.gov |
| `locationsCount` | integer | Number of recruitment sites listed |
| `countries` | string\[] | Unique countries where the study has sites |
| `interventionNames` | string\[] | Unique intervention/drug names tested |
| `primaryOutcomes` | string\[] | Primary outcome measures |

#### Real sample output (latest live dataset)

```json
{
    "nctId": "NCT03750981",
    "briefTitle": "C.A.P.A.B.L.E. (CrossFit® and Physical Activity: A Better Life Experience)",
    "officialTitle": "Does High-Intensity Functional Training Improve Patient Movement and Quality of Life? A Study of CrossFit® in Cancer Survivors",
    "orgStudyId": "2018-091",
    "url": "https://clinicaltrials.gov/study/NCT03750981",
    "overallStatus": "RECRUITING",
    "leadSponsor": "Barbara Ann Karmanos Cancer Institute",
    "leadSponsorClass": "OTHER",
    "conditions": [
        "Cancer Survivors"
    ],
    "phases": [
        "NA"
    ],
    "studyType": "INTERVENTIONAL",
    "enrollmentCount": 500,
    "enrollmentType": "ESTIMATED",
    "startDate": "2018-11-12",
    "completionDate": "2028-11-30",
    "lastUpdateDate": "2026-11-23",
    "locationsCount": 1,
    "countries": [
        "United States"
    ],
    "interventionNames": [
        "12 week pilot intervention study."
    ],
    "primaryOutcomes": [
        "Enrollment rates",
        "Change in functional performance and variability in functional performance among adult cancer survivors enrolled in a high-intensity functional training program",
        "Change in self-reported health-related quality of life (HRQOL) and variability using the FACT questionnaire",
        "Change in Body Composition"
    ]
}
```

### Use with AI agents (MCP), n8n, Make, and Python

- **AI agents / MCP:** add `https://mcp.apify.com/?tools=evpp/clinicaltrials-gov` to your MCP client, then ask the agent to scrape ClinicalTrials.gov data or export the latest dataset.
- **n8n / Make / Zapier:** run Actor `evpp/clinicaltrials-gov` with the quick-start input, then map dataset items into Google Sheets, a CRM, a webhook, or a monitoring workflow.
- **Python:** install the client with `pip install apify-client` and run:

```python
import json
from apify_client import ApifyClient

client = ApifyClient()
run_input = json.loads('''{"condition":"lung cancer","status":"RECRUITING","country":"United States","maxItems":10}''')
run = client.actor("evpp/clinicaltrials-gov").call(run_input=run_input)
items = list(client.dataset(run["defaultDatasetId"]).iterate_items())
print(items[0])
```

The same dataset is available as JSON, CSV, Excel, XML, RSS, and HTML through the Apify API.

### Cost

Each run makes a small number of lightweight JSON requests to the official API (one request per page of up to 100 studies). A 10-item run finishes in seconds on minimal memory (256 MB). At the pay-per-event price of **$2.50 per 1,000 results**, pulling the complete trial portfolio of a sponsor or every recruiting study in a niche indication costs cents.

### FAQ

**Is this an official API?**
Yes. The Actor calls `clinicaltrials.gov/api/v2/studies`, the public JSON API maintained by the National Library of Medicine. No authentication is required and no HTML is scraped.

**How do I find all trials sponsored by one company?**
Set `sponsor` to the company name, e.g. `"Merck Sharp & Dohme"` or just `"Merck"`. The name is matched against the lead sponsor field; combine with `status` or `condition` to narrow further.

**Can I filter to a specific phase?**
Yes: put `AREA[Phase]PHASE3` (or `PHASE1`/`PHASE2`/`PHASE4`) in `query`. Example: `query: "AREA[Phase]PHASE3 oncology"`.

**Why do some studies have no `phases` or `enrollmentCount`?**
Observational studies and some records simply don't report those fields. Empty fields are omitted from output rather than returned as nulls.

**Does it need proxies?**
No. Defaults run direct. The `proxyConfiguration` input exists for users who want their own proxy pool.

**How fresh is the data?**
Every run queries the live API, so you always get the current registry state including the last update date of each record.

# Actor input Schema

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

Free-text search over study titles, descriptions, interventions and more, sent to the API as query.term. Examples: "oncology", "CAR-T", "alzheimer immunotherapy". Supports ClinicalTrials.gov expert expressions such as AREA\[Phase]PHASE3.

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

Condition or disease filter (query.cond). Examples: "lung cancer", "type 2 diabetes", "multiple sclerosis". Combined with the other filters.

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

Lead sponsor name filter, matched against the study's lead sponsor (AREA\[LeadSponsorName]). Examples: "Pfizer", "Novartis", "National Cancer Institute".

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

Filter by overall study status (filter.overallStatus). "any" returns studies in every status.

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

Restrict results to studies with at least one site in this location (query.locn). Accepts a country name such as "United States" or "Germany", or a city/state.

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

Maximum number of study records to output (1-1000), strictly enforced.

## `proxyConfiguration` (type: `object`):

Optional proxies for outbound requests. The ClinicalTrials.gov API is public and usually needs no proxy.

## Actor input object example

```json
{
  "query": "oncology",
  "condition": "",
  "sponsor": "",
  "status": "RECRUITING",
  "country": "",
  "maxItems": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Dataset containing all scraped clinical study records

# 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": "oncology",
    "condition": "",
    "sponsor": "",
    "country": "",
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("evpp/clinicaltrials-gov").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": "oncology",
    "condition": "",
    "sponsor": "",
    "country": "",
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("evpp/clinicaltrials-gov").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": "oncology",
  "condition": "",
  "sponsor": "",
  "country": "",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call evpp/clinicaltrials-gov --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,evpp/clinicaltrials-gov"
        }
    }
}
```

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/kffwt8OAXc54WueKc/builds/N4njtRUH3BKbiXS9C/openapi.json
