# ClinicalTrials.gov Protocol & Completion Date Diff Monitor (`ademcakal_00/clinicaltrials-protocol-diff-monitor`) Actor

Track ClinicalTrials.gov API v2 updates, primary completion date delays, status terminations, enrollment shifts, endpoint edits, and sponsor/collaborator changes with zero API keys.

- **URL**: https://apify.com/ademcakal_00/clinicaltrials-protocol-diff-monitor.md
- **Developed by:** [Adem Cakal](https://apify.com/ademcakal_00) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.10 / 1,000 normalized clinical trial records

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/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 Protocol & Completion Date Diff Monitor

Deterministic, zero-LLM **ClinicalTrials.gov API v2** monitor and structured 6-field protocol diff engine built for biotech equity analysts, pharma competitive intelligence, clinical operations, and autonomous AI agents (MCP / x402 compatible).

### Why Use This Actor?

The official ClinicalTrials.gov API v2 only serves the **latest state** of a study — it does not expose structured field-level change diffs. This Actor queries the official v2 JSON API with slim field projections (no headless browser, no proxies, zero API keys required) and computes **structured catalyst diffs** whenever you pass previous snapshots from an earlier run.

#### 6 High-Signal Protocol Diffs Detected

1. **Primary Completion Date Shifts (`trial_completion_delayed` / `trial_completion_pulled_forward`):** Calculates exact `delayDays` and `ESTIMATED` vs `ACTUAL` transitions.
2. **Overall Status & Stop Reasons (`trial_status_changed`):** Flags `TERMINATED`, `SUSPENDED`, and `WITHDRAWN` trials as `critical` along with `whyStopped`.
3. **Enrollment Shifts (`trial_enrollment_changed`):** Computes absolute `delta` and `deltaPct` (catches recruitment cuts or adaptive sample-size hikes).
4. **Primary Outcome Measures (`trial_primary_outcome_changed`):** Detects endpoint or timeframe modifications.
5. **Eligibility Criteria (`trial_eligibility_changed`):** Deterministic SHA-256 content hash & length delta.
6. **Sponsor & Collaborators (`trial_sponsor_changed`):** Detects `addedCollaborators` and `removedCollaborators` (licensing, co-development, or silent exits).

### Modes

- **`recent_updates` (Default):** Fetches trials whose `LastUpdatePostDate` falls inside your `lookbackDays` (or custom `dateFrom`/`dateTo`), with optional filters for `sponsor`, `condition`, `phases`, `statuses`, and `industryOnly`.
- **`nct_lookup`:** Fetches exact `nctIds` (e.g. `["NCT04470427", "NCT04368728"]`).

### Verification & Data Infrastructure Suite (On Apify)

- [AI Crawler Access, Server-HTML Visibility & Bot IP Verifier](https://apify.com/ademcakal_00/ai-crawler-bot-ip-verifier) — Verify AI crawler rules, server-rendered HTML visibility, and official OpenAI/Anthropic/Perplexity/Google CIDR bot IPs.

# Actor input Schema

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

Choose 'recent_updates' to scan trials updated in the last N days (with optional filters & diffing), or 'nct_lookup' to inspect specific NCT IDs.

## `lookbackDays` (type: `integer`):

Number of days back from today (UTC) to query LastUpdatePostDate on ClinicalTrials.gov API v2.

## `dateFrom` (type: `string`):

Optional exact start date for LastUpdatePostDate range (overrides lookbackDays).

## `dateTo` (type: `string`):

Optional exact end date for LastUpdatePostDate range (defaults to today UTC).

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

Optional lead sponsor or collaborator search term (e.g. 'Pfizer', 'Moderna', 'Eli Lilly').

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

Optional condition filter (e.g. 'Oncology', 'Alzheimer', 'Obesity').

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

Optional phase filter (EARLY_PHASE1, PHASE1, PHASE2, PHASE3, PHASE4, NA). Leave empty for all phases.

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

Optional overallStatus filter (RECRUITING, ACTIVE_NOT_RECRUITING, COMPLETED, SUSPENDED, TERMINATED, WITHDRAWN).

## `industryOnly` (type: `boolean`):

If true, keep only trials where leadSponsor.class === 'INDUSTRY' (biotech/pharma focus).

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

List of exact NCT IDs to inspect (e.g. \['NCT04470427', 'NCT04368728']).

## `previousSnapshots` (type: `array`):

Optional array of prior study snapshots (from a previous run of this Actor) to compute structured 6-field protocol diffs.

## `maxStudies` (type: `integer`):

Hard cap on studies fetched and returned in this run (1 to 2000).

## Actor input object example

```json
{
  "mode": "recent_updates",
  "lookbackDays": 7,
  "phases": [
    "PHASE2",
    "PHASE3"
  ],
  "statuses": [],
  "industryOnly": false,
  "nctIds": [],
  "previousSnapshots": [],
  "maxStudies": 25
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "mode": "recent_updates",
    "lookbackDays": 7,
    "phases": [
        "PHASE2",
        "PHASE3"
    ],
    "industryOnly": false,
    "maxStudies": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("ademcakal_00/clinicaltrials-protocol-diff-monitor").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 = {
    "mode": "recent_updates",
    "lookbackDays": 7,
    "phases": [
        "PHASE2",
        "PHASE3",
    ],
    "industryOnly": False,
    "maxStudies": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("ademcakal_00/clinicaltrials-protocol-diff-monitor").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 '{
  "mode": "recent_updates",
  "lookbackDays": 7,
  "phases": [
    "PHASE2",
    "PHASE3"
  ],
  "industryOnly": false,
  "maxStudies": 25
}' |
apify call ademcakal_00/clinicaltrials-protocol-diff-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ademcakal_00/clinicaltrials-protocol-diff-monitor"
        }
    }
}
```

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/gmUSfBB2SJbDVjeeB/builds/elibT524uSU0r9dLm/openapi.json
