# ClinicalTrials.gov Scraper: clinical trial studies and results (`bepolabs/clinical-trials`) Actor

Search ClinicalTrials.gov by condition, drug, sponsor or location: clinical trials with status, phase, enrollment, sites and outcomes as JSON or CSV.

- **URL**: https://apify.com/bepolabs/clinical-trials.md
- **Developed by:** [BEPO Labs](https://apify.com/bepolabs) (community)
- **Categories:** AI, Lead generation, Other
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$9.60 / 1,000 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

### 🧪 What is Clinical Trials Data?

Clinical Trials Data reads [ClinicalTrials.gov](https://clinicaltrials.gov), the US National Library of Medicine's registry of more than 600,000 worldwide entries, through its official interface. Ask by disease, compound, funder or free text, or by NCT number, narrow by recruitment stage, design type, region or last update, and get one tidy row per entry: dates, headcount, inclusion criteria, every centre by country, primary endpoints and, where posted, per-group p-values and serious side effects.

- **Pharma and biotech intelligence**: every trial a competitor runs for a drug or indication, with phase and status
- **Patient recruitment and site selection**: recruiting studies for a condition with their sites by city and country
- **Monitoring**: trials updated since a date, on a daily or weekly schedule
- **Investors and analysts**: pipelines, phases and completion dates by sponsor
- **Research and AI**: posted outcomes and adverse events as structured data for analysis or an AI agent

![Clinical Trials Data: ClinicalTrials.gov studies by condition, drug, sponsor or NCT id, with sites, eligibility and posted results.](https://api.apify.com/v2/key-value-stores/wdeAWGooHdIhvFgSY/records/clinical-trials-hero.png)

#### ✨ Why use this Actor?

- ✅ **Official source**: ClinicalTrials.gov API v2, no scraping, no key needed
- ✅ **Results in short**: each posted outcome measure with its value per arm, spread and p-value, and serious adverse events in each group
- ✅ **All sites counted**: `sitesCount` and `countries` always cover every site; `maxSites` only caps the list shown
- ✅ **Search the way you think**: condition, drug, sponsor and free-text searches in one run, plus NCT id lookups
- ✅ **Built for monitoring**: `updatedSince` and sorting by last update for scheduled runs
- ✅ **Fair price**: 2 USD per 1,000 studies, deduped across searches; you pay only for rows saved

### 📦 What data can you get with Clinical Trials Data?

| | | |
|---|---|---|
| 🆔 NCT id and acronym | 📄 Brief and official title | 🚦 Recruitment status and why stopped |
| 🔬 Study type and phases | 👥 Enrollment | 🩺 Conditions |
| 💊 Interventions | 🏢 Sponsor, class and collaborators | 📅 Start, completion, posted and updated dates |
| 🎯 Primary outcomes | ✅ Eligibility: sex, ages, healthy volunteers | 📝 Brief summary |
| 🌍 Sites, site count and countries | 📊 Posted results per arm | ⚠️ Serious adverse events per arm |

### 🚀 How to use Clinical Trials Data

Clinical Trials Data works in a few clicks, no coding needed:

1. [Create a free Apify account](https://console.apify.com/sign-up) (the free plan includes 5 USD of monthly credit).
2. Open [Clinical Trials Data](https://apify.com/bepolabs/clinical-trials) and click **Try for free**.
3. Enter conditions, drugs, sponsors or NCT ids, pick statuses and phases if you want, and set how many studies per search.
4. Click **Start** and wait for the run to finish (most runs take seconds).
5. Download your data as JSON, CSV, Excel, XML or HTML, or send it straight to Google Sheets, Make, Zapier or your AI agent.

![How Clinical Trials Data works](https://api.apify.com/v2/key-value-stores/wdeAWGooHdIhvFgSY/records/clinical-trials-workflow.png)

### ⬇️ Input

Give at least one condition, drug, sponsor, free text or NCT id: up to 100 phrases and 1,000 identifiers per run. Everything else is optional.

##### Four kinds of search

`conditions` (glioblastoma, type 2 diabetes), `drugs` (semaglutide, pembrolizumab, also devices and procedures), `sponsors` (Pfizer, National Cancer Institute) and `searchTerms` (free text over all fields). Each term is its own search; studies found twice are kept once. `nctIds` takes ids or clinicaltrials.gov URLs.

##### Filters

`statuses` (RECRUITING, COMPLETED, ...), `phases` (PHASE1 to PHASE4, an early phase and NA), `studyType`, `location` (a country, state or city with a site), `withResultsOnly`, and `updatedSince` (YYYY-MM-DD) for monitoring.

##### Results and sites

Posted results are included unless switched off (`includeResults`). `maxSites` caps the list of sites per study (50 as standard); the count and the countries always cover every one.

| Field | Type | What it does | Default |
|---|---|---|---|
| **Conditions** (`conditions`) | array | Diseases or conditions, e.g. | `["glioblastoma"]` |
| **Drugs or interventions** (`drugs`) | array | Drug, device or procedure names, e.g. |  |
| **Sponsors** (`sponsors`) | array | Lead sponsors or collaborators, e.g. |  |
| **Other search terms** (`searchTerms`) | array | Free text over all study fields; one search each. |  |
| **NCT ids** (`nctIds`) | array | Look up these studies directly, e.g. |  |
| **Recruitment status** (`statuses`) | array | Keep only studies with one of these statuses (empty: all). |  |
| **Phases** (`phases`) | array | Keep only studies in one of these phases (empty: all). |  |
| **Study type** (`studyType`) | string | Interventional, observational or expanded access (empty: all). |  |
| **Location** (`location`) | string | Keep studies with a site matching this place, e.g. |  |
| **Updated since** (`updatedSince`) | string | Keep studies whose record was updated on or after this date (YYYY-MM-DD); for daily or weekly monitoring. |  |
| **Sort** (`sort`) | string | relevance (to the search term), updated (latest record update first), newest (first posted) or start (latest start date). | `"relevance"` |
| **With posted results only** (`withResultsOnly`) | boolean | Keep only studies that have posted results. | `false` |
| **Include results** (`includeResults`) | boolean | Add posted results: each outcome measure with its value per arm and p-value, and serious adverse events in each group. | `true` |
| **Max sites per study** (`maxSites`) | integer | Sites listed per study (0 to 1,000); sitesCount and countries always cover all sites. | `50` |
| **Max studies per term** (`maxItemsPerQuery`) | integer | Per search term (1 to 5,000). | `100` |
| **Max retries** (`maxRetries`) | integer | Retries per request on timeouts, rate limits and server errors. | `3` |

![Clinical Trials Data input form](https://api.apify.com/v2/key-value-stores/wdeAWGooHdIhvFgSY/records/clinical-trials-input.png)

#### Input example

```json
{
    "conditions": [
        "glioblastoma"
    ],
    "statuses": [
        "RECRUITING"
    ],
    "phases": [
        "PHASE2",
        "PHASE3"
    ],
    "maxItemsPerQuery": 50
}
```

### ⬆️ Output

Every study becomes one row with the same fields; `source` tells you which query or lookup produced it. The run summary in the key-value store (`OUTPUT`) lists every search with the studies found, the total matching on ClinicalTrials.gov, and the error if one failed.

![Clinical Trials Data output table](https://api.apify.com/v2/key-value-stores/wdeAWGooHdIhvFgSY/records/clinical-trials-output.png)

#### Output example

One row of the dataset (NCT id lookup of NCT03548935, STEP 1; countries, sites, results and summary shortened):

```json
{
    "nctId": "NCT03548935",
    "title": "STEP 1: Research Study Investigating How Well Semaglutide Works in People Suffering From Overweight or Obesity",
    "officialTitle": "Effect and Safety of Semaglutide 2.4 mg Once-weekly in Subjects With Overweight or Obesity",
    "acronym": "STEP 1",
    "status": "COMPLETED",
    "whyStopped": null,
    "studyType": "INTERVENTIONAL",
    "phases": [
        "PHASE3"
    ],
    "enrollment": 1961,
    "conditions": [
        "Metabolism and Nutrition Disorder",
        "Overweight or Obesity"
    ],
    "interventions": [
        {
            "type": "DRUG",
            "name": "Semaglutide"
        },
        {
            "type": "DRUG",
            "name": "Placebo (semaglutide)"
        }
    ],
    "sponsor": "Novo Nordisk A/S",
    "sponsorClass": "INDUSTRY",
    "collaborators": [],
    "startDate": "2018-06-04",
    "primaryCompletionDate": "2020-03-30",
    "completionDate": "2021-03-05",
    "firstPosted": "2018-06-07",
    "lastUpdated": "2021-11-19",
    "primaryOutcomes": [
        {
            "measure": "Change in Body Weight (%)",
            "timeFrame": "Baseline (week 0) to week 68"
        },
        {
            "measure": "Participants Who Achieve 5 or More Percent Body Weight Reduction (Yes/no)",
            "timeFrame": "After week 68"
        }
    ],
    "eligibility": {
        "sex": "ALL",
        "minimumAge": "18 Years",
        "maximumAge": null,
        "healthyVolunteers": false
    },
    "summary": "This study will look at the change in participants' body weight from the start to the end of the study. The weight loss in participants taking semaglutide (a new medicine) will be compared to the...",
    "sitesCount": 128,
    "countries": [
        "United States",
        "Argentina",
        "Belgium",
        "Bulgaria",
        "Canada"
    ],
    "sites": [
        {
            "facility": "Novo Nordisk Investigational Site",
            "city": "Anniston",
            "state": "Alabama",
            "country": "United States",
            "status": null
        },
        {
            "facility": "Novo Nordisk Investigational Site",
            "city": "Anaheim",
            "state": "California",
            "country": "United States",
            "status": null
        }
    ],
    "hasResults": true,
    "results": {
        "outcomes": [
            {
                "type": "PRIMARY",
                "title": "Change in Body Weight (%)",
                "timeFrame": "Baseline (week 0) to week 68",
                "unit": "Percentage point",
                "paramType": "MEAN",
                "dispersion": "Standard Deviation",
                "groups": [
                    {
                        "group": "Semaglutide 2.4 mg",
                        "value": "-15.6",
                        "spread": "10.1"
                    },
                    {
                        "group": "Placebo",
                        "value": "-2.8",
                        "spread": "6.5"
                    }
                ],
                "pValue": "<.0001",
                "method": "ANCOVA"
            }
        ],
        "adverseEvents": [
            {
                "group": "Sema 2.4 mg",
                "atRisk": 1306,
                "serious": 128,
                "other": 1052,
                "deaths": 1
            },
            {
                "group": "Placebo",
                "atRisk": 655,
                "serious": 42,
                "other": 447,
                "deaths": 1
            }
        ]
    },
    "url": "https://clinicaltrials.gov/study/NCT03548935",
    "source": "NCT id lookup"
}
```

#### Run summary (OUTPUT)

The key-value store record `OUTPUT` has the self-check and one line per search with the total number of matching studies, so you know how much more there is:

```json
{
    "ok": true,
    "rows": 50,
    "problems": [],
    "tasks": [
        {
            "task": "condition: glioblastoma",
            "ok": true,
            "rows": 50,
            "totalMatching": 133,
            "error": null
        }
    ]
}
```

View the results as a table or JSON in the Output tab and download them as JSON, CSV, Excel, XML, HTML or RSS, all fields or only those you pick.

### 💰 How much does Clinical Trials Data cost?

Clinical Trials Data is priced **per event**: **2 USD per 1,000 studies** (0.002 USD each), with no monthly rental. Each saved row is one charge; a study found by two searches is counted once, and an empty one costs zero.

| You get | You pay |
|---|---|
| 100 studies | 0.2 USD |
| 1,000 studies | 2 USD |
| 10,000 studies | 20 USD |
| 100,000 studies | 200 USD |

💡 Apify's free plan gives you 5 USD of credit every month, enough for about **2,500 studies** at no cost. Set a spending limit per run and the Actor stops there.

### ⚖️ Clinical Trials Data vs. the alternatives

| | Clinical Trials Data | ClinicalTrials.gov website | Commercial trial databases |
|---|---|---|---|
| **Source** | ✅ official API v2 | ✅ official | curated copies |
| **Many conditions, drugs and sponsors per run** | ✅ | one search at a time | ✅ |
| **Posted results per arm as data** | ✅ values and p-values | per study page | ✅ |
| **Sites by country in every row** | ✅ | per study page | ✅ |
| **Price** | 2 USD per 1,000 studies | free, manual | enterprise licence |
| **API, schedules and MCP for AI agents** | ✅ | own API, code needed | varies |

### 🔌 Integrations, API and MCP

#### Connect Clinical Trials Data to your AI agent (MCP)

Give Claude, ChatGPT, Cursor or any MCP client direct access to Clinical Trials Data through the [Apify MCP server](https://mcp.apify.com). Add this URL to its settings:

```text
https://mcp.apify.com/?actors=bepolabs/clinical-trials
```

For Claude Desktop, add it under `mcpServers` in `claude_desktop_config.json`:

```json
{
    "mcpServers": {
        "clinical-trials": {
            "command": "npx",
            "args": [
                "-y",
                "@apify/actors-mcp-server",
                "--actors",
                "bepolabs/clinical-trials"
            ],
            "env": {
                "APIFY_TOKEN": "<your Apify API token>"
            }
        }
    }
}
```

Then ask: *"Find all recruiting phase 3 trials for type 2 diabetes with a site in Germany and list sponsor, drug and enrollment."*

#### Run it from your code

Python (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("bepolabs/clinical-trials").call(run_input={"conditions":["glioblastoma"],"statuses":["RECRUITING"],"phases":["PHASE2","PHASE3"],"maxItemsPerQuery":50})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

JavaScript (`npm install apify-client`):

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('bepolabs/clinical-trials').call({"conditions":["glioblastoma"],"statuses":["RECRUITING"],"phases":["PHASE2","PHASE3"],"maxItemsPerQuery":50});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### No-code integrations

Send results to **Google Sheets, Slack, Airtable, HubSpot, Make, Zapier, n8n** and more from the Integrations tab, start runs on a **schedule**, or trigger your own endpoint with a **webhook** when a run finishes. The [Apify API](https://docs.apify.com/api/v2) gives you full control over runs and datasets.

### ❓ FAQ

##### Where does the data come from?

From the official [ClinicalTrials.gov API v2](https://clinicaltrials.gov/data-api/api) of the US National Library of Medicine. Every run asks it live, so you get the latest record versions.

##### How do I monitor new or changed trials?

Set `updatedSince` to your last run date and `sort` to `updated`, then schedule the Actor daily or weekly.

##### What is in the results field?

For studies with posted results: each outcome measure with type, title, time frame, unit and the value and spread per arm, the first statistical analysis's p-value and method, and per group the number at risk, serious and other adverse events and deaths.

##### How many studies can I get?

Up to 5,000 per search term, 100 terms and 1,000 NCT ids per run. The run summary shows how many studies match in total.

##### Is this medical advice?

No. The Actor returns registry records as published. Talk to a doctor before joining or judging a trial.

##### Is it legal to use Clinical Trials Data?

Yes. ClinicalTrials.gov data is published by the US National Library of Medicine for open use, and the Actor reads it through the official public API. Follow the [ClinicalTrials.gov terms](https://clinicaltrials.gov/about-site/terms-conditions) when you reuse it, for example by not implying endorsement by NLM.

##### What if something is missing or does not work?

Open an issue on the **Issues** tab; we read each one and reply. Feature requests are welcome too.

### 💬 Your feedback

Tell us what Clinical Trials Data should add on the **Issues** tab or leave a review; your notes decide what we work on next.

### 🔗 Related Actors

| Actor | What it does |
|---|---|
| 📄 [PDF to Text and Markdown](https://apify.com/bepolabs/pdf-to-text) | PDFs to clean text and Markdown, per page, per document or as RAG chunks, with columns in reading order and headers and footers removed. |
| 🏛️ [SEC EDGAR Filings](https://apify.com/bepolabs/sec-edgar) | Tickers or CIK numbers to SEC filings: 10-K, 10-Q, 8-K, Form 4 and any other form, with document links. |
| 🌦️ [US Weather Forecast](https://apify.com/bepolabs/us-weather) | Official National Weather Service forecasts, hourly and 7-day, plus active weather alerts for any US point or state. |
| 📈 [Wikipedia Pageviews](https://apify.com/bepolabs/wikipedia-pageviews) | Daily or monthly views of any Wikipedia article in any language, with totals and averages, from the official Wikimedia API. |
| 💼 [ATS Jobs](https://apify.com/bepolabs/ats-jobs) | Every open job from company career boards on Greenhouse, Lever, Ashby, Workable, SmartRecruiters and Recruitee in one deduped feed. |

# Changelog

This Actor's version history is a separate document: https://apify.com/bepolabs/clinical-trials/changelog.md

# Actor input Schema

## `conditions` (type: `array`):

Diseases or conditions, e.g. glioblastoma or type 2 diabetes; one search each, results deduped across terms.

## `drugs` (type: `array`):

Drug, device or procedure names, e.g. semaglutide or pembrolizumab; one search each.

## `sponsors` (type: `array`):

Lead sponsors or collaborators, e.g. Pfizer or National Cancer Institute; one search each.

## `searchTerms` (type: `array`):

Free text over all study fields; one search each.

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

Look up these studies directly, e.g. NCT05132088 or its clinicaltrials.gov URL.

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

Keep only studies with one of these statuses (empty: all).

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

Keep only studies in one of these phases (empty: all). NA: not applicable, e.g. device or behavioral studies.

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

Interventional, observational or expanded access (empty: all).

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

Keep studies with a site matching this place, e.g. Germany, Boston or Texas.

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

Keep studies whose record was updated on or after this date (YYYY-MM-DD); for daily or weekly monitoring.

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

relevance (to the search term), updated (latest record update first), newest (first posted) or start (latest start date).

## `withResultsOnly` (type: `boolean`):

Keep only studies that have posted results.

## `includeResults` (type: `boolean`):

Add posted results: each outcome measure with its value per arm and p-value, and serious adverse events in each group.

## `maxSites` (type: `integer`):

Sites listed per study (0 to 1,000); sitesCount and countries always cover all sites.

## `maxItemsPerQuery` (type: `integer`):

Per search term (1 to 5,000).

## `maxRetries` (type: `integer`):

Retries per request on timeouts, rate limits and server errors.

## Actor input object example

```json
{
  "conditions": [
    "glioblastoma"
  ],
  "sort": "relevance",
  "withResultsOnly": false,
  "includeResults": true,
  "maxSites": 50,
  "maxItemsPerQuery": 100,
  "maxRetries": 3
}
```

# Actor output Schema

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

Dataset items, one row per result, in the overview table view.

# 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 = {
    "conditions": [
        "glioblastoma"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("bepolabs/clinical-trials").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 = { "conditions": ["glioblastoma"] }

# Run the Actor and wait for it to finish
run = client.actor("bepolabs/clinical-trials").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 '{
  "conditions": [
    "glioblastoma"
  ]
}' |
apify call bepolabs/clinical-trials --silent --output-dataset

```

## MCP server setup

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

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/cLuAFQOEfqOTjtfui/builds/h2gsRlJeytJHun2I3/openapi.json
