# ClinicalTrials.gov Scraper: Studies, Results & Updates (`autofacts/clinical-trials-scraper`) Actor

Search official ClinicalTrials.gov v2 studies with conditions, interventions, sponsors, locations, recruitment status, results metadata, eligibility, and incremental updates. No API key required.

- **URL**: https://apify.com/autofacts/clinical-trials-scraper.md
- **Developed by:** [Richard Feng](https://apify.com/autofacts) (community)
- **Categories:** Business, AI, Education
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 clinical trial 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.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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: Studies, Results & Updates

Search the public ClinicalTrials.gov v2 API and export normalized study records for research monitoring, competitive intelligence, recruiting analysis, and RAG pipelines.

### At a glance

| Field | Details |
|-------|---------|
| Source | Official ClinicalTrials.gov v2 public API |
| Authentication | No API key required |
| Coverage | Global clinical study records registered in ClinicalTrials.gov, including country/state/city/facility locations when provided |
| Best for | Clinical trials scraper, recruiting trials API, eligibility criteria extraction, pharma pipeline monitoring, CRO intelligence, medical AI and RAG datasets |
| Pricing | $0.002 per saved study |

### Features

| Feature | Description |
|---------|-------------|
| Public v2 API | Uses ClinicalTrials.gov v2 directly; no API key is required. |
| Study search | Search by keyword, condition, intervention, sponsor, location, status, phase, or NCT ID. |
| Incremental updates | Use `updatedSince` to monitor studies whose LastUpdatePostDate changed after a date. |
| Results metadata | Captures whether participant flow, outcome measures, and adverse events result sections are present. |
| RAG-ready chunks | Optional text chunks from titles, summaries, eligibility, and outcomes. |
| Full raw records | Set `outputFields` to `full` to include raw protocol, derived, and results sections. |

### Quick Start

```json
{
    "condition": "diabetes",
    "status": ["RECRUITING"],
    "maxItems": 10
}
````

### Input

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `query` | string | no | - | General ClinicalTrials.gov `query.term` expression. |
| `condition` | string | no | - | Condition or disease search. |
| `intervention` | string | no | - | Drug, device, procedure, biologic, or other intervention. |
| `sponsor` | string | no | - | Sponsor or collaborator search. |
| `location` | string | no | - | City, state, country, or facility search. |
| `status` | string\[] | no | - | Overall status values such as `RECRUITING` or `COMPLETED`. |
| `phase` | string\[] | no | - | Phase values such as `PHASE2` or `PHASE3`. |
| `nctIds` | string\[] | no | - | Specific NCT identifiers. |
| `updatedSince` | string | no | - | YYYY-MM-DD filter on LastUpdatePostDate. |
| `outputFields` | string | no | `summary` | `summary` for normalized output, `full` for raw sections too. |
| `chunking` | string | no | `paragraph` | `paragraph` or `none`. |
| `maxItems` | integer | no | 10 | Maximum saved studies. |

Provide at least one search field for production runs. If no search field is provided, the Actor runs a one-item `diabetes` + `RECRUITING` sample so one-click platform tests complete successfully. Phase filtering uses the ClinicalTrials.gov v2 advanced query syntax `AREA[Phase]...`.

### Output

Each dataset item is one study.

| Field | Type | Description |
|-------|------|-------------|
| `nctId` | string | ClinicalTrials.gov identifier. |
| `title` | string | Brief study title. |
| `officialTitle` | string | Official protocol title when available. |
| `status` | string | Overall study status. |
| `phase` | string\[] | Study phases. |
| `conditions` | string\[] | Conditions/diseases. |
| `interventions` | object\[] | Intervention name, type, description, and arm labels. |
| `sponsors` | object | Lead sponsor and collaborators. |
| `locations` | object\[] | Facility, city, state, country, and location status. |
| `eligibility` | string | Eligibility criteria text. |
| `outcomes` | object | Primary and secondary outcome modules. |
| `meshTerms` | object | Derived condition and intervention MeSH terms. |
| `hasResults` | boolean | Whether results data is indicated. |
| `resultsSummary` | object | Presence flags for participant flow, outcomes, and adverse events. |
| `lastUpdate` | string | LastUpdatePostDate. |
| `url` | string | Study page URL. |
| `fullTextChunks` | object\[] | Optional text chunks for retrieval workflows. |

#### Example Item

```json
{
    "itemType": "study",
    "nctId": "NCT01884792",
    "title": "Example Diabetes Study",
    "status": "COMPLETED",
    "phase": ["PHASE2"],
    "conditions": ["Diabetes Mellitus"],
    "lastUpdate": "2026-06-01",
    "url": "https://clinicaltrials.gov/study/NCT01884792"
}
```

### Recipes

#### Recruiting oncology trials

```json
{
    "condition": "lung cancer",
    "status": ["RECRUITING"],
    "phase": ["PHASE2", "PHASE3"],
    "maxItems": 250
}
```

Use this to build a current recruiting landscape by disease area and phase.

#### Monitor changed studies

```json
{
    "updatedSince": "2026-06-01",
    "outputFields": "full",
    "maxItems": 500
}
```

Use this pattern for daily or weekly monitoring. `updatedSince` filters against ClinicalTrials.gov LastUpdatePostDate.

#### Pull exact NCT records

```json
{
    "nctIds": ["NCT01884792", "NCT04368728"],
    "outputFields": "full",
    "chunking": "none"
}
```

Use this when you already have identifiers from another workflow and need stable full records.

### Pricing

This Actor uses pay-per-event pricing: **$0.002 per study** extracted. A run fetching 1,000 studies costs approximately **$2.00**.

### FAQ

**Do I need an API key?**

No. ClinicalTrials.gov v2 is public and does not require an API key.

**Can I export raw ClinicalTrials.gov sections?**

Yes. Set `outputFields` to `full` to include `protocolSection`, `derivedSection`, and `resultsSection` in each item.

**Why are phase filters implemented as advanced queries?**

The current ClinicalTrials.gov v2 API supports phase filtering through advanced area expressions such as `AREA[Phase]PHASE2`.

### Legal & Compliance

ClinicalTrials.gov is a public registry. This Actor uses the official public API, applies conservative request spacing, and stores the data returned by the API. Review ClinicalTrials.gov terms and any downstream regulatory requirements before using exported data for clinical, legal, or compliance decisions.

# Actor input Schema

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

General ClinicalTrials.gov query.term search expression, e.g. cancer AND immunotherapy.

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

Search the condition/disease field, e.g. diabetes, glioblastoma, asthma.

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

Search interventions, drugs, devices, procedures, or biologics.

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

Search study sponsors and collaborators.

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

Search trial locations by city, state, country, or facility.

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

Filter by ClinicalTrials.gov overall status. Multiple values are combined with OR.

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

Filter by study phase using the current ClinicalTrials.gov advanced AREA\[Phase] query.

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

Specific ClinicalTrials.gov identifiers, e.g. NCT01884792. Multiple IDs are combined with OR.

## `updatedSince` (type: `string`):

Return studies with LastUpdatePostDate on or after this YYYY-MM-DD date.

## `outputFields` (type: `string`):

Use summary for compact normalized records, or full to include raw protocol, derived, and results sections.

## `chunking` (type: `string`):

Create paragraph-sized text chunks from title, summary, eligibility, and outcomes for RAG workflows.

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

Maximum number of items to extract and save. Each saved item is charged as one event.

## Actor input object example

```json
{
  "condition": "diabetes",
  "status": [
    "RECRUITING"
  ],
  "outputFields": "summary",
  "chunking": "paragraph",
  "maxItems": 1
}
```

# 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 = {
    "condition": "diabetes",
    "status": [
        "RECRUITING"
    ],
    "outputFields": "summary",
    "chunking": "paragraph",
    "maxItems": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("autofacts/clinical-trials-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 = {
    "condition": "diabetes",
    "status": ["RECRUITING"],
    "outputFields": "summary",
    "chunking": "paragraph",
    "maxItems": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("autofacts/clinical-trials-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 '{
  "condition": "diabetes",
  "status": [
    "RECRUITING"
  ],
  "outputFields": "summary",
  "chunking": "paragraph",
  "maxItems": 1
}' |
apify call autofacts/clinical-trials-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "ClinicalTrials.gov Scraper: Studies, Results & Updates",
        "description": "Search official ClinicalTrials.gov v2 studies with conditions, interventions, sponsors, locations, recruitment status, results metadata, eligibility, and incremental updates. No API key required.",
        "version": "1.0",
        "x-build-id": "1VPQXmZ2IRptuTGyB"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/autofacts~clinical-trials-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-autofacts-clinical-trials-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/autofacts~clinical-trials-scraper/runs": {
            "post": {
                "operationId": "runs-sync-autofacts-clinical-trials-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/autofacts~clinical-trials-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-autofacts-clinical-trials-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": {
                    "query": {
                        "title": "Keyword query",
                        "type": "string",
                        "description": "General ClinicalTrials.gov query.term search expression, e.g. cancer AND immunotherapy."
                    },
                    "condition": {
                        "title": "Condition or disease",
                        "type": "string",
                        "description": "Search the condition/disease field, e.g. diabetes, glioblastoma, asthma."
                    },
                    "intervention": {
                        "title": "Intervention or treatment",
                        "type": "string",
                        "description": "Search interventions, drugs, devices, procedures, or biologics."
                    },
                    "sponsor": {
                        "title": "Sponsor",
                        "type": "string",
                        "description": "Search study sponsors and collaborators."
                    },
                    "location": {
                        "title": "Location",
                        "type": "string",
                        "description": "Search trial locations by city, state, country, or facility."
                    },
                    "status": {
                        "title": "Recruitment status",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Filter by ClinicalTrials.gov overall status. Multiple values are combined with OR.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "NOT_YET_RECRUITING",
                                "RECRUITING",
                                "ENROLLING_BY_INVITATION",
                                "ACTIVE_NOT_RECRUITING",
                                "SUSPENDED",
                                "TERMINATED",
                                "COMPLETED",
                                "WITHDRAWN",
                                "UNKNOWN"
                            ],
                            "enumTitles": [
                                "Not yet recruiting",
                                "Recruiting",
                                "Enrolling by invitation",
                                "Active, not recruiting",
                                "Suspended",
                                "Terminated",
                                "Completed",
                                "Withdrawn",
                                "Unknown"
                            ]
                        }
                    },
                    "phase": {
                        "title": "Phase",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Filter by study phase using the current ClinicalTrials.gov advanced AREA[Phase] query.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "NA",
                                "EARLY_PHASE1",
                                "PHASE1",
                                "PHASE2",
                                "PHASE3",
                                "PHASE4"
                            ],
                            "enumTitles": [
                                "Not applicable",
                                "Early phase 1",
                                "Phase 1",
                                "Phase 2",
                                "Phase 3",
                                "Phase 4"
                            ]
                        }
                    },
                    "nctIds": {
                        "title": "NCT IDs",
                        "type": "array",
                        "description": "Specific ClinicalTrials.gov identifiers, e.g. NCT01884792. Multiple IDs are combined with OR.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "updatedSince": {
                        "title": "Updated since",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                        "type": "string",
                        "description": "Return studies with LastUpdatePostDate on or after this YYYY-MM-DD date."
                    },
                    "outputFields": {
                        "title": "Output fields",
                        "enum": [
                            "summary",
                            "full"
                        ],
                        "type": "string",
                        "description": "Use summary for compact normalized records, or full to include raw protocol, derived, and results sections.",
                        "default": "summary"
                    },
                    "chunking": {
                        "title": "Text chunking",
                        "enum": [
                            "paragraph",
                            "none"
                        ],
                        "type": "string",
                        "description": "Create paragraph-sized text chunks from title, summary, eligibility, and outcomes for RAG workflows.",
                        "default": "paragraph"
                    },
                    "maxItems": {
                        "title": "Max items",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of items to extract and save. Each saved item is charged as one event.",
                        "default": 10
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
