# ClinicalTrials.gov Recruiting Trials & Study Contacts (`afkdigital/newapi41-clinicaltrials-recruiting-study-contacts`) Actor

Extract recruiting industry-sponsored ClinicalTrials.gov studies, sponsors and study contacts. Filter condition, phase and country; export JSON/CSV. Research use; no email marketing.

- **URL**: https://apify.com/afkdigital/newapi41-clinicaltrials-recruiting-study-contacts.md
- **Developed by:** [AFK Digital](https://apify.com/afkdigital) (community)
- **Categories:** Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$8.00 / 1,000 successful unique studies

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 Recruiting Trials & Study Contacts

Turn public ClinicalTrials.gov study records into structured research data for Clay, n8n, spreadsheets and internal analysis. The default search returns **RECRUITING studies with an INDUSTRY lead sponsor**, across all conditions, phases and countries.

**Important use restriction:** ClinicalTrials.gov prohibits using email addresses extracted from its database for marketing or other promotional purposes. This Actor is for research and study coordination workflows. Its contacts are study coordination contacts, not verified sponsor-company sales, purchasing or procurement decision makers.

### What you receive

One Dataset row per unique NCT ID, with the study title, lead sponsor, phase, recruitment status, study contacts, location count and source dates. JSON preserves every central contact, including any source-provided role, phone extension or additional property. CSV includes `central_contacts_json` so multiple contacts survive a flat-file export.

This Actor does not promise that every trial has a central email or phone. Missing scalar values are `null`; no contacts are represented by an empty array. No addresses are guessed or enriched. A missing locations list produces a null count; a present empty list produces zero.

### Input example

```json
{
  "condition": "lung cancer",
  "phase": "PHASE2",
  "overall_status": "RECRUITING",
  "sponsor_class": "INDUSTRY",
  "country": "United States",
  "maxResults": 25,
  "maxCostUsd": 0.20
}
```

| Input | Default | Meaning |
| --- | --- | --- |
| condition | empty | ClinicalTrials.gov condition search expression; empty includes all conditions |
| phase | ALL | ALL, NA, EARLY_PHASE1, PHASE1, PHASE2, PHASE3, PHASE4 |
| overall_status | RECRUITING | Exact API overall status from the input selector |
| sponsor_class | INDUSTRY | Lead sponsor class; ALL removes this filter |
| country | empty | Exact source country name, e.g. United States; at least one listed study location must match |
| maxResults | 100 | Maximum unique studies, 1–10,000 |
| maxCostUsd | 1 | Run event spending cap in USD, 0–80 |
| pageSize | 100 | Advanced: source page size, 1–100 |
| runTimeoutSeconds | 240 | Advanced: collection deadline, 30–3,600 seconds |

A country match does not mean that a particular site is currently recruiting. Overall recruitment status describes the study. Phase is often absent for observational studies or not applicable; ALL retains those studies. Condition uses the source search semantics, not a local keyword match. NCT-ID shortcuts are rejected because the source can ignore other filters for those queries.

### Output fields

| Field | Description |
| --- | --- |
| nct_id | Unique ClinicalTrials.gov study identifier |
| brief_title | Public brief study title |
| lead_sponsor_name | Registered lead sponsor name |
| lead_sponsor_class | Registered lead sponsor class |
| phase | All source phases joined with a pipe, or null |
| phases | Lossless source phase array |
| overall_status | Source overall study status |
| central_contact_name / phone / email | Values from the first central contact; null if absent |
| central_contacts | Complete source central-contact array |
| central_contacts_json | Same contacts serialized as JSON text for CSV import |
| locations_count | Number of all listed locations, not just locations in the selected country |
| location_countries | Distinct countries from listed study locations |
| study_url | Direct ClinicalTrials.gov source link |
| source_updated_at | Study's last posted update date, as supplied by the source |
| source_processed_at | API-wide dataTimestamp from /api/v2/version, preserved without inventing a timezone |
| fetched_at | UTC timestamp when this row was processed |
| source | ClinicalTrials.gov attribution |
| contact_type | study coordination contact |

### Pricing and limits

**USD 0.008 per successful unique study saved to the run Dataset — USD 8 per 1,000 studies.** Runtime platform usage is included. There is no start fee, request fee, retry fee, error fee or duplicate fee. Studies without contact details still count as successful study records and are charged at the same price. Empty results produce no study events.

The smaller of `maxCostUsd` and Apify's run maximum charge applies, rounded down to complete studies. For example, USD 0.02 permits two studies (USD 0.016). Below USD 0.008, no study is fetched. `maxResults` also applies. Post-run storage, retention and export interactions follow Apify's standard platform rules.

Deduplication is by NCT ID within a run, including restoration from its Dataset after restart. Running the Actor again is a separate extraction and can return the same studies with current source information. SDK storage and event charging are used together; data is saved before a result event is billed.

### Reliability

The Actor uses HTTP/JSON only, without browsers or proxy bypass. Requests are sequential and at least 1.5 seconds apart. Requests time out after 20 seconds and retry transient failures up to four times with exponential backoff, jitter and Retry-After handling. Permanent client errors fail without retry. Empty pages with continuation tokens are followed. Repeated tokens fail rather than looping.

If the collection deadline is reached between records, accessible partial output remains with a SUMMARY stop reason. Exhausted HTTP retries fail the run; earlier successful rows remain available and billed, while the failed request creates no error row or charge. Very large extractions may require increasing the collection deadline and Apify run timeout.

No input, contact values, authorization headers or secret credentials are printed to logs. The public API needs no source API key.

### Clay, n8n and API use

1. Start this Actor from Apify Console or an authorized Apify API request.
2. Wait for the run to finish and read its defaultDatasetId.
3. Fetch `https://api.apify.com/v2/datasets/DATASET_ID/items?format=json` for JSON, or change format to csv.
4. In n8n, use the Apify integration or HTTP Request node. In Clay, import CSV or use an authorized HTTP/API workflow.

Keep your Apify token in your integration's credential store, not shared URLs or spreadsheets. JSON is recommended when nested contacts matter. SUMMARY in the default Key-value store records page count, retries, stop reason and source data timestamp.

### Source, freshness and permitted use

Source: [ClinicalTrials.gov API v2](https://clinicaltrials.gov/data-api/api), published by the U.S. National Library of Medicine. [Terms and Conditions](https://clinicaltrials.gov/about-site/terms-conditions) apply to source data and downstream use.

The underlying public registry data is available free from ClinicalTrials.gov. The Actor fee covers extraction and structuring; AFK MESH claims no ownership of the source database and no government endorsement. This is an independent service.

We select and flatten study fields, derive location counts and country lists, expose the first contact in scalar columns, retain complete central contacts, and add provenance timestamps. We do not verify sponsor-submitted accuracy, interpret medical eligibility, or provide medical advice.

ClinicalTrials.gov changes over time. Re-run before relying on an export, retain the displayed dates and attribution, and review the source record for updates. Exported snapshots do not update themselves. Source terms also address warranties, international and third-party rights; users remain responsible for complying with applicable conditions. Extracted emails must not be used for marketing or promotion.

### Validation

Release QA covers real recruiting/industry defaults, combined condition/phase/country filters, pageToken continuation across three pages, absent contacts and zero matches. Automated tests additionally cover duplicate IDs, cost limits, empty continuation pages, repeated tokens, invalid inputs, HTTP 400, 429 Retry-After, non-JSON responses and request timeouts.

Developed and tested as NEWAPI41. Support: open an Apify Store issue with the run ID and filter settings; do not post personal contact data or credentials.

# Actor input Schema

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

Clinical condition or disease search using ClinicalTrials.gov query.cond. No NCT IDs; blank searches all conditions.

## `phase` (type: `string`):

Exact phase; ALL includes records without a phase.

## `overall_status` (type: `string`):

Study status filter. Default is RECRUITING.

## `sponsor_class` (type: `string`):

Uses lead sponsor class, not collaborator or generic funder text.

## `country` (type: `string`):

Exact country name as stored by ClinicalTrials.gov, e.g. United States. Includes a study if it has at least one location there, regardless of site recruitment status.

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

Run-wide maximum unique studies, including existing output on restart.

## `maxCostUsd` (type: `number`):

Additional run cost cap, combined with Apify's maximum charge. USD 0.008 per unique saved study. Below 0.008 returns no studies.

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

Advanced: 1–100. Smaller pages help test cursor pagination.

## `runTimeoutSeconds` (type: `integer`):

Advanced: returns partial successful output when collection deadline is reached; HTTP failures fail the run without error dataset items.

## Actor input object example

```json
{
  "condition": "",
  "phase": "ALL",
  "overall_status": "RECRUITING",
  "sponsor_class": "INDUSTRY",
  "country": "",
  "maxResults": 100,
  "maxCostUsd": 1,
  "pageSize": 100,
  "runTimeoutSeconds": 240
}
```

# Actor output Schema

## `studies` (type: `string`):

No description

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

// Run the Actor and wait for it to finish
const run = await client.actor("afkdigital/newapi41-clinicaltrials-recruiting-study-contacts").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("afkdigital/newapi41-clinicaltrials-recruiting-study-contacts").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 afkdigital/newapi41-clinicaltrials-recruiting-study-contacts --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,afkdigital/newapi41-clinicaltrials-recruiting-study-contacts"
        }
    }
}
```

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/CnQ4vxGPOYR66SFc3/builds/NmublPUga9XPIZZZM/openapi.json
