# ClinicalTrials.gov Scraper: Clinical Trials Search & Export (`tidyharvest/clinicaltrials-scraper`) Actor

Search and export clinical trials from ClinicalTrials.gov by condition, drug, sponsor, location, phase, status, age, sex and funder: NCT id, titles, status, phases, sponsor, enrollment, dates, sites, eligibility and outcomes. Official API, no proxy. $0.80 per 1,000 studies.

- **URL**: https://apify.com/tidyharvest/clinicaltrials-scraper.md
- **Developed by:** [TidyHarvest](https://apify.com/tidyharvest) (community)
- **Categories:** Lead generation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.48 / 1,000 study scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Trials Search & Export

Search and export **clinical trials from ClinicalTrials.gov** by **condition, drug or intervention, sponsor, location, phase and recruitment status**, as clean flat rows ready for a spreadsheet: NCT id, titles, status, phases, conditions, interventions, sponsor and collaborators, enrollment, key dates, trial sites, eligibility and primary outcomes. **$0.80 per 1,000 studies**, no start fee.

It reads the official ClinicalTrials.gov Data API (v2) run by the U.S. National Library of Medicine, so there is no browser, no proxy and nothing to break when the website changes. A 1,000-study export takes about 30 seconds, full records included.

### What you can do with it

- **Pharma and biotech competitive intelligence:** every Phase 2/3 trial for an indication or a competitor's drug, with sponsor, enrollment and completion dates.
- **Site and investigator scouting:** which hospitals and cities are running recruiting trials in your therapeutic area.
- **Patient recruitment and advocacy:** a current list of recruiting studies for a condition near a location, with eligibility (age, sex, healthy volunteers).
- **Monitoring:** schedule a daily or weekly run with *Updated on or after* to catch new and changed trials.
- **Research and data science:** bulk exports for meta-research, dashboards, or as context for an AI assistant (`includeRaw` gives the full record).

### Input

All fields are optional. With an empty input you get the 50 most recently updated recruiting studies.

| Field | What it does |
|---|---|
| `condition` | Condition or disease, e.g. `type 2 diabetes`. |
| `query` | Free text across the whole record; supports AND / OR / NOT and quotes. |
| `intervention` | Drug, device or procedure, e.g. `pembrolizumab`. |
| `location` | City, state, country or facility. |
| `sponsor` | Lead sponsor or collaborator. |
| `leadSponsor` | Lead sponsor only (collaborators don't count). |
| `titleOrAcronym` | Search titles and acronyms only, e.g. `KEYNOTE`. |
| `outcomeMeasure` | Search outcome measures, e.g. `overall survival`. |
| `statuses` | Recruiting, completed, terminated, ... (multi-select). |
| `phases` | Early phase 1 to Phase 4, or not applicable (multi-select). |
| `studyType` | Interventional, observational or expanded access. |
| `sex`, `ageGroups`, `acceptsHealthyVolunteers` | Who can enroll: female/male, child/adult/older adult, healthy volunteers. |
| `funderTypes` | Lead sponsor class: industry, NIH, other US federal, other (universities, hospitals...). |
| `startDateFrom`, `startDateTo` | Start date range. |
| `primaryCompletionDateFrom`, `primaryCompletionDateTo` | Primary completion range: find readouts coming up. |
| `firstPostedFrom`, `firstPostedTo`, `updatedSince` | New registrations, or anything updated since a date. |
| `onlyWithResults` | Only studies with posted results. |
| `nctIds` | Look up specific studies by NCT number or study URL. |
| `sortBy` | Relevance, last updated, start date, first posted, enrollment. |
| `includeEligibilityText` | Adds the full inclusion/exclusion criteria text. |
| `includeRaw` | Adds the complete study record (`protocolSection`). |
| `maxItems` | Cap on studies returned (default 50, up to 20,000). |

Example:

```json
{ "condition": "obesity", "intervention": "tirzepatide", "statuses": ["RECRUITING"], "phases": ["PHASE3"], "maxItems": 200 }
```

### Output

One item per study:

```json
{
  "nctId": "NCT07010263",
  "briefTitle": "A Study of AK112 as Consolidation Treatment for Patients With Limited Stage Small-cell Lung Cancer ...",
  "overallStatus": "RECRUITING",
  "phases": ["PHASE3"],
  "studyType": "INTERVENTIONAL",
  "conditions": ["Small Cell Lung Cancer"],
  "interventions": [{ "name": "AK112", "type": "DRUG" }, { "name": "Placebo", "type": "OTHER" }],
  "sponsor": "Akeso", "sponsorClass": "INDUSTRY", "collaborators": [],
  "enrollment": 560, "enrollmentType": "ESTIMATED",
  "startDate": "2025-06-13", "primaryCompletionDate": "2028-12-31", "completionDate": "2029-07-31",
  "firstPosted": "2025-06-08", "lastUpdate": "2026-03-05",
  "locationCount": 53, "countries": ["China"],
  "locations": [{ "facility": "Beijing Cancer Hospital", "city": "Beijing", "state": "Beijing Municipality", "zip": "100142", "country": "China", "status": "RECRUITING" }],
  "sex": "ALL", "minimumAge": "18 Years", "maximumAge": null, "healthyVolunteers": false,
  "primaryOutcomes": [{ "measure": "Progression-Free Survival (PFS) ...", "timeFrame": "Approximately 6 years" }],
  "briefSummary": "This is a randomized, double-blind, phase III clinical study ...",
  "hasResults": false,
  "url": "https://clinicaltrials.gov/study/NCT07010263",
  "source": "ClinicalTrials.gov",
  "dataProcessedAt": "2026-10-09T09:00:05",
  "attribution": "Source: ClinicalTrials.gov, a service of the U.S. National Library of Medicine. ..."
}
```

Also included: `officialTitle`, `acronym`, `primaryPurpose`, `keywords`. A run's `SUMMARY` record (key-value store) has the total number of matching studies and any NCT ids that were not found.

### How to use

1. Enter a condition, drug, sponsor or location (or a list of NCT ids), and pick status and phase filters if you want them.
2. Set **Max studies** to the number you need.
3. Run, then download the dataset as CSV, Excel or JSON, or call it through the Apify API.

### Pricing

Pay per result: **$0.80 per 1,000 studies** (`study-scraped` event). All filters and your *Max studies* cap apply before you are charged, and a run that finds nothing fails instead of returning an empty dataset.

### Limits and notes

- Data is whatever sponsors registered on ClinicalTrials.gov; fields a study doesn't report are `null` or empty. ClinicalTrials.gov updates daily; `dataProcessedAt` shows the date of the data you received.
- To respect the API's rate guidance (about 50 requests per minute), the actor paces its requests. Each request returns up to 1,000 studies, so this rarely matters.
- Contact names, phone numbers and email addresses are not included in the flat rows, and email addresses are removed from the raw record too. ClinicalTrials.gov's terms forbid using email addresses from its database for marketing.

### Data source and attribution

Source: ClinicalTrials.gov, a service of the U.S. National Library of Medicine (NLM), National Institutes of Health. The data comes through the official ClinicalTrials.gov API. This actor flattens and renames fields, keeps a subset of them (unless `includeRaw` is on), and removes contact email addresses. No values are otherwise changed. When you publish or distribute this data, the [ClinicalTrials.gov terms](https://clinicaltrials.gov/about-site/terms-conditions) ask you to credit ClinicalTrials.gov, show the date it was processed, keep it current and describe any changes you make. Every row carries `source`, `dataProcessedAt` and `attribution` fields for this purpose.

This actor is not affiliated with or endorsed by ClinicalTrials.gov, the National Library of Medicine, the NIH or the U.S. government. Nothing here is medical advice.

# Actor input Schema

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

Search by condition, e.g. `type 2 diabetes`, `breast cancer`, `long covid`. Leave everything empty to get the most recently updated recruiting studies.

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

Free-text search across the whole study record, e.g. `GLP-1`, `CRISPR`, `semaglutide AND obesity`. Supports the ClinicalTrials.gov search syntax (AND, OR, NOT, quotes).

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

Drug, device, procedure or behavioral intervention name, e.g. `pembrolizumab`, `tirzepatide`.

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

City, state, country or facility name, e.g. `Boston`, `California`, `Germany`, `Mayo Clinic`.

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

Lead sponsor or collaborator name, e.g. `Pfizer`, `National Cancer Institute`.

## `leadSponsor` (type: `string`):

Only studies whose lead sponsor matches (collaborators don't count), e.g. `Pfizer`.

## `titleOrAcronym` (type: `string`):

Search only study titles and acronyms, e.g. `KEYNOTE` or `SURMOUNT`.

## `outcomeMeasure` (type: `string`):

Search primary and secondary outcome measures, e.g. `overall survival` or `HbA1c`.

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

Keep only studies with one of these overall statuses. Empty = any status.

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

Keep only studies in one of these phases. Empty = any phase.

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

Interventional (clinical trials), observational, or expanded access.

## `sex` (type: `string`):

Studies open to this sex (studies open to all are included).

## `ageGroups` (type: `array`):

Studies enrolling any of these age groups: child (under 18), adult (18-64), older adult (65+). Empty = any age.

## `acceptsHealthyVolunteers` (type: `boolean`):

Keep only studies that accept healthy volunteers.

## `funderTypes` (type: `array`):

Lead sponsor class: industry, NIH, other US federal agency, or other (universities, hospitals, foundations...). Empty = any.

## `startDateFrom` (type: `string`):

Only studies whose start date is on or after this date (YYYY-MM-DD).

## `startDateTo` (type: `string`):

Only studies whose start date is on or before this date (YYYY-MM-DD).

## `primaryCompletionDateFrom` (type: `string`):

Only studies whose (anticipated) primary completion date is on or after this date. Useful to find readouts coming up.

## `primaryCompletionDateTo` (type: `string`):

Only studies whose (anticipated) primary completion date is on or before this date.

## `firstPostedFrom` (type: `string`):

Only studies first posted on ClinicalTrials.gov on or after this date: new registrations.

## `firstPostedTo` (type: `string`):

Only studies first posted on or before this date.

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

Only studies whose record was last updated on or after this date. Ideal for scheduled monitoring runs.

## `onlyWithResults` (type: `boolean`):

Keep only studies that have results posted on ClinicalTrials.gov.

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

Look up specific studies by NCT number (e.g. `NCT07010263`) or paste study URLs. Combined with any other filters you set. Ids not found are listed in the run's SUMMARY record.

## `sortBy` (type: `string`):

Order of results. Relevance applies when you give a search term; without one, the most recently updated studies come first.

## `includeEligibilityText` (type: `boolean`):

Adds `eligibilityCriteria` with the full inclusion/exclusion text (long).

## `includeRaw` (type: `boolean`):

Adds `protocolSection`, the complete study record as published by the API (arms, all outcomes, design details, location coordinates). Contact email addresses are removed.

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

Hard cap on studies returned (and on your cost).

## Actor input object example

```json
{
  "condition": "type 2 diabetes",
  "studyType": "ANY",
  "sex": "ALL",
  "acceptsHealthyVolunteers": false,
  "onlyWithResults": false,
  "sortBy": "relevance",
  "includeEligibilityText": false,
  "includeRaw": false,
  "maxItems": 50
}
```

# Actor output Schema

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

Clinical studies from ClinicalTrials.gov, one item per study.

# 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": "type 2 diabetes"
};

// Run the Actor and wait for it to finish
const run = await client.actor("tidyharvest/clinicaltrials-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 = { "condition": "type 2 diabetes" }

# Run the Actor and wait for it to finish
run = client.actor("tidyharvest/clinicaltrials-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 '{
  "condition": "type 2 diabetes"
}' |
apify call tidyharvest/clinicaltrials-scraper --silent --output-dataset

```

## MCP server setup

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