# ClinicalTrials.gov API & Scraper – Trials by Sponsor, Phase (`opentenders/clinicaltrials-scraper`) Actor

ClinicalTrials.gov API scraper (v2): clinical trials by condition, intervention, sponsor, location, status, phase and update date. Flat rows with sponsor, enrollment, dates, eligibility, sites and data date. Pharma pipeline monitoring. From $3 per 1,000. Source: ClinicalTrials.gov (U.S. NLM).

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

## Pricing

$3.00 / 1,000 study founds

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 API & Scraper – Clinical Trials by Condition, Sponsor, Phase and Update Date

A **clinical trials API** for the **ClinicalTrials.gov registry** (500,000+ studies worldwide), built on its official **API v2**, for searching trials and tracking pharma pipelines. One flat row per trial: status, phase, study type, conditions, interventions, lead sponsor and class, collaborators, enrollment, design, start and completion dates, first-posted and last-updated dates, results flag, eligibility (sex, age, healthy volunteers, criteria text), site locations by facility, city and country, and the study URL.

Built for **pharma and biotech competitive intelligence, CROs and clinical operations, market researchers, investors following pipelines, patient advocacy groups and data journalists** who need a condition, a sponsor or a therapeutic area watched every day.

### Why this one

- **Official API v2, no key, no login.** One request returns up to 1,000 studies. Runs take seconds.
- **Daily monitoring built in.** `updatedAfter` (last-update date) and `firstPostedAfter` (new registrations) use the registry's own dates. A daily schedule with "yesterday" returns only what changed.
- **Honest to the terms of use.** Each row carries `source` (ClinicalTrials.gov) and `dataProcessedAt`, the date ClinicalTrials.gov processed the data, as its terms require. See *Data source and attribution* below. Names, phones and e-mails of investigators and contacts are deliberately left out; you get organizations, facilities and places.
- **Pay per study, from the first row.** No 100-row cap for free accounts, no start fee, no charge for empty runs or error rows.

### Pricing

**$3.00 per 1,000 studies** (event `study`). That is 1,000 fully flattened trials for the price of a coffee; comparable actors charge $8–12 per 1,000. Apify's free plan ($5 monthly credit) covers about 1,600 studies per month. Cap spend with `maxItems` and the run's *Maximum total charge*.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `condition` | string | | Condition or disease (`query.cond`), e.g. `diabetes`, `breast cancer`. |
| `intervention` | string | | Drug, device or procedure (`query.intr`), e.g. `semaglutide`. |
| `term` | string | | Free text over the whole record (`query.term`). |
| `sponsor` | string | | Sponsor or collaborator name (`query.spons`), e.g. `Pfizer`. |
| `location` | string | | City, state or country of sites (`query.locn`). |
| `status` | array | `[]` | `RECRUITING`, `NOT_YET_RECRUITING`, `ACTIVE_NOT_RECRUITING`, `COMPLETED`, `TERMINATED`, … Empty = any. |
| `phase` | array | `[]` | `EARLY_PHASE1`, `PHASE1`, `PHASE2`, `PHASE3`, `PHASE4`, `NA`. |
| `studyType` | string | any | `INTERVENTIONAL`, `OBSERVATIONAL`, `EXPANDED_ACCESS`. |
| `updatedAfter` | string | | `YYYY-MM-DD`. Records last updated on or after this date. |
| `firstPostedAfter` | string | | `YYYY-MM-DD`. Records first posted on or after this date. |
| `sort` | string | `LastUpdatePostDate:desc` | Or `StudyFirstPostDate:desc`, `relevance`. |
| `maxItems` | integer | `100` | Stop after this many studies. |
| `minResults` | integer | | Monitoring only: fail the run if fewer studies are returned. |

At least one filter is required (the whole registry is not a query).

Competitor pipeline watch, Phase 3 trials by one sponsor changed since yesterday:

```json
{ "sponsor": "Novo Nordisk", "phase": ["PHASE3"], "updatedAfter": "2026-10-25", "maxItems": 500 }
```

Recruiting trials for a condition in one country:

```json
{ "condition": "alzheimer", "status": ["RECRUITING", "NOT_YET_RECRUITING"], "location": "Germany", "maxItems": 1000 }
```

### Output

```json
{
    "nctId": "NCT07573462",
    "url": "https://clinicaltrials.gov/study/NCT07573462",
    "title": "A Study to Learn About the Safety of an Expanded Pneumococcal Vaccine",
    "officialTitle": "A PHASE 3, RANDOMIZED, DOUBLE-BLINDED TRIAL TO EVALUATE ...",
    "acronym": null,
    "organization": "Pfizer",
    "status": "RECRUITING",
    "statusVerifiedDate": "2026-10",
    "studyType": "INTERVENTIONAL",
    "phases": ["PHASE3"],
    "conditions": ["Pneumococcal Disease"],
    "keywords": [],
    "interventions": [{ "type": "BIOLOGICAL", "name": "PG4" }],
    "leadSponsor": "Pfizer",
    "leadSponsorClass": "INDUSTRY",
    "collaborators": [],
    "enrollment": 2400,
    "enrollmentType": "ESTIMATED",
    "allocation": "RANDOMIZED",
    "masking": "QUADRUPLE",
    "primaryPurpose": "PREVENTION",
    "startDate": "2026-05-04",
    "primaryCompletionDate": "2028-12-30",
    "completionDate": "2028-12-30",
    "firstPosted": "2026-05-07",
    "lastUpdatePosted": "2026-10-26",
    "resultsFirstPosted": null,
    "hasResults": false,
    "sex": "ALL",
    "minimumAge": "42 Days",
    "maximumAge": "98 Days",
    "stdAges": ["CHILD"],
    "healthyVolunteers": true,
    "eligibilityCriteria": "Inclusion Criteria: ...",
    "briefSummary": "The purpose of this study is ...",
    "locationsCount": 78,
    "countries": ["United States", "Argentina", "Australia", "Canada"],
    "locations": [{ "facility": "Clinical Research Site", "city": "Buenos Aires", "state": null, "country": "Argentina", "status": "RECRUITING" }],
    "dataProcessedAt": "2026-10-26T09:00:04",
    "dataProcessedAtSource": "ClinicalTrials.gov API dataTimestamp",
    "source": "ClinicalTrials.gov",
    "scrapedAt": "2026-10-26T13:49:53.496Z"
}
```

Dates are as published (some are month-only, e.g. `2026-10`). Missing data is `null`, never invented. A run with no match writes one `{ "error": true, "errorType": "NO_RESULTS", ... }` row; invalid input writes an `INVALID_INPUT` row. Neither is charged.

### Data source and attribution

**Source: ClinicalTrials.gov**, a database of the U.S. National Library of Medicine (National Institutes of Health). Data obtained through the ClinicalTrials.gov API v2. This Actor is not affiliated with or endorsed by NLM, NIH or HHS, and ClinicalTrials.gov makes no warranties about the data.

**Date processed by ClinicalTrials.gov:** every row includes `dataProcessedAt`, taken from the `dataTimestamp` the API publishes at run time (the registry is refreshed on business days). If the API ever omits it, the field holds the collection time and `dataProcessedAtSource` says so. Re-run the Actor to keep your copy current.

**Modifications made to the data:**

- Each study record is flattened into one row; nested modules are reduced to the fields listed in *Output*.
- Central contacts, overall officials and the responsible party (names, phones, e-mails of people) are removed.
- Outcome measures, adverse events and other results sections are not included; `hasResults` and `resultsFirstPosted` indicate they exist.
- Site locations keep facility, city, state, country and recruitment status; geocoordinates and site contacts are removed.
- Text fields (summary, eligibility criteria) and dates are passed through as published, without editing.

If you publish or redistribute this data, attribute it to ClinicalTrials.gov, show `dataProcessedAt`, and state these modifications.

### Use it from code

```bash
curl -X POST "https://api.apify.com/v2/acts/opentenders~clinicaltrials-scraper/run-sync-get-dataset-items?format=json" \
  -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"condition":"melanoma","status":["RECRUITING"],"phase":["PHASE2","PHASE3"],"maxItems":200}'
```

Works with the Apify API, clients, MCP server, Make, Zapier, n8n and Google Sheets integrations.

### Limitations

- Data is what sponsors register. Enrollment, dates and sites can be outdated or missing; `dataProcessedAt` tells you the registry snapshot.
- Investigator and contact details are intentionally not returned.
- Requests are made one at a time to respect the registry (1,000 studies per request, so 10,000 studies take about 15 seconds).
- Results data (outcome measures, adverse events) are not included; `hasResults` and `resultsFirstPosted` tell you when they exist.

### FAQ

**Is this allowed?** Yes. ClinicalTrials.gov data is available to all requesters at no charge through its public API. Its terms ask for attribution, the processing date and a statement of modifications; see *Data source and attribution*.

**How do I get only new trials?** Use `firstPostedAfter` for brand-new registrations and `updatedAfter` for any change (status, enrollment, sites). Schedule daily with yesterday's date.

**Can I search by NCT ID?** Put the IDs in `term`, e.g. `NCT07573462 OR NCT06704672`.

**Something broke?** Open an issue with the run ID; the actor fails with the exact API response when ClinicalTrials.gov changes.

# Actor input Schema

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

Condition search (ClinicalTrials.gov <code>query.cond</code>), e.g. <code>diabetes</code>, <code>breast cancer</code>, <code>alzheimer</code>.

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

Drug, device or procedure (<code>query.intr</code>), e.g. <code>semaglutide</code>, <code>CAR-T</code>.

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

Free-text search over the whole record (<code>query.term</code>), e.g. <code>biomarker</code>.

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

Sponsor name (<code>query.spons</code>), e.g. <code>Pfizer</code>, <code>National Cancer Institute</code>.

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

City, state or country of study sites (<code>query.locn</code>), e.g. <code>Boston</code>, <code>Germany</code>.

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

Overall status. Empty = any.

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

Empty = any phase.

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

Empty = any.

## `updatedAfter` (type: `string`):

Only studies whose record was last updated on or after this date. Set it to yesterday in a daily schedule to get only new and changed trials.

## `firstPostedAfter` (type: `string`):

Only studies first posted on or after this date (brand-new registrations).

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

Order of results. Most recently updated first is the default and pairs with updatedAfter for daily monitoring.

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

Stop after this many studies. Caps your cost.

## `minResults` (type: `integer`):

Optional. Fail the run if fewer studies are returned.

## Actor input object example

```json
{
  "condition": "diabetes",
  "status": [
    "RECRUITING"
  ],
  "phase": [],
  "studyType": "",
  "sort": "LastUpdatePostDate:desc",
  "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 = {
    "condition": "diabetes",
    "status": [
        "RECRUITING"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("opentenders/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 = {
    "condition": "diabetes",
    "status": ["RECRUITING"],
}

# Run the Actor and wait for it to finish
run = client.actor("opentenders/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 '{
  "condition": "diabetes",
  "status": [
    "RECRUITING"
  ]
}' |
apify call opentenders/clinicaltrials-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,opentenders/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/sVrYZX6ANft9ibQ6Y/builds/cpVDq6gf1pzgfyTie/openapi.json
