# ClinicalTrials.gov Scraper – Trials, Phases & Sponsors (`biddata/clinicaltrials-scraper`) Actor

Scrape ClinicalTrials.gov trials by keyword. Export NCT ID, title, status, phase, conditions, sponsor, enrollment and dates. Official ClinicalTrials.gov API v2 - no key, no browser. For pharma researchers, CROs and medical writers.

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

## Pricing

from $2.00 / 1,000 result rows

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 – Trial Records, Phases & Sponsors

**Every registered clinical trial matching your keyword, straight from the official ClinicalTrials.gov API v2 — no browser, no proxy, no API key.**

ClinicalTrials.gov is the world's largest trial registry: 500,000+ studies registered by sponsors in 200+ countries, including phase, conditions, interventions, enrollment and sponsor for each one.

This Actor queries the registry's own documented JSON API and returns one flat row per trial, so you can load it into a spreadsheet, a CRM or a database without touching the deeply nested `protocolSection` tree the raw API returns.

### Why this Actor

| | Typical scrapers | This Actor |
|---|---|---|
| Data source | HTML pages and JavaScript render trees | Official `clinicaltrials.gov/api/v2` JSON API |
| Breaks on redesign | Often | No — versioned, documented endpoint |
| Proxies / CAPTCHA | Usually needed | Never |
| API key | Varies | None — anonymous public access |
| Output shape | Nested modules, 10+ levels deep | One flat row per trial, fixed schema |

### What you get

One dataset item per clinical trial, with the fields below.

| Field | Type | Description |
|---|---|---|
| `nct_id` | string | Registry identifier, e.g. NCT03761914. Stable key, safe to de-duplicate on. |
| `title` | string | Brief title of the study as registered. |
| `status` | string | Overall recruitment status code, e.g. RECRUITING, COMPLETED. |
| `phase` | string | Trial phase, e.g. Phase 2, Early Phase 1, Not Applicable. Multiple phases are joined with a pipe. |
| `conditions` | string | Studied conditions/diseases, pipe separated. |
| `interventions` | string | Drugs, devices, biologics and procedures with their type, pipe separated. |
| `start_date` | string | Study start date, YYYY-MM-DD. May be YYYY-MM when only the month was registered. |
| `completion_date` | string | Primary completion date, falling back to the overall completion date. |
| `enrollment` | number | Target or actual enrollment count, as registered. |
| `sponsor` | string | Lead sponsor name (company, university, hospital or agency). |
| `url` | string | Public study page on clinicaltrials.gov. |

- **`completion_date`** -- Uses the primary completion date when present (when the last participant was measured for the primary outcome), and falls back to the overall completion date.
- **`phase`** -- Multiple phases such as Phase 1 and Phase 2 are joined into `Phase 1 | Phase 2`; observational studies report `Not Applicable`.
- **`enrollment`** -- The registry mixes target and actual counts and the API labels which — this Actor preserves the number and does not guess.

### Input

| Parameter | Type | Default | Description |
|---|---|---|---|
| `keyword` | string | `pembrolizumab` | **Required.** Disease, drug, intervention, sponsor or free-text phrase sent to the registry as query.term. Single words or short phrases work best (pembrolizumab, diabetic retinopathy, CAR-T). |
| `maxResults` | integer | `25` | Maximum number of trial records to save. The API returns 100 studies per page, so the Actor walks through pages until this number is reached. |
| `status` | string | *(empty)* | Comma-separated overall status codes to keep, e.g. RECRUITING or RECRUITING,ACTIVE_NOT_RECRUITING. Leave empty for all statuses. Valid codes: RECRUITING, ACTIVE_NOT_RECRUITING, ENROLLING_BY_INVITATION, NOT_YET_RECRUITING, COMPLETED, SUSPENDED, TERMINATED, WITHDRAWN, UNKNOWN. |

### Usage examples

**1. Recent immunotherapy trials that are still recruiting**

```json
{
  "keyword": "pembrolizumab",
  "status": "RECRUITING",
  "maxResults": 50
}
```

**2. Everything registered for a disease, newest updates first**

```json
{
  "keyword": "diabetic retinopathy",
  "maxResults": 200
}
```

Schedule it daily with Apify Schedules and connect a webhook, Google Sheets or Airtable to track newly registered trials for a therapeutic area. Because every row carries a stable `nct_id`, de-duplicating across runs is a one-line operation.

### Data notes

- The registry is updated by sponsors, not by the Actor: a trial's status can change between runs.
- Free-text search matches titles, conditions, interventions and summaries, so a broad keyword returns a broad set.
- Records with no registered phase, enrollment or completion date are returned with empty values instead of being dropped.

### Pricing

This Actor uses pay-per-event pricing. You only pay for what you actually get.

| Event | Price | When it is charged |
|---|---|---|
| Actor start | $0.002 | Once per run |
| Result row | $0.002 per row | For every row saved to the dataset |

That works out to **$2 per 1,000 rows**. A typical run returning 50 rows costs about **$0.10** in total.

No subscription is required. You can cap your spend with the max cost per run setting in Apify Console, and an empty or invalid input charges only the start event.

### FAQ

**Do I need an API key or a ClinicalTrials.gov account?**

No. API v2 is public and anonymous. There is nothing to register and no key to paste.

**Is this legal?**

Yes. ClinicalTrials.gov is a US government registry operated by the National Library of Medicine, and its API is published for exactly this kind of reuse. The Actor makes one request per 100 records and identifies itself with a normal user agent.

**Why are some phase or enrollment values empty?**

Because the sponsor did not register them. The registry allows several fields to be omitted, and the Actor returns empty values rather than inventing data.

**Does it include trial results?**

No. This Actor exports registry metadata (identification, status, design, conditions, interventions, sponsor). Posted results tables and adverse events are a separate API area and are not included.

### Related Actors

More data tools from the same publisher:

- [App Store Reviews Scraper](https://apify.com/biddata/app-reviews-scraper) - App Store and Steam user reviews with ratings, versions and dates.
- [EU Tenders Scraper](https://apify.com/biddata/ted-tenders-scraper) - EU public procurement notices from the official TED API.
- [Federal Register Scraper](https://apify.com/biddata/federal-register-scraper) - US Federal Register documents, rules and notices.
- [arXiv Scraper](https://apify.com/biddata/arxiv-scraper) - arXiv papers with authors, abstracts and PDF links.
- [Hacker News Scraper](https://apify.com/biddata/hackernews-scraper) - Hacker News stories by keyword, top ranking or newest.
- [Weather Scraper](https://apify.com/biddata/weather-scraper) - Weather forecast and history for any city worldwide.

### Disclaimer

All data is retrieved in real time from **ClinicalTrials.gov**, a service of the U.S. National Library of Medicine, via its public API v2. This Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by the NIH, NLM or any government agency.

Registry records are self-reported by trial sponsors and can be incomplete, delayed or corrected after publication. Verify any record against its `url` before making clinical, regulatory or commercial decisions. This dataset is a research aid, not medical advice.

# Actor input Schema

## `keyword` (type: `string`):

Disease, drug, intervention, sponsor or free-text phrase sent to the registry as query.term. Single words or short phrases work best (pembrolizumab, diabetic retinopathy, CAR-T).

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

Maximum number of trial records to save. The API returns 100 studies per page, so the Actor walks through pages until this number is reached.

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

Comma-separated overall status codes to keep, e.g. RECRUITING or RECRUITING,ACTIVE_NOT_RECRUITING. Leave empty for all statuses. Valid codes: RECRUITING, ACTIVE_NOT_RECRUITING, ENROLLING_BY_INVITATION, NOT_YET_RECRUITING, COMPLETED, SUSPENDED, TERMINATED, WITHDRAWN, UNKNOWN.

## Actor input object example

```json
{
  "keyword": "pembrolizumab",
  "maxResults": 25,
  "status": ""
}
```

# Actor output Schema

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

All collected records in the default dataset, one row per record.

# 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 = {
    "keyword": "pembrolizumab",
    "maxResults": 25,
    "status": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("biddata/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 = {
    "keyword": "pembrolizumab",
    "maxResults": 25,
    "status": "",
}

# Run the Actor and wait for it to finish
run = client.actor("biddata/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 '{
  "keyword": "pembrolizumab",
  "maxResults": 25,
  "status": ""
}' |
apify call biddata/clinicaltrials-scraper --silent --output-dataset

```

## MCP server setup

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