# Clinical Trial Site Opportunity Monitor (`frankycheese/clinical-trial-site-openings`) Actor

Find newly recruiting ClinicalTrials.gov studies that match your site's therapeutic areas and geography. Get sponsor, eligibility, contact, location, and exact study evidence with replay-safe bounded charges.

- **URL**: https://apify.com/frankycheese/clinical-trial-site-openings.md
- **Developed by:** [franklin mccheese](https://apify.com/frankycheese) (community)
- **Categories:** Automation, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $180.00 / 1,000 recent recruiting trial matches

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

## Clinical Trial Site Opportunity Monitor

- **buyer:** clinical research site business-development and feasibility teams
- **result:** one source-linked recent recruiting trial fit or material correction per paid event
- **official source:** ClinicalTrials.gov API v2 (no key required)
- **first useful run:** the bounded melanoma/FL preview below with `baselineMode=emit_matches`
- **maximum charge:** `$0.18` with `maxEvents=1`
- **unchanged replay:** `$0.00`; an identical rerun emits no dataset row

### bounded preview (buyer-visible)

Copy this input exactly. It is the storefront's bounded preview: one melanoma watchlist, Florida sites, a 30-day first-post window, at most one paid event, and a hard `$0.18` ceiling. `qualityTestMode=false` means this is a real buyer run — it queries ClinicalTrials.gov, advances state, and charges only for emitted events. (The Apify Store smoke test uses the same input with `qualityTestMode=true`, which emits one unbilled summary and touches no source or state.)

```json
{
  "watchlistId": "melanoma-fl-site-preview",
  "therapeuticAreas": ["melanoma"],
  "states": ["FL"],
  "countries": ["United States"],
  "lookbackDays": 30,
  "baselineMode": "emit_matches",
  "maxEvents": 1,
  "maxTotalChargeUsd": 0.18,
  "maxSourceRecords": 100,
  "stateStoreName": "melanoma-fl-site-preview",
  "resetState": false,
  "qualityTestMode": false
}
```

### source-backed example

Fetched from the live ClinicalTrials.gov API v2 on 2026-11-03: [NCT07621614](https://clinicaltrials.gov/study/NCT07621614), "A Multi-Institutional Central Pathology and Molecular Risk-Based Stratification Study of Surgical Management for Melanoma, Atypical Spitz/Spitzoid Tumors, and Other Atypical Melanocytic Neoplasms in Pediatric Patients." Recruiting, with Florida sites at Nemours Children's Clinic-Jacksonville (Jacksonville) and Nemours Children's Hospital (Orlando). Against the preview input it matches on `therapeutic_area` (melanoma), `state` (FL), and `country` (United States). Its first post date is 2026-06-02, outside a 30-day lookback from today, so a fresh preview run records it as baseline state at `$0.00` instead of charging — the example proves matching against a real record; whether a given record charges depends on its first-post recency.

### workflow

1. **Preview:** run the bounded input above once. You pay at most `$0.18` and see exactly what a paid row looks like, including matched evidence and the official study link.
2. **Baseline:** rerun with `baselineMode=silent` (same `watchlistId`, settings, and `stateStoreName`) so historical recruiting trials establish state without paid events.
3. **Schedule:** keep the identical input on a daily or weekly schedule. Only new recent matches (`NEW_MATCH`, `$0.18`) and material changes to already-seen trials (`SOURCE_CORRECTION`, `$0.05`) are charged; unchanged replays are free.
4. **Route:** point dataset-item webhooks at the site's feasibility or outreach queue.

### matching

At least one therapeutic area is required to bound the source query:

- `therapeuticAreas`: literal phrase match against trial conditions and keywords
- `states`: two-letter US abbreviations, matched after token normalization (lowercase, non-alphanumerics stripped) against trial location states — the API emits full names ("Florida") or abbreviations ("FL"), and both sides are normalized identically before exact comparison, so valid sites are not discarded by formatting differences
- `countries`: country names, matched with the same normalization against trial location countries

When therapeutic areas and geography are both supplied, a trial must satisfy both. `lookbackDays` gates only recent matches: a recruiting trial first posted outside the window is not paid as a recent match, but a material change to an already-seen trial still emits `SOURCE_CORRECTION`. Reuse the same `watchlistId`, settings, and `stateStoreName` for scheduled monitoring.

### output

Paid dataset rows are either:

- `NEW_MATCH` — `$0.18` for a recruiting trial first posted within the configured lookback
- `SOURCE_CORRECTION` — `$0.05`

Unmatched records, unchanged replays, silent baselines, malformed input, and failed source fetches are not paid events. Every row carries the official study page link (`https://clinicaltrials.gov/study/<NCT>`), matched evidence, source fingerprint, dates, and disclaimer. A deterministic run report is stored as `REPORT` with source queries, counts, receipts, state size, and claim scope.

### limitations

- This is an **internal site-development screening aid**: it does not guarantee enrollment, issue recruitment advice, or imply sponsor endorsement. Verify against ClinicalTrials.gov before outreach.
- It does not detect a status transition or the opening of a new physical site; `SOURCE_CORRECTION` means the source record materially changed since you last saw it.
- Geography matching covers US states and country names only; territories and non-US administrative regions are not matched.
- The source query is bounded to `RECRUITING` trials per therapeutic area, sorted by first-post date descending; a trial that later changes status is only re-evaluated while it remains recruiting in the fetch window.

### 60-second quick start

Start with the bounded preview above to see one paid row, then switch to a silent baseline so historical recruiting trials do not create paid events, and schedule the identical input daily or weekly.

```json
{
  "watchlistId": "melanoma-fl-site-preview",
  "therapeuticAreas": ["melanoma"],
  "states": ["FL"],
  "countries": ["United States"],
  "lookbackDays": 30,
  "baselineMode": "silent"
}
```

### Illustrative output shape

*Illustrative — not a run receipt.* A delivered row contains `eventType`, NCT identifier, official study link, sponsor, matched therapeutic/geography evidence, `sourceRecordUrl`, fingerprint, and disclaimer.

### Pricing

The bounded preview permits at most one `$0.18` recent-fit event. Corrections cost `$0.05`; unmatched, silent-baseline, and unchanged records create no paid event.

### Schedule, webhook, and API recipe

After previewing, keep the watchlist and state store stable, select `silent` for a clean recurring baseline, schedule daily or weekly, and route dataset-item webhooks to the site's feasibility or outreach queue.

### Empty-run troubleshooting

Confirm that the therapeutic phrase exists in current recruiting records, remove geography temporarily to diagnose over-filtering, inspect `REPORT`, and widen `lookbackDays` within the schema limit. Do not reset state just to force a paid row.

### Buyer bundle

Pair with ClinicalTrials.gov Material Change Monitor: this Actor finds recent recruiting fit; the change monitor follows enrolled records for subsequent material updates.

# Actor input Schema

## `watchlistId` (type: `string`):

Stable 3-64 character ID for this site watchlist.

## `therapeuticAreas` (type: `array`):

Literal phrases matched against trial conditions and keywords. At least one is required to bound the source query.

## `states` (type: `array`):

Two-letter US abbreviations matched against trial location states after token normalization (the API emits full names or abbreviations; both sides are normalized identically before exact comparison).

## `countries` (type: `array`):

Country names matched against trial location countries after the same token normalization as states.

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

Only recruiting trials first posted within this window are paid as recent matches. Corrections to already-seen trials are not gated by the window.

## `baselineMode` (type: `string`):

Silently establish a replay-safe recurring baseline by default; choose emit current matches for the bounded preview example.

## `maxEvents` (type: `integer`):

Hard cap on paid signals delivered in one run.

## `maxTotalChargeUsd` (type: `number`):

Hard ceiling derived before any charge. Recent recruiting match $0.18; source correction $0.05.

## `maxSourceRecords` (type: `integer`):

Bound the official API response to at most 2,000 recruiting trials per therapeutic area.

## `stateStoreName` (type: `string`):

Reuse this name on scheduled runs for replay suppression.

## `resetState` (type: `boolean`):

Deliberately discard this watchlist configuration's baseline.

## `qualityTestMode` (type: `boolean`):

Apify Store automated smoke-test mode. It validates runtime and input startup, emits one unbilled summary, and does not query sources, mutate state, deliver business events, or charge.

## Actor input object example

```json
{
  "watchlistId": "melanoma-fl-site-preview",
  "therapeuticAreas": [
    "melanoma"
  ],
  "states": [
    "FL"
  ],
  "countries": [
    "United States"
  ],
  "lookbackDays": 30,
  "baselineMode": "emit_matches",
  "maxEvents": 1,
  "maxTotalChargeUsd": 0.18,
  "maxSourceRecords": 100,
  "stateStoreName": "melanoma-fl-site-preview",
  "resetState": false,
  "qualityTestMode": false
}
```

# Actor output Schema

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

No description

## `report` (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 = {
    "watchlistId": "melanoma-fl-site-preview",
    "therapeuticAreas": [
        "melanoma"
    ],
    "states": [
        "FL"
    ],
    "countries": [
        "United States"
    ],
    "lookbackDays": 30,
    "baselineMode": "emit_matches",
    "maxEvents": 1,
    "maxTotalChargeUsd": 0.18,
    "maxSourceRecords": 100,
    "stateStoreName": "melanoma-fl-site-preview",
    "resetState": false,
    "qualityTestMode": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("frankycheese/clinical-trial-site-openings").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 = {
    "watchlistId": "melanoma-fl-site-preview",
    "therapeuticAreas": ["melanoma"],
    "states": ["FL"],
    "countries": ["United States"],
    "lookbackDays": 30,
    "baselineMode": "emit_matches",
    "maxEvents": 1,
    "maxTotalChargeUsd": 0.18,
    "maxSourceRecords": 100,
    "stateStoreName": "melanoma-fl-site-preview",
    "resetState": False,
    "qualityTestMode": False,
}

# Run the Actor and wait for it to finish
run = client.actor("frankycheese/clinical-trial-site-openings").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 '{
  "watchlistId": "melanoma-fl-site-preview",
  "therapeuticAreas": [
    "melanoma"
  ],
  "states": [
    "FL"
  ],
  "countries": [
    "United States"
  ],
  "lookbackDays": 30,
  "baselineMode": "emit_matches",
  "maxEvents": 1,
  "maxTotalChargeUsd": 0.18,
  "maxSourceRecords": 100,
  "stateStoreName": "melanoma-fl-site-preview",
  "resetState": false,
  "qualityTestMode": false
}' |
apify call frankycheese/clinical-trial-site-openings --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,frankycheese/clinical-trial-site-openings"
        }
    }
}
```

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/fcjnreHivRwcM6wln/builds/Pgzbf2Cd6p7vVfYNk/openapi.json
