# TrialDelta – Clinical Trial Competitor Monitor (`herodcraperdz/trialdelta-clinical-trial-competitor-monitor`) Actor

Monitor competitor clinical trials with structured ClinicalTrials.gov data. TrialDelta detects new studies, meaningful field changes, and studies no longer matching your query, with persistent snapshots, safe timeouts, and JSON output for biotech, pharma, CRO, and clinical-development workflows.

- **URL**: https://apify.com/herodcraperdz/trialdelta-clinical-trial-competitor-monitor.md
- **Developed by:** [choayb ouaret](https://apify.com/herodcraperdz) (community)
- **Categories:** Automation, Developer tools
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.85 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## TrialDelta — Clinical Trial Competitor Monitor

Monitor competitor clinical trials with structured data from [ClinicalTrials.gov](https://clinicaltrials.gov/). TrialDelta turns a recurring registry query into a change-detection workflow for biotech, pharmaceutical, CRO, investor-relations, and clinical-development teams.

Instead of repeatedly reviewing the same search results, TrialDelta stores a compact baseline and reports what changed between runs. It identifies newly discovered studies, meaningful updates to previously observed studies, and studies that no longer match the monitored query.

> TrialDelta is a monitoring and research-support tool. It does not provide medical advice, regulatory advice, investment advice, or a substitute for professional due diligence.

### Why use TrialDelta?

Clinical-trial intelligence is most useful when it is timely, structured, and comparable over time. TrialDelta is designed for teams that need a lightweight way to monitor an indication, mechanism, intervention, sponsor, or competitor program without building a registry-integration service from scratch.

The Actor is suitable for recurring scheduled runs, API-triggered workflows, downstream data pipelines, and alerting systems. Its JSON output can be stored in a Dataset, forwarded through a webhook, or consumed by another automation step.

### Key capabilities

| Capability | What TrialDelta does |
| --- | --- |
| Query monitoring | Searches ClinicalTrials.gov using one or more watch terms. |
| Baseline snapshots | Stores the latest observed result set for comparison in later runs. |
| New-study detection | Emits `NEW` events when a study appears for the first time. |
| Study-change detection | Emits `UPDATED` events when monitored study fields change. |
| Disappearance detection | Emits `NO_LONGER_MATCHES_QUERY` when a previous study is no longer returned by the query. |
| Run accounting | Emits a `RUN_SUMMARY` record with fetch, baseline, and delta counts. |
| Safe execution | Uses bounded request behavior and a configurable Actor timeout. |
| Structured output | Produces consistent JSON records for datasets, APIs, webhooks, and downstream analysis. |

### Input

TrialDelta accepts a JSON object with the following fields:

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `watchTerms` | Array of strings | Yes | `[`"`melanoma`"`]` | Terms to monitor. These may be conditions, mechanisms, products, sponsors, intervention names, or other ClinicalTrials.gov search terms. |
| `pageSize` | Integer | No | `25` | Maximum number of studies to retrieve in a run. Valid range: `1`–`100`. |
| `resetBaseline` | Boolean | No | `false` | When enabled, treats the current results as a new baseline instead of reporting them as changes. Use this when starting a new monitoring program or changing the query substantially. |

#### Example input

```json
{
  "watchTerms": ["melanoma", "nivolumab"],
  "pageSize": 25,
  "resetBaseline": false
}
```

#### Input guidance

Use specific and stable watch terms where possible. A condition such as `melanoma` is useful for indication-level monitoring, while a sponsor, drug, mechanism, or product name is better for competitor-program monitoring. Multiple terms may be supplied when a single run should cover a small monitoring set.

When changing from one monitoring program to another, set `resetBaseline` to `true` for the first run of the new query. Otherwise, the Actor may correctly interpret the new result set as a large group of changes relative to the previous query.

### Output

Each Dataset item represents either a study-level delta event or a run-level summary.

| Field | Type | Meaning |
| --- | --- | --- |
| `eventType` | String | One of `NEW`, `UPDATED`, `NO_LONGER_MATCHES_QUERY`, or `RUN_SUMMARY`. |
| `runId` | String | Apify run identifier associated with the event. |
| `watchTerms` | Array of strings | Terms used for the run, when available. |
| `nctId` | String or null | ClinicalTrials.gov NCT identifier for a study-level event. |
| `title` | String or null | Study title. |
| `status` | String or null | Current recruitment or study status returned by the registry. |
| `phase` | String or null | Study phase, when available. |
| `sponsor` | String or null | Lead sponsor or responsible organization, when available. |
| `conditions` | Array of strings | Conditions associated with the study. |
| `interventions` | Array of strings | Interventions reported for the study. |
| `enrollment` | Integer or null | Reported enrollment count, when available. |
| `lastUpdatePostDate` | String or null | Registry update-posting date, when available. |
| `studyUrl` | String or null | Direct ClinicalTrials.gov study URL. |
| `changes` | Array of strings | Fields identified as changed for an `UPDATED` event. |
| `fetched` | Integer or null | Number of studies fetched in the run summary. |
| `previous` | Integer or null | Number of studies in the previous baseline. |
| `deltas` | Integer or null | Number of delta events generated for the run. |
| `timestamp` | String | ISO 8601 event timestamp. |

#### Example `NEW` event

```json
{
  "eventType": "NEW",
  "runId": "example-run-id",
  "watchTerms": ["melanoma"],
  "nctId": "NCT01234567",
  "title": "Example melanoma clinical study",
  "status": "RECRUITING",
  "phase": "PHASE2",
  "sponsor": "Example Biopharma",
  "conditions": ["Melanoma"],
  "interventions": ["Example intervention"],
  "enrollment": 120,
  "lastUpdatePostDate": "2026-01-15",
  "studyUrl": "https://clinicaltrials.gov/study/NCT01234567",
  "changes": [],
  "timestamp": "2026-08-25T00:00:00.000Z"
}
```

#### Example `RUN_SUMMARY` event

```json
{
  "eventType": "RUN_SUMMARY",
  "runId": "example-run-id",
  "watchTerms": ["melanoma"],
  "fetched": 25,
  "previous": 25,
  "deltas": 2,
  "timestamp": "2026-08-25T00:00:00.000Z"
}
```

### How change detection works

On the first successful run, TrialDelta retrieves the matching studies and stores them as the baseline. The study records discovered on that first run are emitted as `NEW` events so that the initial state is visible in the Dataset.

On subsequent runs, the current result set is compared with the stored baseline. A study that was not present in the baseline is emitted as `NEW`. A study that remains in the result set but has changed monitored fields is emitted as `UPDATED`, together with the names of the changed fields. A study that was present previously but is not returned by the current query is emitted as `NO_LONGER_MATCHES_QUERY`.

A missing study does not necessarily mean that the study was deleted from the registry. It may have been affected by query ranking, pagination, registry changes, or a change in the search terms. Treat disappearance events as review signals rather than definitive evidence of study termination.

### Recommended operating model

For continuous monitoring, create a recurring Apify schedule using the same input and allow the baseline to persist between runs. A daily schedule is appropriate for most competitive-intelligence use cases; higher-frequency monitoring should be reserved for high-priority programs and tested against the registry’s operational behavior.

For a new query, run once with `resetBaseline: true`, review the initial result set, and then return the flag to `false`. Connect the Dataset or run events to a webhook or downstream workflow if your team needs email, Slack, CRM, or internal-dashboard notifications.

### API example

The following example starts the Actor through the Apify API. Replace `YOUR_APIFY_TOKEN` and `YOUR_ACTOR_ID` with your credentials and Actor identifier.

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/YOUR_ACTOR_ID/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "watchTerms": ["melanoma", "nivolumab"],
    "pageSize": 25,
    "resetBaseline": false
  }'
```

Do not hard-code an Apify token in a public repository, client-side application, or shared document. Store credentials in a secure secret manager or the relevant Apify integration configuration.

### Data source and attribution

TrialDelta uses the public ClinicalTrials.gov API and presents registry-derived information for research and monitoring purposes. ClinicalTrials.gov records can change, may contain incomplete information, and should be checked directly before making operational decisions. Visit the source record through the `studyUrl` field for the authoritative current registry view.

### Limitations

TrialDelta is intentionally an MVP monitoring layer rather than a complete clinical-intelligence platform. It does not guarantee that every relevant study is returned, does not replace manual review, and does not infer causality or business significance from a registry change. Pagination, search semantics, study updates, and registry availability can affect results.

The Actor compares the fields available in its stored records. A change is technically detectable only when it is represented in the returned registry data and included in the Actor’s comparison record. The `UPDATED` event is therefore a change signal, not a medical, regulatory, legal, or investment conclusion.

### Privacy and security

The Actor is designed to query public registry data and does not require personal health information. Do not place confidential company information, patient information, credentials, or regulated data in `watchTerms` or other run inputs.

### Troubleshooting

If a run times out, reduce `pageSize`, use a narrower `watchTerms` query, and retry. If a run produces many `NEW` events unexpectedly, confirm that the query has not changed and that the baseline was not reset. If the input form displays generic fields such as `helloWorld`, rebuild the Actor after confirming that the formal schema is saved and linked in `actor.json`.

If a study appears to have disappeared, open the ClinicalTrials.gov search directly and verify whether the record remains available, whether its data changed, or whether the query and pagination have altered the returned set.

### Version and support

TrialDelta is maintained as a focused clinical-trial change-monitoring Actor. Improvements may add additional registry fields, richer comparison rules, notification integrations, and broader source coverage. Users should pin a tested build in production workflows and review changes before switching to a new build.

### References

1. [ClinicalTrials.gov](https://clinicaltrials.gov/) — public clinical-study registry.

2. \[ClinicalTrials.gov API documentation]\(<https://clinicaltrials.gov/data-api/api> end points ) — API access and endpoint guidance.

3. [Apify Actor input schema documentation](https://docs.apify.com/platform/actors/development/actor-definition/input-schema) — configuring user-facing Actor inputs.

4. [Apify Actor publishing documentation](https://docs.apify.com/actors/publishing/publish) — marketplace publication guidance.

***

**TrialDelta** helps teams move from periodic manual searches to repeatable, structured clinical-trial monitoring.

# Actor input Schema

## `watchTerms` (type: `array`):

Disease names, mechanisms, products, sponsors, or indications to monitor on ClinicalTrials.gov.

## `pageSize` (type: `integer`):

Maximum number of studies to retrieve for this run.

## `resetBaseline` (type: `boolean`):

Treat current results as a fresh baseline. Enable only when starting a new query.

## Actor input object example

```json
{
  "watchTerms": [
    "melanoma"
  ],
  "pageSize": 25,
  "resetBaseline": false
}
```

# Actor output Schema

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

NEW, UPDATED, NO\_LONGER\_MATCHES\_QUERY, and RUN\_SUMMARY records emitted by TrialDelta.

## `latestBaseline` (type: `string`):

The latest persisted normalized ClinicalTrials.gov snapshot used for subsequent comparisons.

# 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("herodcraperdz/trialdelta-clinical-trial-competitor-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("herodcraperdz/trialdelta-clinical-trial-competitor-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 '{}' |
apify call herodcraperdz/trialdelta-clinical-trial-competitor-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,herodcraperdz/trialdelta-clinical-trial-competitor-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/cnYH5ukFpW5nU99xM/builds/qXJkfifk6OtMqa1fX/openapi.json
