# ClinicalTrials.gov Search (Official API) (`leathered_luna/us-clinical-trials-gov`) Actor

Search registered clinical studies on the official ClinicalTrials.gov API by condition, intervention, sponsor or location. No API key. Investigator contact details are omitted.

- **URL**: https://apify.com/leathered_luna/us-clinical-trials-gov.md
- **Developed by:** [SiennaWorks](https://apify.com/leathered_luna) (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.50 / 1,000 study found

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/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 Search (Official API)

Search **registered clinical studies** worldwide on **ClinicalTrials.gov**, the official US National Library of Medicine registry, by condition, intervention, sponsor or location. No API key needed.

Built for research teams, biotech and pharma analysts, journalists and AI agents that need structured trial records rather than a scraped results page.

### How this is different

- **Straight from the official API.** It calls [ClinicalTrials.gov API v2](https://clinicaltrials.gov/data-api/api) — the same registry the public website uses. No HTML scraping and no key to request.
- **Contact details are omitted.** Investigator names, emails and phone numbers are dropped even if the API returns them. Locations keep only facility, city, state and country.
- **You only pay for studies returned.** An empty search is free (apart from the one-off Actor start event).
- **Works for any country.** The registry is US-hosted but covers studies worldwide. Filter with `location` (for example `Japan`, `Singapore`, `Germany`, `United States`).

### What you get

`nct_id`, `title`, `official_title`, `status`, `study_type`, `phases`, `conditions`, `interventions`, `lead_sponsor`, `collaborators`, `start_date`, `completion_date`, `last_update_posted`, `enrollment`, `has_results`, `countries`, `location_count`, up to 50 `locations`, a shortened `brief_summary`, `source_url` (the official study page), `retrieved_at`.

An example is in [`examples/example_output.json`](examples/example_output.json).

### Input

```json
{
    "condition": "melanoma",
    "statuses": ["RECRUITING"],
    "maxResults": 10
}
```

Provide at least one of `condition`, `intervention`, `sponsor`, `location` or `term`.

| Field | Meaning |
|---|---|
| `condition` | Disease or condition, e.g. `melanoma`. |
| `intervention` | Treatment, e.g. `pembrolizumab`. |
| `sponsor` | Lead sponsor or collaborator name. |
| `location` | Country, city or facility. |
| `term` | Extra keywords. |
| `statuses` | Optional, e.g. `RECRUITING`, `COMPLETED`. |
| `phases` | Optional, e.g. `PHASE2` or `Phase 2`. |
| `maxResults` | 1–5,000, default 100. |

### Pricing (pay-per-event)

**$0.0025 per study returned** ($2.50 per 1,000). Empty result sets and service outages are not charged. Platform usage is included. Set a **maximum cost per run** in Apify Console for a hard cap. The Actor stops cleanly when the limit is reached.

### Legal and notes

- Source: [ClinicalTrials.gov](https://clinicaltrials.gov/), a service of the US National Library of Medicine, National Institutes of Health. A result is what the registry currently publishes. It is **not medical advice** and is not a complete picture of every trial worldwide (some studies are only registered in other national registries).
- This Actor is not affiliated with or endorsed by the NIH, NLM or ClinicalTrials.gov.
- Do not use these records as a substitute for clinical or regulatory judgement.

### Local development

```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements-dev.txt
pytest -q
```

### Changelog

- **0.1** — First version: official API v2 search, contact details omitted, pay-per-event.

# Actor input Schema

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

e.g. melanoma, type 2 diabetes, breast cancer.

## `intervention` (type: `string`):

e.g. pembrolizumab, metformin.

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

Lead sponsor or collaborator name.

## `location` (type: `string`):

Country, city or facility, e.g. Japan, Singapore, London, Mayo Clinic.

## `term` (type: `string`):

Optional free-text term combined with the fields above.

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

Optional. One or more of: RECRUITING, NOT_YET_RECRUITING, ENROLLING_BY_INVITATION, ACTIVE_NOT_RECRUITING, COMPLETED, SUSPENDED, TERMINATED, WITHDRAWN, UNKNOWN.

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

Optional. One or more of: NA, EARLY_PHASE1, PHASE1, PHASE2, PHASE3, PHASE4. You can also type 'Phase 2'.

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

Hard cap (1–5,000, default 100).

## Actor input object example

```json
{
  "condition": "melanoma",
  "maxResults": 100
}
```

# 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 = {
    "condition": "melanoma"
};

// Run the Actor and wait for it to finish
const run = await client.actor("leathered_luna/us-clinical-trials-gov").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 = { "condition": "melanoma" }

# Run the Actor and wait for it to finish
run = client.actor("leathered_luna/us-clinical-trials-gov").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 '{
  "condition": "melanoma"
}' |
apify call leathered_luna/us-clinical-trials-gov --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,leathered_luna/us-clinical-trials-gov"
        }
    }
}
```

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/Bh0MWPbohukaDteBb/builds/cR0gw7WcguzkCea3n/openapi.json
