# ClinicalTrials.gov Studies Search (Official API v2) (`jayraj0975/clinicaltrials-search`) Actor

Search ClinicalTrials.gov studies via the official API v2 and return flat clean records: nctId, title, status, phase, conditions, interventions, sponsor, enrollment, dates, locations, and URL. Pay-per-result.

- **URL**: https://apify.com/jayraj0975/clinicaltrials-search.md
- **Developed by:** [Jay Gaikwad](https://apify.com/jayraj0975) (community)
- **Categories:** Other, Agents
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 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.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## ClinicalTrials.gov Studies Search (public data, unofficial)

Search ClinicalTrials.gov studies via the public API v2 and return flat, clean records suitable for
analytics and enrichment.

### What it does

- Calls the public ClinicalTrials.gov API v2 (`https://clinicaltrials.gov/api/v2/studies`) — no API key, no login.

> Unofficial Actor. Not affiliated with, endorsed by, or supported by the U.S. National Library of Medicine or ClinicalTrials.gov. Reads the public ClinicalTrials.gov API v2 only; no login, no personal data collected.

- Supports free-text search (`query`), condition filter (`condition`), overall status (`status`) and phase (`phase`).
- Paginates with `nextPageToken` until `maxItems` records are collected.
- Emits one flat record per study: `nctId`, `title`, `status`, `phase`, `conditions`, `interventions`, `sponsor`,
  `enrollment`, `startDate`, `startDateIso`, `completionDate`, `completionDateIso`, `locationsCount`, `countries`,
  `url`, `scrapedAt`.
- Rate-limited to 1 request per second.
- Fails with a clear error if the API response layout changes; pushes invalid-input or not-found rows rather than malformed items (see Pricing — those rows are billed).

### Input

| Field      | Type    | Description                                                                  |
|------------|---------|------------------------------------------------------------------------------|
| `query`    | string  | Free-text search term (`query.term`), e.g. `diabetes`.                       |
| `condition`| string  | Disease / condition filter (`query.cond`), e.g. `breast cancer`.             |
| `status`   | string  | Overall status filter, e.g. `RECRUITING`, `COMPLETED`. Optional.             |
| `phase`    | string  | Phase filter, e.g. `PHASE1`, `PHASE2`, `PHASE3`, `PHASE4`. Optional.         |
| `maxItems` | integer | Maximum records to return (1–1000, default 100).                              |

### Example output (illustrative — your results will differ)

Example record (illustrative; values vary)

```json
{
  "nctId": "NCT00487240",
  "title": "Comparison of Two Basal Insulin Therapies for Patients With Type 1 Diabetes",
  "status": "COMPLETED",
  "phase": "PHASE3",
  "conditions": ["Diabetes Mellitus, Type 1"],
  "interventions": ["Insulin Lispro Protamine Suspension", "Insulin Levemir"],
  "sponsor": "Eli Lilly and Company",
  "enrollment": 387,
  "startDate": "2007-06",
  "startDateIso": null,
  "completionDate": "2008-08",
  "completionDateIso": null,
  "locationsCount": 25,
  "countries": ["United States", "Canada"],
  "url": "https://clinicaltrials.gov/study/NCT00487240",
  "scrapedAt": "2026-11-12T10:00:00Z"
}
```

### Pricing

$3 per 1,000 results.

Every dataset item pushed = one billed result. You are charged $3 per 1,000 rows actually returned via Apify's default dataset-item push event; no charge for empty runs or errors.

This includes not-found and invalid-input rows: if the Actor pushes a row recording that a study was not found or that an input was invalid, that row is one billed result. Rows are only pushed when there is something to record; empty runs produce no rows and are not billed.

### Limits

- `maxItems` is capped at 1,000 per run.
- One HTTP request per second.
- Dates are partial in the source (`YYYY-MM` or `YYYY-MM-DD`); we keep the source string and add an ISO timestamp
  (`startDateIso` / `completionDateIso`) only when a full `YYYY-MM-DD` date is present.

Sample above uses a study whose dates are only YYYY-MM in the source, so the ISO fields are null by design. When the API returns a full YYYY-MM-DD date, the corresponding \*Iso field is populated.

- Data source terms: this Actor reads the public ClinicalTrials.gov API v2. Review the current ClinicalTrials.gov terms of service and API usage policies before commercial redistribution of the data. Terms and access conditions may change; check them yourself and do not rely on this README as a statement of current terms.

### Disclaimer

This Actor is unofficial and uses the public ClinicalTrials.gov API. It is not affiliated with, endorsed by, or supported by the U.S. National Library of Medicine or ClinicalTrials.gov. It reads public data only — no login, no personal data, no CAPTCHA solving. Data comes from ClinicalTrials.gov; it is not medical advice and no guarantees are made about accuracy, completeness, or availability. If the upstream layout changes, the Actor will fail with a clear error.

Provided "as is", without warranty of any kind, express or implied, including merchantability or fitness for a particular purpose. Not medical advice; do not use for clinical decision-making.

# Actor input Schema

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

Free-text search term (query.term), e.g. 'diabetes', 'immunotherapy', 'NCT00487240'.

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

Disease or condition filter (query.cond), e.g. 'breast cancer', 'type 1 diabetes'.

## `status` (type: `string`):

Optional filter for study overall status.

## `phase` (type: `string`):

Optional study phase filter.

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

Maximum number of study records to return.

## Actor input object example

```json
{
  "maxItems": 100
}
```

# Actor output Schema

## `results` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("jayraj0975/clinicaltrials-search").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

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

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

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

```

## CLI example

```bash
echo '{}' |
apify call jayraj0975/clinicaltrials-search --silent --output-dataset

```

## MCP server setup

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

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

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