# ClinicalTrials.gov Scraper — Trial Intelligence (`hipersoft/clinicaltrials-scraper`) Actor

Search ClinicalTrials.gov for clinical trials by condition, drug or sponsor and get status, phase, interventions, sponsors, enrollment, dates, eligibility, outcomes and locations. For pharma, biotech and medical research. No key.

- **URL**: https://apify.com/hipersoft/clinicaltrials-scraper.md
- **Developed by:** [hiper soft](https://apify.com/hipersoft) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.0016 / trial scraped

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/platform/actors/running/actors-in-store#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

## ClinicalTrials.gov Scraper — Bulk trial data, structured JSON, no API key, fully filterable

Search and extract clinical trial records straight from the official **ClinicalTrials.gov API v2** and get back clean, structured JSON — trial IDs, titles, status, phases, conditions, interventions, sponsors, enrollment, eligibility, outcomes and study locations. Search by condition, drug, sponsor or free text, filter by recruitment status, and collect thousands of trials per term. **No account, no API key.** Built for pharma, biotech, CRO and academic teams who need trial data at scale without wrestling with pagination or rate limits.

### Features

- 🔎 **Multi-term search** — pass any number of `queries` (condition, drug/intervention, sponsor or free text) and the scraper runs each one, deduping trials that appear under several terms by `nctId`.
- 🎯 **Status filtering** — narrow results with `statuses` such as `RECRUITING`, `COMPLETED`, `ACTIVE_NOT_RECRUITING`, `TERMINATED` or `NOT_YET_RECRUITING`; leave empty for all.
- 📊 **Deep trial detail** — phases, study type, enrollment count and type, eligibility (sex, age range, healthy volunteers) and primary outcome measures in every record.
- 🏥 **Study locations** — toggle `includeLocations` to attach facility, city, state and country for each site (up to 100 per trial), plus a `locationCount`.
- 🏢 **Sponsor intelligence** — lead sponsor, sponsor class and full collaborator list for every trial.
- 📈 **Scales cleanly** — set `maxResultsPerQuery` up to 10,000; the API is cursor-paginated and retried automatically on transient errors.
- 🧾 **Analysis-ready JSON** — flat, predictable fields with direct study URLs, ideal for spreadsheets, databases or dashboards.

### What you get

Each dataset row is one clinical trial:

```json
{
  "searchTerm": "lung cancer",
  "nctId": "NCT05012345",
  "url": "https://clinicaltrials.gov/study/NCT05012345",
  "briefTitle": "A Study of Drug X in Advanced Non-Small Cell Lung Cancer",
  "officialTitle": "A Phase 2 Randomized Study of Drug X Versus Standard of Care in NSCLC",
  "overallStatus": "RECRUITING",
  "studyType": "INTERVENTIONAL",
  "phases": ["PHASE2"],
  "conditions": ["Non-Small Cell Lung Cancer"],
  "interventions": [{ "type": "DRUG", "name": "Drug X" }],
  "leadSponsor": "Example Oncology Inc.",
  "sponsorClass": "INDUSTRY",
  "collaborators": ["National Cancer Institute"],
  "enrollmentCount": 240,
  "enrollmentType": "ESTIMATED",
  "startDate": "2023-06-01",
  "primaryCompletionDate": "2025-12-01",
  "completionDate": "2026-06-01",
  "lastUpdateDate": "2024-11-15",
  "briefSummary": "This study evaluates the efficacy and safety of Drug X...",
  "sex": "ALL",
  "minimumAge": "18 Years",
  "maximumAge": "N/A",
  "healthyVolunteers": false,
  "primaryOutcomes": ["Overall Survival", "Progression-Free Survival"],
  "locationCount": 42,
  "locations": [
    { "facility": "City Cancer Center", "city": "Boston", "state": "Massachusetts", "country": "United States" }
  ]
}
```

### Input

```json
{
  "queries": ["lung cancer", "semaglutide"],
  "statuses": ["RECRUITING"],
  "maxResultsPerQuery": 100,
  "includeLocations": true
}
```

| Field | Description |
| --- | --- |
| `queries` | Search terms — condition, drug/intervention, sponsor or free text. One run per term. |
| `statuses` | Optional status filter (e.g. `RECRUITING`, `COMPLETED`). Empty means all statuses. |
| `maxResultsPerQuery` | Maximum trials to collect per search term (1–10,000). |
| `includeLocations` | Include each trial's study sites (facility, city, state, country). |

### Use cases

- Build a competitive landscape of trials for a drug, target or indication across sponsors and phases.
- Feed recruiting-trial data (with locations) into patient-matching or site-selection workflows.
- Track sponsor and collaborator activity in a therapeutic area over time.
- Assemble structured trial datasets for market research, due diligence or academic meta-analysis.

### Pricing

Pay-per-event: you're billed a small amount per run and per item scraped — you only pay for what you get. See the **Pricing** tab for current rates.

### FAQ

**Do I need an API key?**
No. This Actor uses the official [ClinicalTrials.gov](https://clinicaltrials.gov) API v2 with no account, login or API key required.

**How many trials can I scrape per run?**
Up to 10,000 trials per query via `maxResultsPerQuery`, and you can pass multiple `queries` in one run, so a single run can collect many thousands of trials (deduped by `nctId`).

**Is scraping ClinicalTrials.gov legal?**
Yes. ClinicalTrials.gov is a public registry, and this Actor reads only its openly available records through the official API v2 and returns them as-is.

**What format is the output?**
Structured JSON — one flat record per trial — exportable as JSON, CSV or Excel. Each record includes NCT ID, titles, status, phases, conditions, interventions, sponsors, enrollment, eligibility, primary outcomes and (optionally) study locations.

**Can I filter by recruitment status or include locations?**
Yes. Use `statuses` to keep only trials that are `RECRUITING`, `COMPLETED`, `TERMINATED` etc. (leave empty for all), and toggle `includeLocations` to attach each trial's facility, city, state and country.

### Related Actors

Working with clinical or biomedical data? These other hipersoft scrapers pair well with this one:

- [PubMed Scraper](https://apify.com/hipersoft/pubmed-scraper) — biomedical papers, abstracts and MeSH terms from the NLM index
- [Europe PMC Scraper](https://apify.com/hipersoft/europepmc-scraper) — life-science papers with full-text links and citations
- [OpenFDA Scraper](https://apify.com/hipersoft/openfda-scraper) — FDA drug, device and adverse-event data
- [OpenAlex Scraper](https://apify.com/hipersoft/openalex-scraper) — 250M+ scholarly works with citations and abstracts

### Notes

This Actor uses the public ClinicalTrials.gov API v2 and returns that registry's own data as-is; it reads only openly available records and requires no login. It is an independent tool and is not affiliated with, endorsed by, or sponsored by ClinicalTrials.gov, the U.S. National Library of Medicine or the National Institutes of Health.

# Actor input Schema

## `queries` (type: `array`):

Search by condition, drug/intervention, sponsor or free text, e.g. "lung cancer", "semaglutide".

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

Only include trials with these statuses, e.g. RECRUITING, COMPLETED, ACTIVE\_NOT\_RECRUITING, TERMINATED, NOT\_YET\_RECRUITING. Empty = all.

## `maxResultsPerQuery` (type: `integer`):

Maximum trials to collect per search term.

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

Include the trial's study locations (facility, city, country). Trials can have many sites.

## Actor input object example

```json
{
  "queries": [
    "semaglutide",
    "alzheimer immunotherapy"
  ],
  "statuses": [
    "RECRUITING"
  ],
  "maxResultsPerQuery": 100,
  "includeLocations": true
}
```

# 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 = {
    "queries": [
        "lung cancer"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hipersoft/clinicaltrials-scraper").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 = { "queries": ["lung cancer"] }

# Run the Actor and wait for it to finish
run = client.actor("hipersoft/clinicaltrials-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "queries": [
    "lung cancer"
  ]
}' |
apify call hipersoft/clinicaltrials-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=hipersoft/clinicaltrials-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/pLMy8jkBhj9fsKTBy/builds/eryvvafeRP6IJsBiH/openapi.json
