# 🧬 ClinicalTrials Status History & Termination Intelligence (`snuggly_beanie_970/clinicaltrials-status-history-intelligence`) Actor

Recover verified ClinicalTrials.gov status transitions by NCT ID. Export previous/new status, transition date, termination signals, changed modules and sponsor context.

- **URL**: https://apify.com/snuggly\_beanie\_970/clinicaltrials-status-history-intelligence.md
- **Developed by:** [Ilia](https://apify.com/snuggly_beanie_970) (community)
- **Categories:** Automation, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 verified trial history events

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 🧬 ClinicalTrials Status History & Termination Intelligence

Get verified historical status transitions for a watchlist of ClinicalTrials.gov studies. Instead of comparing only today's snapshot with yesterday's, this Actor reads the registry's own version history and reconstructs each transition with its date, previous status, new status and changed record modules.

### Why this is different

Most ClinicalTrials Actors search and export the latest study record. Some checkpoint current snapshots, which starts detecting changes only after you create a task. This Actor can immediately recover the already-published transition history for an NCT ID and distinguish real status transitions from ordinary protocol revisions.

### 📤 What you get

- Exact version and transition date
- Previous and new recruitment status
- Adverse-transition flag for Suspended, Terminated, Withdrawn and Unknown
- Deterministic severity and the modules changed in that version
- Current `whyStopped`, title, sponsor/class, phase, type, enrollment, conditions and interventions
- Current status, last update date, total version count and official study/history links

### Example input

```json
{"nctIds":["NCT04368728","NCT03545607"],"changedSince":"2020-01-01","includeAllVersions":false,"riskTransitionsOnly":false,"maxEventsPerTrial":50}
```

Set `includeAllVersions` to inspect protocol, outcome, eligibility and location revision activity even when recruitment status did not move. Use `riskTransitionsOnly` for a compact termination/suspension alert feed.

### 💰 Pricing

Pay per verified history event. Empty or invalid-transition result sets do not incur result charges; use Apify's per-run charge ceiling for a hard budget cap.

Data comes from the official ClinicalTrials.gov API and record-history service maintained by the U.S. National Library of Medicine.

### 📥 Complete input reference

| Field | Type | Default | Purpose |
|---|---|---:|---|
| `nctIds` | array | `["NCT04368728"]` | Trial IDs to audit, such as NCT04368728. Up to 200 per run. |
| `changedSince` | string | — | Optional ISO date YYYY-MM-DD. Leave empty for complete status history. |
| `includeAllVersions` | boolean | `false` | Also emit revisions where the status stayed the same, with the changed module labels. |
| `riskTransitionsOnly` | boolean | `false` | Keep transitions into Suspended, Terminated, Withdrawn or Unknown status. |
| `maxEventsPerTrial` | integer | `50` | Newest matching history events retained for each NCT ID. |

### 📤 Complete output reference

The default dataset is exportable as JSON, CSV, Excel, XML or RSS. Fields remain stable for scheduled runs and API integrations.

| Field | Type |
|---|---|
| `eventKey` | string |
| `nctId` | string |
| `version` | integer |
| `changeDate` | string |
| `previousStatus` | string / null |
| `newStatus` | string |
| `isStatusTransition` | boolean |
| `isAdverseTransition` | boolean |
| `severity` | string |
| `changedModules` | array |
| `whyStopped` | string |
| `briefTitle` | string |
| `officialTitle` | string |
| `leadSponsor` | string |
| `sponsorClass` | string |
| `phases` | array |
| `studyType` | string |
| `enrollment` | integer / null |
| `conditions` | array |
| `interventions` | array |
| `currentOverallStatus` | string |
| `currentLastUpdatePosted` | string |
| `historyVersionCount` | integer |
| `officialStudyUrl` | string |
| `officialHistoryUrl` | string |
| `scrapedAt` | string |

### 🔌 API & integrations

Run this Actor from the Apify Console, API, CLI, MCP, Make, Zapier or n8n. Replace the Actor identifier and token in this template:

```bash
curl -X POST "https://api.apify.com/v2/acts/clinicaltrials-status-history-intelligence/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
```

Results are stored in the run's default dataset and can be forwarded with Apify webhooks or scheduled Tasks.

### 🔎 Search keywords

ClinicalTrials Status History & Termination Intelligence, clinicaltrials, status, history, termination, intelligence, Apify Actor, scraper API, structured data, scheduled monitor, automation.

# Actor input Schema

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

Trial IDs to audit, such as NCT04368728. Up to 200 per run.

## `changedSince` (type: `string`):

Optional ISO date YYYY-MM-DD. Leave empty for complete status history.

## `includeAllVersions` (type: `boolean`):

Also emit revisions where the status stayed the same, with the changed module labels.

## `riskTransitionsOnly` (type: `boolean`):

Keep transitions into Suspended, Terminated, Withdrawn or Unknown status.

## `maxEventsPerTrial` (type: `integer`):

Newest matching history events retained for each NCT ID.

## Actor input object example

```json
{
  "nctIds": [
    "NCT04368728"
  ],
  "includeAllVersions": false,
  "riskTransitionsOnly": false,
  "maxEventsPerTrial": 50
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("snuggly_beanie_970/clinicaltrials-status-history-intelligence").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("snuggly_beanie_970/clinicaltrials-status-history-intelligence").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 '{}' |
apify call snuggly_beanie_970/clinicaltrials-status-history-intelligence --silent --output-dataset

```

## MCP server setup

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

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/GMl6CJm25bFMuikdN/builds/fknl34fq45foQxP0a/openapi.json
