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

Search and export clinical trial records from the official ClinicalTrials.gov API v2. No API key.

- **URL**: https://apify.com/straightforward\_hydra/clinicaltrials-gov-scraper.md
- **Developed by:** [Dev D](https://apify.com/straightforward_hydra) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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 🧪

**Search and export clinical trial records from the official ClinicalTrials.gov API — by condition, drug, sponsor, phase, status and location. No API key, no login.**

Pull clean, structured clinical-trial data straight from the U.S. National Library of Medicine's [ClinicalTrials.gov](https://clinicaltrials.gov) registry (API v2). Filter by **condition/disease**, **intervention/drug**, **sponsor**, **recruitment status**, **phase**, **study type** and **location** — and get one tidy record per trial. Perfect for pharma/biotech competitive intelligence, drug-pipeline tracking, medical research, CRO market analysis and investor due diligence.

> Uses the official ClinicalTrials.gov REST API v2 — public U.S. government registry data, no key required.

---

### What you can do with it

- 💊 **Track a drug pipeline** — every trial for an intervention across all phases and sponsors.
- 🏢 **Competitive intelligence** — all of a competitor's active/completed trials by sponsor name.
- 🔬 **Recruiting trials** — currently-recruiting studies for a condition, with sites and locations.
- 📈 **Market & investor research** — enrollment sizes, phases and timelines across a therapeutic area.
- 🗺️ **Find trial sites** — facilities, cities and countries running a given study.

### Features

- ✅ **No API key** — official ClinicalTrials.gov v2 API, works out of the box.
- ✅ **Rich records** — status, phase, sponsor, interventions, conditions, eligibility, enrollment, outcomes, locations.
- ✅ **Powerful filters** — condition, intervention, sponsor, status, phase, study type, location, title.
- ✅ **Sort** — by relevance, last updated, first posted, enrollment size or start date.
- ✅ **Scales** — token-paginated, up to 1,000 studies per request.

---

### Input

| Field | Description |
|---|---|
| **Condition / disease** | e.g. `breast cancer`, `type 2 diabetes`. |
| **Intervention / treatment** | e.g. `pembrolizumab`, `metformin`. |
| **Sponsor** | e.g. `Pfizer`, `National Cancer Institute`. |
| **Other search terms** | Free text across the whole record. |
| **Recruitment status** | RECRUITING, COMPLETED, TERMINATED, … |
| **Study type / Phase** | Interventional/Observational · PHASE1–4. |
| **Location** | e.g. `Boston`, `Germany`. |
| **Sort / Max results** | Ordering and result cap. |

#### Example — recruiting Phase 3 cancer trials, largest first

```json
{
  "condition": "cancer",
  "statuses": ["RECRUITING"],
  "phases": ["PHASE3"],
  "sort": "EnrollmentCount:desc",
  "maxResults": 200
}
````

#### Example — all Pfizer trials, newest updates first

```json
{
  "sponsor": "Pfizer",
  "sort": "LastUpdatePostDate:desc",
  "maxResults": 500
}
```

### Output

One row per trial:

```json
{
  "nct_id": "NCT01234567",
  "url": "https://clinicaltrials.gov/study/NCT01234567",
  "brief_title": "A Study of Drug X in Advanced Solid Tumors",
  "overall_status": "RECRUITING",
  "study_type": "INTERVENTIONAL",
  "phases": ["PHASE2"],
  "conditions": ["Solid Tumor", "Melanoma"],
  "interventions": [{ "type": "DRUG", "name": "Drug X" }],
  "lead_sponsor": "Example Pharma",
  "lead_sponsor_class": "INDUSTRY",
  "enrollment_count": 240,
  "enrollment_type": "ESTIMATED",
  "primary_purpose": "TREATMENT",
  "eligibility_sex": "ALL",
  "minimum_age": "18 Years",
  "start_date": "2024-03",
  "last_update_post_date": "2025-01-15",
  "primary_outcomes": ["Overall Response Rate"],
  "locations_count": 42,
  "locations": [
    { "facility": "Example Cancer Center", "city": "Boston", "state": "Massachusetts", "country": "United States", "status": "RECRUITING" }
  ]
}
```

### Run it on a schedule

Schedule the Actor to snapshot a therapeutic area or a competitor's pipeline over time, and connect a **Google Sheets / Slack / webhook** integration to get alerted when new trials appear or statuses change.

### Notes & limitations

- Uses the official ClinicalTrials.gov API v2 — no key needed.
- Data is a point-in-time snapshot at run time.
- `locations` is capped per study (configurable); `locations_count` always reflects the true total.
- Public, non-personal U.S. government registry data.
- Data source: ClinicalTrials.gov (U.S. National Library of Medicine).

***

#### Keywords

ClinicalTrials.gov, clinical trials, clinical trial data, clinical trials scraper, clinical trials API, drug pipeline, pharma intelligence, biotech research, medical research, trial recruitment, NCT, interventional study, observational study, trial phase, sponsor trials, therapeutic area, CRO, drug development, pharmaceutical data, life sciences.

# Actor input Schema

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

Condition or disease, e.g. "breast cancer", "type 2 diabetes", "alzheimer".

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

Free-text terms searched across the whole record (drug, keyword, etc.), e.g. "semaglutide".

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

Intervention name, e.g. "pembrolizumab", "metformin", "gene therapy".

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

Lead sponsor or collaborator, e.g. "Pfizer", "Moderna", "National Cancer Institute".

## `title` (type: `string`):

Words that must appear in the study title.

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

Location terms, e.g. "Boston", "Germany", "California".

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

Keep only these statuses. Common: RECRUITING, NOT\_YET\_RECRUITING, ACTIVE\_NOT\_RECRUITING, COMPLETED, TERMINATED, WITHDRAWN, SUSPENDED.

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

Limit to a study type.

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

Trial phase(s), e.g. PHASE1, PHASE2, PHASE3, PHASE4, EARLY\_PHASE1, NA.

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

How to order results.

## `maxLocationsPerStudy` (type: `integer`):

Cap the locations array per study (large trials can have hundreds). locations\_count always reflects the true total.

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

How many studies to return.

## Actor input object example

```json
{
  "studyType": "",
  "sort": "",
  "maxLocationsPerStudy": 100,
  "maxResults": 100
}
```

# 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("straightforward_hydra/clinicaltrials-gov-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("straightforward_hydra/clinicaltrials-gov-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 '{}' |
apify call straightforward_hydra/clinicaltrials-gov-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "ClinicalTrials.gov Scraper",
        "description": "Search and export clinical trial records from the official ClinicalTrials.gov API v2. No API key.",
        "version": "0.1",
        "x-build-id": "hHO5iSHLkWpeiZbkU"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/straightforward_hydra~clinicaltrials-gov-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-straightforward_hydra-clinicaltrials-gov-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/straightforward_hydra~clinicaltrials-gov-scraper/runs": {
            "post": {
                "operationId": "runs-sync-straightforward_hydra-clinicaltrials-gov-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/straightforward_hydra~clinicaltrials-gov-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-straightforward_hydra-clinicaltrials-gov-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "condition": {
                        "title": "Condition / disease",
                        "type": "string",
                        "description": "Condition or disease, e.g. \"breast cancer\", \"type 2 diabetes\", \"alzheimer\"."
                    },
                    "term": {
                        "title": "Other search terms",
                        "type": "string",
                        "description": "Free-text terms searched across the whole record (drug, keyword, etc.), e.g. \"semaglutide\"."
                    },
                    "intervention": {
                        "title": "Intervention / treatment",
                        "type": "string",
                        "description": "Intervention name, e.g. \"pembrolizumab\", \"metformin\", \"gene therapy\"."
                    },
                    "sponsor": {
                        "title": "Sponsor",
                        "type": "string",
                        "description": "Lead sponsor or collaborator, e.g. \"Pfizer\", \"Moderna\", \"National Cancer Institute\"."
                    },
                    "title": {
                        "title": "Title contains",
                        "type": "string",
                        "description": "Words that must appear in the study title."
                    },
                    "location": {
                        "title": "Location",
                        "type": "string",
                        "description": "Location terms, e.g. \"Boston\", \"Germany\", \"California\"."
                    },
                    "statuses": {
                        "title": "Recruitment status",
                        "type": "array",
                        "description": "Keep only these statuses. Common: RECRUITING, NOT_YET_RECRUITING, ACTIVE_NOT_RECRUITING, COMPLETED, TERMINATED, WITHDRAWN, SUSPENDED.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "RECRUITING",
                                "NOT_YET_RECRUITING",
                                "ENROLLING_BY_INVITATION",
                                "ACTIVE_NOT_RECRUITING",
                                "COMPLETED",
                                "SUSPENDED",
                                "TERMINATED",
                                "WITHDRAWN",
                                "AVAILABLE",
                                "APPROVED_FOR_MARKETING",
                                "UNKNOWN"
                            ]
                        }
                    },
                    "studyType": {
                        "title": "Study type",
                        "enum": [
                            "",
                            "INTERVENTIONAL",
                            "OBSERVATIONAL",
                            "EXPANDED_ACCESS"
                        ],
                        "type": "string",
                        "description": "Limit to a study type.",
                        "default": ""
                    },
                    "phases": {
                        "title": "Phase",
                        "type": "array",
                        "description": "Trial phase(s), e.g. PHASE1, PHASE2, PHASE3, PHASE4, EARLY_PHASE1, NA.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "EARLY_PHASE1",
                                "PHASE1",
                                "PHASE2",
                                "PHASE3",
                                "PHASE4",
                                "NA"
                            ]
                        }
                    },
                    "sort": {
                        "title": "Sort by",
                        "enum": [
                            "",
                            "LastUpdatePostDate:desc",
                            "StudyFirstPostDate:desc",
                            "EnrollmentCount:desc",
                            "StartDate:desc"
                        ],
                        "type": "string",
                        "description": "How to order results.",
                        "default": ""
                    },
                    "maxLocationsPerStudy": {
                        "title": "Max locations per study",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Cap the locations array per study (large trials can have hundreds). locations_count always reflects the true total.",
                        "default": 100
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 1,
                        "maximum": 50000,
                        "type": "integer",
                        "description": "How many studies to return.",
                        "default": 100
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
