# ClinicalTrials.gov Scraper: Studies, Sponsors & Sites (`winterlock/clinicaltrials-scraper`) Actor

Search every clinical study on ClinicalTrials.gov by condition, intervention, sponsor, location, phase or status. Flattens the nested study record into one clean row. Official NIH API, no key, no login, no scraping.

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

## Pricing

$10.00 / 1,000 study records

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: Studies, Sponsors & Sites

Search the world's largest clinical trials registry and get every study back as a flat, analysable row. Filter by condition, intervention, sponsor, location, phase, study type or recruitment status.

Two modes:

| Mode | What you get |
|---|---|
| **Search studies** | Every study matching your filters, with status, phase, enrolment, sponsor, conditions, interventions, eligibility and site countries |
| **Look up NCT IDs** | Full records for a list of NCT identifiers |

### Why use this one

- **Official NIH API only.** This reads `clinicaltrials.gov/api/v2`, the endpoint the National Library of Medicine publishes for programmatic access. No HTML parsing, no key, no login, no terms-of-service grey area.
- **The nesting is flattened for you.** A raw study record buries every fact under `protocolSection.someModule.someStruct.date`. This Actor lifts the ones researchers actually filter on into plain columns: `status`, `phases`, `enrollment`, `leadSponsor`, `minimumAge`, `countries`. Drop it straight into Excel or a database.
- **Proper token paging.** The v2 API pages with an opaque token, not an offset. The Actor follows it to the end, so a search for 40,000 studies really returns 40,000 studies.
- **Built for competitive and regulatory research.** Track a competitor's pipeline by sponsor, find recruiting sites in your region, or watch a condition for newly posted trials.

### How to use it

1. Choose **What to collect**.
2. Fill in at least one search field — **Condition**, **Intervention**, **Sponsor**, **Location**, **Search term** or a **Recruitment status**.
3. Click **Start**, then download results as JSON, CSV, Excel or HTML, or fetch them through the Apify API.

#### Example input: recruiting phase 3 diabetes trials

```json
{
  "mode": "search",
  "condition": "diabetes",
  "statuses": ["RECRUITING"],
  "studyType": "interventional",
  "sort": "LastUpdatePostDate:desc",
  "maxResults": 1000
}
```

#### Example input: one sponsor's whole pipeline

```json
{
  "mode": "search",
  "sponsor": "Novo Nordisk",
  "maxResults": 2000
}
```

#### Example input: look up specific studies

```json
{
  "mode": "studyDetails",
  "nctIds": ["NCT02807935", "https://clinicaltrials.gov/study/NCT04280705"]
}
```

### Output

Every item has `type: "study"`. The dataset has ready-made **Studies** and **Design and eligibility** table views.

```json
{
  "type": "study",
  "nctId": "NCT02807935",
  "title": "A Study of Metformin in Newly Diagnosed Type 2 Diabetes",
  "status": "COMPLETED",
  "studyType": "INTERVENTIONAL",
  "phases": ["PHASE3"],
  "enrollment": 420,
  "enrollmentType": "ACTUAL",
  "allocation": "RANDOMIZED",
  "primaryPurpose": "TREATMENT",
  "masking": "DOUBLE",
  "leadSponsor": "Sheba Medical Center",
  "leadSponsorClass": "OTHER",
  "conditions": ["Type 2 Diabetes"],
  "interventionTypes": ["DRUG"],
  "interventionNames": ["Metformin"],
  "sex": "ALL",
  "minimumAge": "18 Years",
  "maximumAge": "75 Years",
  "healthyVolunteers": false,
  "startDate": "2016-06-01",
  "completionDate": "2019-12-31",
  "locationCount": 3,
  "countries": ["Israel"],
  "hasResults": true,
  "url": "https://clinicaltrials.gov/study/NCT02807935"
}
```

### Pricing

Pay only for results:

| Result | Price |
|---|---|
| Study record | $10.00 per 1,000 |

Set a maximum spend per run in the run options and the Actor stops cleanly when it's reached.

### Limits to know about

These come from the registry, not from this Actor:

- **Up to 1,000 studies per page.** The Actor follows the page token automatically, so the only real limit is your *Max studies* setting.
- **Only the first five sites are listed per study**, as a readable summary, alongside the full site count and the distinct countries. Studies with hundreds of sites would otherwise swamp a spreadsheet.
- **`hasResults` tells you whether posted results exist**, but this Actor returns the protocol record rather than the full results tables.
- **Registry data is self-reported by sponsors.** Dates, enrolment figures and statuses are only as current as the sponsor's last update, which `lastUpdateDate` tells you.
- **Status filters use the registry's own vocabulary** (`RECRUITING`, `ACTIVE_NOT_RECRUITING`, and so on). An unrecognised value stops the run with a message listing the valid ones.

### FAQ

**Do I need an account or API key?** No. The ClinicalTrials.gov API is open and keyless.

**Can I watch a condition for new trials?** Yes. Schedule the Actor daily in Apify Console with `sort` set to `LastUpdatePostDate:desc`, and connect the dataset to Slack, Google Sheets, Zapier or Make.

**What is an NCT ID?** The registry's unique identifier for a study, always `NCT` followed by eight digits. Every row includes one plus a direct link.

**Why is `phases` empty for some studies?** Observational studies have no phase. The field is an array because some interventional studies span two, such as `["PHASE1", "PHASE2"]`.

**Is this legal?** Yes. ClinicalTrials.gov is a public US government registry and its API is published for exactly this purpose, with no authentication.

### Feedback

Found a bug or need a field that's missing? Open an issue on the Actor's **Issues** tab.

# Actor input Schema

## `mode` (type: `string`):

Search the registry, or pull full records for specific NCT identifiers.

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

For Look up. Identifiers like NCT02807935, or any ClinicalTrials.gov URL containing one.

## `searchTerm` (type: `string`):

Free-text search across the whole record.

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

For example diabetes, breast cancer, long COVID.

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

A drug, device, procedure or behavioural treatment.

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

City, state or country where the study has sites.

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

The organisation running or funding the study.

## `outcome` (type: `string`):

Search the study's stated outcome measures.

## `studyTitle` (type: `string`):

Search study titles only.

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

Limit to these statuses. Leave empty for all.

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

Interventional studies test a treatment; observational studies watch without assigning one.

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

For example LastUpdatePostDate:desc, StartDate:desc or EnrollmentCount:desc. Leave empty for relevance.

## `maxResults` (type: `integer`):

The API returns up to 1,000 per page and the Actor follows the page token until it has this many.

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

Stop the run after saving this many items. Leave empty for no limit.

## `maxConcurrency` (type: `integer`):

Search pages in order, so this mostly matters when looking up many NCT IDs at once.

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

Not needed. The ClinicalTrials.gov API is open to datacenter traffic.

## Actor input object example

```json
{
  "mode": "search",
  "condition": "diabetes",
  "studyType": "any",
  "maxResults": 100,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

No description

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

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

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

```

## MCP server setup

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