# ClinicalTrials.gov Scraper (`anyxsolutions/clinicaltrials-scraper`) Actor

Scrape clinical trials from ClinicalTrials.gov by search, filtered search link or NCT number: titles, status, phases, conditions, interventions, sponsors, enrollment, key dates, eligibility, outcomes, trial sites with coordinates, contacts and PubMed references. Clean JSON, no login, no API key.

- **URL**: https://apify.com/anyxsolutions/clinicaltrials-scraper.md
- **Developed by:** [Anyx Solutions](https://apify.com/anyxsolutions) (community)
- **Categories:** Other, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

![banner](https://anyx.solutions/banners/clinicaltrials-scraper.png)

## ClinicalTrials.gov Scraper

**Clinical trials from ClinicalTrials.gov — by search, filtered search link or NCT number — with status, phases, sponsors, eligibility, outcomes, sites and contacts, as clean JSON.**

ClinicalTrials.gov is the U.S. National Library of Medicine's registry of more than 600,000
clinical studies run in over 220 countries: the reference source on who is testing what, where,
and how far along it is. This Actor turns it into a dataset. Paste a ClinicalTrials.gov search
(with its filters) or a study link, or search by term, condition, intervention, sponsor and
location, narrowed by recruitment status, phase and study type, and get every matching study with
its NCT number, titles and acronym, overall status (and why it stopped), phases, study type,
conditions and keywords, interventions with their other names, lead sponsor and collaborators with
their funder type, enrollment, start, completion and posting dates, brief summary and detailed
description, eligibility criteria with sex, age limits and healthy-volunteer flag, primary and
secondary outcomes, trial sites with their recruitment status and coordinates, central contacts,
whether results are posted, and PubMed references. There is no login, no API key and no proxy to
configure. Built for pharma and biotech competitive intelligence, clinical-operations site
selection, patient-recruitment and trial-matching services, investors tracking pipelines,
medical-affairs teams, and researchers analysing the trial landscape.

### ⚡ Quick start

```json
{
  "startUrls": [
    {
      "url": "https://clinicaltrials.gov/search?cond=Breast%20Cancer&aggFilters=phase:3,status:rec"
    }
  ],
  "maxItems": 5
}
```

Or search with the input fields:

```json
{
  "conditions": ["type 2 diabetes", "obesity"],
  "interventions": ["semaglutide", "tirzepatide"],
  "statuses": ["RECRUITING", "NOT_YET_RECRUITING"],
  "phases": ["PHASE3"],
  "sortBy": "newest",
  "maxItems": 100
}
```

### 🧩 Input

| Field                | Type    | Required | Default                      | Description                                                                                                                                                                                                   |
| -------------------- | ------- | -------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `startUrls`          | array   | no       | —                            | ClinicalTrials.gov URLs: searches (`clinicaltrials.gov/search?cond=…`, with their filters, location, date ranges and sort) or studies (`clinicaltrials.gov/study/<NCT number>`).                              |
| `maxItems`           | integer | no       | —                            | Maximum number of studies per start URL or search. The input form starts at 5; leave it empty to get every match.                                                                                             |
| `searchTerms`        | array   | no       | —                            | Searches, one per line, as typed in the site's Other terms box, such as `mRNA vaccine`. Each line is its own search, narrowed by the fields below.                                                            |
| `conditions`         | array   | no       | —                            | Conditions or diseases, such as `type 2 diabetes`. A study matches when it is about any of them.                                                                                                              |
| `interventions`      | array   | no       | —                            | Drugs, devices, procedures or other treatments, such as `pembrolizumab`. A study matches when it tests any of them.                                                                                           |
| `sponsors`           | array   | no       | —                            | Sponsor or collaborator names, such as `Pfizer`. A study matches when any of them sponsors or collaborates on it.                                                                                             |
| `locations`          | array   | no       | —                            | Countries, states, cities or facilities, such as `Germany` or `Boston`. A study matches when it has a site in any of them.                                                                                    |
| `statuses`           | array   | no       | —                            | Recruitment status: `RECRUITING`, `NOT_YET_RECRUITING`, `ENROLLING_BY_INVITATION`, `ACTIVE_NOT_RECRUITING`, `COMPLETED`, `SUSPENDED`, `TERMINATED`, `WITHDRAWN`, `UNKNOWN`, and the expanded-access statuses. |
| `phases`             | array   | no       | —                            | Phase: `EARLY_PHASE1`, `PHASE1`, `PHASE2`, `PHASE3`, `PHASE4` or `NA` (not applicable).                                                                                                                       |
| `studyTypes`         | array   | no       | —                            | Study type: `INTERVENTIONAL` (clinical trials), `OBSERVATIONAL` or `EXPANDED_ACCESS`.                                                                                                                         |
| `sortBy`             | string  | no       | `"relevance"`                | Sort the input searches by `relevance` (best match), `newest` (first posted) or `last_updated`.                                                                                                               |
| `proxyConfiguration` | object  | no       | `{ "useApifyProxy": false }` | Proxy settings. ClinicalTrials.gov needs no proxy.                                                                                                                                                            |

Add at least one start URL or one search field. The search fields combine like the site's search
form: values in one field are alternatives, and fields narrow each other. They apply to the input
searches only; a search URL keeps the filters it was saved with.

**Search URL filters.** Set up a search on clinicaltrials.gov, apply the filters you want, and
paste the address. The Actor keeps the condition, other terms, intervention, title, outcome,
sponsor, lead sponsor, study ID and location boxes; the status, phase, study type, sex, age group,
healthy volunteers, results, documents and funder type filters; the country, state and city or
the distance around a place; the start, completion, first posted, results posted and last update
date ranges; and the sort. Any parameter it cannot read is named in the log and left out.

### 📤 Output

Each study is one dataset row.

#### Fields

| Field                   | Type    | Description                                                                                                                                              |
| ----------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `nctId`                 | string  | NCT number, such as `NCT04368728`.                                                                                                                       |
| `url`                   | string  | The study's ClinicalTrials.gov page.                                                                                                                     |
| `briefTitle`            | string  | Brief title.                                                                                                                                             |
| `officialTitle`         | string  | Official (scientific) title.                                                                                                                             |
| `acronym`               | string  | Study acronym, such as `OPT-PEMBRO`.                                                                                                                     |
| `overallStatus`         | string  | Overall recruitment status, such as `RECRUITING`, `COMPLETED` or `TERMINATED`.                                                                           |
| `whyStopped`            | string  | Why a suspended, terminated or withdrawn study stopped.                                                                                                  |
| `phases`                | array   | Phases, such as `["PHASE2", "PHASE3"]`; empty for observational and expanded-access studies.                                                             |
| `studyType`             | string  | `INTERVENTIONAL`, `OBSERVATIONAL` or `EXPANDED_ACCESS`.                                                                                                  |
| `conditions`            | array   | Conditions or diseases studied.                                                                                                                          |
| `keywords`              | array   | Keywords given by the sponsor.                                                                                                                           |
| `interventions`         | array   | Interventions, each with `type` (`DRUG`, `BIOLOGICAL`, `DEVICE`, …), `name`, `description` and `otherNames` (brand names and codes).                     |
| `sponsor`               | object  | Lead sponsor `name` and `funderType` (`INDUSTRY`, `NIH`, `FED`, `OTHER`, …), and `collaborators`, each with `name` and `funderType`.                     |
| `enrollment`            | object  | `count` of participants and its `type`: `ACTUAL`, or `ESTIMATED` while the study is enrolling.                                                           |
| `startDate`             | string  | Study start date, as precise as the record gives it: `2025-07-23` or `2027-07`.                                                                          |
| `primaryCompletionDate` | string  | Primary completion date.                                                                                                                                 |
| `completionDate`        | string  | Study completion date.                                                                                                                                   |
| `firstPostedDate`       | string  | Date the study was first posted.                                                                                                                         |
| `lastUpdatePostedDate`  | string  | Date of the last posted update.                                                                                                                          |
| `briefSummary`          | string  | Brief summary, as plain text.                                                                                                                            |
| `detailedDescription`   | string  | Detailed description, as plain text.                                                                                                                     |
| `eligibility`           | object  | `criteria` (inclusion and exclusion criteria), `sex`, `minimumAge`, `maximumAge`, `ageGroups` (`CHILD`, `ADULT`, `OLDER_ADULT`) and `healthyVolunteers`. |
| `primaryOutcomes`       | array   | Primary outcome measures, each with `measure`, `description` and `timeFrame`.                                                                            |
| `secondaryOutcomes`     | array   | Secondary outcome measures, each with `measure`, `description` and `timeFrame`.                                                                          |
| `locations`             | array   | Trial sites, each with `facility`, `city`, `state`, `zip`, `country`, `status` (the site's recruitment status) and `geo` (`lat`, `lon`).                 |
| `contacts`              | array   | Central contacts as published on the record, each with `name`, `role`, `phone` and `email`.                                                              |
| `hasResults`            | boolean | Whether results are posted on ClinicalTrials.gov.                                                                                                        |
| `references`            | array   | Publications, each with `pmid`, `type` (`BACKGROUND`, `RESULT` or `DERIVED`) and `citation`.                                                             |
| `searchUrl`             | string  | The ClinicalTrials.gov search that found the study; `null` for studies added by link.                                                                    |

<details><summary>Example output</summary>

```json
{
  "nctId": "NCT06606730",
  "url": "https://clinicaltrials.gov/study/NCT06606730",
  "briefTitle": "Personalizing the Use of Pembrolizumab for Patients Who Have a Strong Response in Early Triple Negative Breast Cancer",
  "officialTitle": "OPTimizing Adjuvant Prescription of PEMBROlizumab in Patients With Early-stage Triple-negative Breast Cancer Achieving Pathologic Complete Response After Standard Neoadjuvant Chemotherapy and Pembrolizumab",
  "acronym": "OPT-PEMBRO",
  "overallStatus": "RECRUITING",
  "whyStopped": null,
  "phases": ["PHASE3"],
  "studyType": "INTERVENTIONAL",
  "conditions": ["Breast Cancers", "Triple Negative Breast Cancer (TNBC)"],
  "keywords": [],
  "interventions": [
    {
      "type": "DRUG",
      "name": "Pembrolizumab",
      "description": "Administration of pembrolizumab for 6 months",
      "otherNames": ["Keytruda"]
    },
    {
      "type": "OTHER",
      "name": "Deescalation",
      "description": "Patients will be followed up according to standard practice for 4 years",
      "otherNames": []
    }
  ],
  "sponsor": {
    "name": "UNICANCER",
    "funderType": "OTHER",
    "collaborators": []
  },
  "enrollment": {
    "count": 2454,
    "type": "ESTIMATED"
  },
  "startDate": "2025-07-23",
  "primaryCompletionDate": "2033-01-01",
  "completionDate": "2039-06-01",
  "firstPostedDate": "2024-09-23",
  "lastUpdatePostedDate": "2026-07-23",
  "briefSummary": "OPT-PEMBRO trial is a pragmatic, multicentre, international, prospective, non-inferiority, two-arms, randomised (1:1), open-label, Phase III clinical study.\n\nThe main goal of this research is to determine if patients …",
  "detailedDescription": "Triple-negative breast cancer is a particular type of breast cancer in which the cancer cells do not possess receptors for the proteins estrogen, progesterone, or HER2. The usual treatment for early-stage …",
  "eligibility": {
    "criteria": "Inclusion Criteria:\n\n1. Patient must have signed a written informed consent prior to any trial-related procedures. When the patient is physically unable to give his written consent, a trusted person of his choice, independent from the investigator or the …",
    "sex": "ALL",
    "minimumAge": "18 Years",
    "maximumAge": null,
    "ageGroups": ["ADULT", "OLDER_ADULT"],
    "healthyVolunteers": false
  },
  "primaryOutcomes": [
    {
      "measure": "Recurrence-free survival",
      "description": "Recurrence-free survival is defined as the time from randomisation to invasive loco-regional or distant recurrence or death from any cause, whichever occurs …",
      "timeFrame": "From randomization to disease progression or death, up to 8 years."
    }
  ],
  "secondaryOutcomes": [
    {
      "measure": "Acute and late toxicity during the study",
      "description": "The National Cancer Institute-Common Terminology Criteria for Adverse Events version 5 (NCI-CTCAE v5) is widely accepted in the community of oncology research …",
      "timeFrame": "Throughout study, up to 1 year."
    }
  ],
  "locations": [
    {
      "facility": "Cliniques Universitaires Saint Luc Brussels",
      "city": "Brussels",
      "state": null,
      "zip": "1200",
      "country": "Belgium",
      "status": "RECRUITING",
      "geo": {
        "lat": 50.85045,
        "lon": 4.34878
      }
    },
    {
      "facility": "Institut Gustave Roussy",
      "city": "Villejuif",
      "state": null,
      "zip": "94805",
      "country": "France",
      "status": "RECRUITING",
      "geo": {
        "lat": 48.7939,
        "lon": 2.35992
      }
    }
  ],
  "contacts": [
    {
      "name": "…",
      "role": "CONTACT",
      "phone": "…",
      "email": "…"
    }
  ],
  "hasResults": false,
  "references": [],
  "searchUrl": "https://clinicaltrials.gov/search?cond=Breast%20Cancer&aggFilters=phase:3,status:rec"
}
```

The contact's name, phone and email are elided here; real runs return the central contacts as
published on the study record.

</details>

### 💡 Use cases

- **Competitive intelligence** — track every trial a competitor sponsors, or every study testing a drug class or target, with phases, status and dates.
- **Pipeline monitoring** — a weekly feed of newly posted or recently updated trials in your therapy area, sorted newest first.
- **Site selection and feasibility** — map where trials in an indication recruit, with facility, city, country and coordinates.
- **Patient recruitment and trial matching** — recruiting studies near a place, with eligibility criteria, age limits and central contacts.
- **Investment research** — follow a company's pipeline from first posting to primary completion and posted results.
- **Research and RAG** — feed summaries, eligibility criteria and outcomes into analysis, search or LLM pipelines, and link out to PubMed references.

### ❓ FAQ

- **Do I need an account, API key or proxy?** No. ClinicalTrials.gov is public, and the Actor runs without a proxy by default.
- **How fast is it?** ClinicalTrials.gov asks for about 50 requests a minute, and the Actor keeps to that. Each request returns up to 100 full studies, so even searches with thousands of matches finish in minutes.
- **How do I scrape one study, or a list of them?** Add each study link, such as `https://clinicaltrials.gov/study/NCT04368728`, to `startUrls`. Every listed study is returned, whatever `maxItems` says.
- **Can I combine a condition with a drug and a country?** Yes. Fill in `conditions`, `interventions` and `locations` together, or set them up on the site and paste the search URL.
- **Why are the dates sometimes only a month?** Sponsors may register a month instead of a day, such as `2027-07`, especially for estimated dates. `enrollment.type` likewise says whether the count is actual or estimated.
- **Why are the contacts empty?** Many completed, industry or older studies publish no central contact. Recruiting studies usually list one.
- **Does it include the posted results?** It flags them in `hasResults` and links each study; the results tables themselves are not included.
- **Why is the phase empty?** Observational and expanded-access studies have no phase; trials without drug phases, such as behavioural or device studies, show `NA`.

### 🔗 More scrapers by Anyx

- [PubMed Scraper](https://apify.com/anyxsolutions/pubmed-scraper)
- [OpenAlex Scraper](https://apify.com/anyxsolutions/openalex-scraper)
- [Crossref Scraper](https://apify.com/anyxsolutions/crossref-scraper)
- [arXiv Scraper](https://apify.com/anyxsolutions/arxiv-scraper)

### 🤝 Anyx Solutions

We build custom scrapers and data-extraction pipelines.

- Email: tantosthor@gmail.com

### 🖼 Image credit

Image credit: [clinicaltrials.gov](https://clinicaltrials.gov/)

# Actor input Schema

## `startUrls` (type: `array`):

ClinicalTrials.gov URLs, for example a search such as https://clinicaltrials.gov/search?cond=Breast%20Cancer\&aggFilters=phase:3,status:rec (its search boxes, status, phase, study-type and other filters, location, date ranges and sort are kept) or a study such as https://clinicaltrials.gov/study/NCT04368728.

## `maxItems` (type: `integer`):

Maximum number of studies to return per start URL or search. Leave empty to get every match.

## `searchTerms` (type: `array`):

Searches to run, one per line, as you would type them in the Other terms box, for example mRNA vaccine. Each line is a separate search, narrowed by the fields below.

## `conditions` (type: `array`):

Conditions or diseases, one per line, for example type 2 diabetes. A study matches when it is about any of them.

## `interventions` (type: `array`):

Drugs, devices, procedures or other treatments, one per line, for example pembrolizumab. A study matches when it tests any of them.

## `sponsors` (type: `array`):

Sponsor or collaborator names, one per line, for example Pfizer. A study matches when any of them sponsors or collaborates on it.

## `locations` (type: `array`):

Countries, states, cities or facilities where the study has a site, one per line, for example Germany or Boston. A study matches when it has a site in any of them.

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

Only return studies with one of these overall statuses, for example Recruiting and Not yet recruiting. Leave empty for every status.

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

Only return studies in one of these phases, for example Phase 2 and Phase 3. Leave empty for every phase.

## `studyTypes` (type: `array`):

Only return studies of these types, for example Interventional for clinical trials. Leave empty for every type.

## `sortBy` (type: `string`):

Order of the results of the searches above: best match, newest first (first posted) or most recently updated.

## `proxyConfiguration` (type: `object`):

Proxy settings. ClinicalTrials.gov needs no proxy; the Actor keeps to its request rate.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://clinicaltrials.gov/search?cond=Breast%20Cancer&aggFilters=phase:3,status:rec"
    }
  ],
  "maxItems": 5,
  "sortBy": "relevance",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "startUrls": [
        {
            "url": "https://clinicaltrials.gov/search?cond=Breast%20Cancer&aggFilters=phase:3,status:rec"
        }
    ],
    "maxItems": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("anyxsolutions/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 = {
    "startUrls": [{ "url": "https://clinicaltrials.gov/search?cond=Breast%20Cancer&aggFilters=phase:3,status:rec" }],
    "maxItems": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("anyxsolutions/clinicaltrials-scraper").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 '{
  "startUrls": [
    {
      "url": "https://clinicaltrials.gov/search?cond=Breast%20Cancer&aggFilters=phase:3,status:rec"
    }
  ],
  "maxItems": 5
}' |
apify call anyxsolutions/clinicaltrials-scraper --silent --output-dataset

```

## MCP server setup

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

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/6IGbmI0n6d4gX73jy/builds/wWRn9xJ32t2vDQ5La/openapi.json
