# ClinicalTrials.gov Search Scraper (`brightpath-data/clinicaltrials-gov-search`) Actor

Search ClinicalTrials.gov by condition, drug, sponsor, location, status or phase and export clean, flat trial records as JSON or CSV. Official API, pay per result, MCP ready.

- **URL**: https://apify.com/brightpath-data/clinicaltrials-gov-search.md
- **Developed by:** [Nick Randall](https://apify.com/brightpath-data) (community)
- **Categories:** AI, Business, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 study records

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 Search Scraper

Search clinical trials by condition, drug, sponsor, location, status or phase and export clean, flat study records.

Get structured clinical trial data from ClinicalTrials.gov as JSON, CSV or Excel, or call it as a tool from Claude, Cursor, ChatGPT or any MCP client. Built on the official ClinicalTrials.gov API v2, so it does not break when the website changes. Pay only for the studies you receive.

### What you get

One record per study with the fields people actually filter on: NCT ID and link, titles, status and why stopped, study type, phases, conditions and keywords, interventions with type, lead sponsor and class, collaborators, enrollment count and type, design (allocation, model, purpose, masking), eligibility (sex, age range, healthy volunteers), primary outcomes, all key dates (start, primary completion, completion, first posted, last updated), whether results are posted, countries, site count and up to 50 site locations, plus the brief summary and eligibility criteria text.

Every result is a flat record with stable field names, so it drops straight into a spreadsheet, a database or an AI agent's context.

### Why use this instead of the website

- Combine condition, intervention, sponsor, location, status, phase, study type and date filters in one call
- Pagination handled for you, with automatic retries and polite rate limiting
- Results in JSON, CSV, Excel or via API, or piped into Zapier, Make, n8n and Google Sheets
- Works as an MCP tool, so AI agents can look up trials on demand
- No browser, no proxies, no personal data: fast runs and a tiny cost per result
- Monitoring made easy: set "Updated after" to yesterday and schedule the Actor daily to catch new and changed trials

### Input

| Field | Type | Default | Meaning |
|-------|------|---------|---------|
| `condition` | string | | Condition or disease, e.g. "type 2 diabetes" |
| `query` | string | | Free-text terms searched across the whole record |
| `intervention` | string | | Drug, device or procedure name |
| `sponsor` | string | | Sponsor or collaborator organization |
| `location` | string | | City, state, country or facility |
| `status` | array | all | Any of RECRUITING, NOT\_YET\_RECRUITING, ENROLLING\_BY\_INVITATION, ACTIVE\_NOT\_RECRUITING, COMPLETED, SUSPENDED, TERMINATED, WITHDRAWN, UNKNOWN |
| `phase` | array | all | Any of EARLY\_PHASE1, PHASE1, PHASE2, PHASE3, PHASE4, NA |
| `studyType` | string | any | INTERVENTIONAL, OBSERVATIONAL or EXPANDED\_ACCESS |
| `updatedAfter` | date | | Only records updated on or after YYYY-MM-DD |
| `startedAfter` | date | | Only studies starting on or after YYYY-MM-DD |
| `nctIds` | array | | Specific NCT numbers to fetch |
| `sort` | string | last updated | Last updated, first posted, start date, enrollment or relevance |
| `includeLocations` | boolean | true | Include up to 50 site locations per study |
| `includeSummary` | boolean | true | Include brief summary and eligibility criteria text |
| `maxResults` | integer | 100 | Cap on studies saved. You are charged per study, so this caps your cost. |

Example input:

```json
{
  "condition": "type 2 diabetes",
  "intervention": "semaglutide",
  "status": ["RECRUITING", "NOT_YET_RECRUITING"],
  "phase": ["PHASE3"],
  "location": "United States",
  "maxResults": 200
}
```

### Output

Example result (shortened):

```json
{
  "nctId": "NCT05000000",
  "url": "https://clinicaltrials.gov/study/NCT05000000",
  "briefTitle": "Semaglutide in Adults With Type 2 Diabetes and Obesity",
  "overallStatus": "RECRUITING",
  "studyType": "INTERVENTIONAL",
  "phases": ["PHASE3"],
  "conditions": ["Type 2 Diabetes", "Obesity"],
  "interventions": [{ "type": "DRUG", "name": "Semaglutide" }, { "type": "DRUG", "name": "Placebo" }],
  "leadSponsor": "Example Pharma A/S",
  "leadSponsorClass": "INDUSTRY",
  "enrollmentCount": 1200,
  "enrollmentType": "ESTIMATED",
  "allocation": "RANDOMIZED",
  "masking": "QUADRUPLE",
  "sex": "ALL",
  "minimumAge": "18 Years",
  "primaryOutcomes": ["Change in HbA1c from baseline to week 52"],
  "startDate": "2025-03-01",
  "primaryCompletionDate": "2027-06-30",
  "lastUpdatePostedDate": "2026-09-10",
  "hasResults": false,
  "locationsCount": 84,
  "countries": ["United States", "Canada", "Germany"],
  "locations": [{ "facility": "Example Research Center", "city": "Phoenix", "state": "Arizona", "country": "United States", "status": "RECRUITING" }],
  "briefSummary": "This study compares ..."
}
```

Field reference: `nctId`, `url`, `briefTitle`, `officialTitle`, `overallStatus`, `whyStopped`, `studyType`, `phases[]`, `conditions[]`, `keywords[]`, `interventions[]{type,name}`, `leadSponsor`, `leadSponsorClass`, `collaborators[]`, `enrollmentCount`, `enrollmentType`, `allocation`, `interventionModel`, `primaryPurpose`, `masking`, `sex`, `minimumAge`, `maximumAge`, `healthyVolunteers`, `primaryOutcomes[]`, `startDate`, `primaryCompletionDate`, `completionDate`, `firstPostedDate`, `lastUpdatePostedDate`, `hasResults`, `locationsCount`, `countries[]`, `locations[]{facility,city,state,country,status}`, `briefSummary`, `eligibilityCriteria`. Dates are strings as published (YYYY-MM-DD or YYYY-MM).

### Pricing

Pay per event. You are charged **$2.00 per 1,000 studies** saved to the dataset, plus a fraction of a cent per run start. Nothing is charged for results you do not receive. Set "Max total charge per run" in the run options to cap spending on any run. When a run reaches your cap it stops cleanly and keeps everything it already saved.

Rough guide: 1,000 studies cost $2.00 and take about 25 seconds.

### Use it from an AI agent (MCP)

This Actor is available as an MCP tool through the Apify MCP server. Add it to your client, then ask the agent for the data in plain language.

Claude Desktop, Claude Code or Cursor (`mcp.json` / `claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com/?actors=brightpath-data/clinicaltrials-gov-search",
      "headers": { "Authorization": "Bearer YOUR_APIFY_TOKEN" }
    }
  }
}
```

ChatGPT and other clients that support remote MCP servers: add `https://mcp.apify.com/?actors=brightpath-data/clinicaltrials-gov-search` as a connector with your Apify token.

Example prompt once connected: "Find recruiting phase 3 trials for type 2 diabetes in Arizona and list the sponsor, enrollment and primary outcome for each."

### Use it from code

```bash
curl -X POST "https://api.apify.com/v2/acts/brightpath-data~clinicaltrials-gov-search/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"condition":"type 2 diabetes","status":["RECRUITING"],"maxResults":100}'
```

Python:

```python
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("brightpath-data/clinicaltrials-gov-search").call(run_input={"condition": "type 2 diabetes", "status": ["RECRUITING"], "maxResults": 100})
items = client.dataset(run["defaultDatasetId"]).list_items().items
```

### Limits and fair use

- Up to 10,000 studies per run. For larger exports, split by status, phase, date range or country.
- Requests are paced at one per second to respect the source's crawl delay, so very large runs take a few minutes.
- Site locations are capped at 50 per study; `locationsCount` always shows the full number.
- Study contacts and investigator names are intentionally not collected.

### Data source and legal

Data comes from ClinicalTrials.gov, a public registry run by the U.S. National Library of Medicine, through its official public API v2. The data is in the public domain. This Actor collects public, non-personal data only and does not bypass logins, paywalls or access controls. You are responsible for how you use the data.

### Support

Found a problem or need a field added? Open an issue on the Actor's Issues tab. Fixes for broken runs are prioritized.

# Actor input Schema

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

Condition, disease or medical term, e.g. "type 2 diabetes" or "breast cancer". Matches the Condition field on ClinicalTrials.gov.

## `query` (type: `string`):

Free-text keywords searched across the whole study record (titles, summaries, outcomes).

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

Drug, device, procedure or other intervention name, e.g. "semaglutide".

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

Organization name, e.g. "Pfizer" or "National Cancer Institute".

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

City, state, country or facility name, e.g. "Phoenix, Arizona" or "Germany".

## `status` (type: `array`):

Only include studies with these statuses. Leave empty for all.

## `phase` (type: `array`):

Only include studies in these phases. Leave empty for all.

## `studyType` (type: `string`):

Interventional, observational or expanded access.

## `updatedAfter` (type: `string`):

Only studies whose record was last updated on or after this date. Useful for daily monitoring.

## `startedAfter` (type: `string`):

Only studies with a start date on or after this date.

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

Fetch specific studies by NCT number (e.g. NCT04516746). When set, other filters still apply.

## `sort` (type: `string`):

Order of results.

## `includeLocations` (type: `boolean`):

Include up to 50 site locations (facility, city, state, country) per study.

## `includeSummary` (type: `boolean`):

Include the brief summary and eligibility criteria text. Turn off for a smaller, flatter export.

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

Maximum number of studies to save. You are charged per study saved, so this also caps the cost of a run.

## Actor input object example

```json
{
  "condition": "type 2 diabetes",
  "status": [
    "RECRUITING"
  ],
  "studyType": "",
  "sort": "LastUpdatePostDate:desc",
  "includeLocations": true,
  "includeSummary": true,
  "maxResults": 100
}
```

# Actor output Schema

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

The dataset with one flat record per result. Append ?format=csv or ?format=xlsx to the URL for other formats.

## `summary` (type: `string`):

OUTPUT record in the key-value store: counts of results pushed and charged, requests, retries and duration.

# 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": "type 2 diabetes",
    "status": [
        "RECRUITING"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("brightpath-data/clinicaltrials-gov-search").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": "type 2 diabetes",
    "status": ["RECRUITING"],
}

# Run the Actor and wait for it to finish
run = client.actor("brightpath-data/clinicaltrials-gov-search").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": "type 2 diabetes",
  "status": [
    "RECRUITING"
  ]
}' |
apify call brightpath-data/clinicaltrials-gov-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,brightpath-data/clinicaltrials-gov-search"
        }
    }
}
```

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/jfv7HXPgDaIMe2nYz/builds/JAld7Yr96HFhUu2pw/openapi.json
