# ClinicalTrials.gov Trials Data - Sponsors, Phases & Sites (`jpopendata/us-clinical-trials`) Actor

Clinical trials from the official ClinicalTrials.gov API v2 as flat rows, one per trial or per site: NCT number, titles, status, phase, conditions, drugs, sponsor, enrollment, dates, countries, results. Pharma pipeline filters. No investigator names or contacts. Unofficial; not affiliated with NLM.

- **URL**: https://apify.com/jpopendata/us-clinical-trials.md
- **Developed by:** [JP Open Data](https://apify.com/jpopendata) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.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.

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 Trials Data - Sponsors, Phases & Sites

**Clinical trials from the official ClinicalTrials.gov API v2 as one flat row per trial (or one row per trial site): NCT number, titles, status, phase, study type, conditions, drugs and other interventions, sponsor and collaborators, enrollment, start and completion dates, countries, results flag and primary outcome names.**

ClinicalTrials.gov, run by the U.S. National Library of Medicine (NLM), lists more than 600,000 studies from over 200 countries. This Actor reads its official REST API (v2) and returns each study as one flat row that opens cleanly in Excel, Google Sheets or a database. Lists such as conditions or interventions are joined with `|` instead of nested arrays. You can filter in ways that suit pipeline and competitor research: condition, drug, sponsor, sponsor type (industry, NIH, academic...), phase, status, intervention type, country or region, results posted, and start, primary completion, first posted or last update dates. A site mode returns one row per trial site.

> **Unofficial tool. Not affiliated with or endorsed by the U.S. National Library of Medicine, NIH, HHS or ClinicalTrials.gov.** Data from ClinicalTrials.gov. Every row says when ClinicalTrials.gov processed the data and what this Actor changed (see [Attribution and terms](#attribution-and-terms)). No investigator or contact names, e-mail addresses or phone numbers are returned.

### Quick start — verified input

Run on 2026-10-13 on the Apify platform: 25 rows, 2 requests, a few seconds. An empty input `{}` runs exactly this: the 25 most recently updated studies.

```json
{
  "maxItems": 25
}
```

Industry-sponsored phase 3 trials in non-small cell lung cancer that are recruiting or about to recruit:

```json
{
  "conditions": ["non-small cell lung cancer"],
  "phases": ["Phase 3"],
  "statuses": ["open"],
  "leadSponsorClasses": ["industry"],
  "maxItems": 200
}
```

Trial sites in Japan for recruiting phase 3 breast cancer trials (one row per site):

```json
{
  "outputMode": "sites",
  "conditions": ["breast cancer"],
  "phases": ["3"],
  "statuses": ["recruiting"],
  "countries": ["Japan"],
  "maxItems": 500
}
```

More examples:

- Upcoming readouts for a drug: `{"interventions": ["semaglutide"], "primaryCompletionFrom": "2026-01-01", "primaryCompletionTo": "2026-12-31", "sortBy": "primaryCompletion", "sortOrder": "asc", "maxItems": 100}`
- Weekly monitor of one sponsor: `{"sponsors": ["Pfizer"], "leadSponsorOnly": true, "updatedFrom": "7 days ago", "maxItems": 1000}`
- New EU registrations of drug and biologic trials: `{"countries": ["EU"], "interventionTypes": ["drug", "biological"], "firstPostedFrom": "30 days ago", "maxItems": 1000}`
- Specific trials: `{"nctIds": ["NCT04368728", "NCT02993146"]}`

#### Common input mistakes

| Wrong | Right | Why |
|---|---|---|
| `"countries": ["Boston"]` | `"locations": ["Boston"]` | Countries are countries or regions; cities, states and facility names go in `locations`. |
| `"statuses": ["active"]` to get ongoing trials | `"statuses": ["ongoing"]` | `active` means "Active, not recruiting". `ongoing` = recruiting + not yet recruiting + enrolling by invitation + active, not recruiting. |
| `"startDateFrom": "06/15/2024"` | `"startDateFrom": "2024-06-15"` | Slash dates are ambiguous and rejected. YYYY-MM-DD, YYYY-MM, YYYY, `today` and `30 days ago` work. |
| `"conditions": "breast cancer, lung cancer"` (one text via the API) | `"conditions": ["breast cancer", "lung cancer"]` | A single text is split at line breaks and semicolons, not commas, because names such as "Carcinoma, Non-Small-Cell Lung" contain commas. |
| `"phases": ["3"], "studyTypes": ["observational"]` | drop one of them | Observational studies have no phase, so this returns 0 rows. |
| `"nctIds": ["NCT123"]` | `"nctIds": ["NCT00000123"]` | An NCT number is NCT + 8 digits. Study URLs also work. |

An invalid value stops the run before any request, with a message that names the field and lists the valid values. Plain words are accepted for most lists: `"Phase III"`, `"recruiting"`, `"pharma"`, `"vaccine"`, `"US"`, `"South Korea"`, `"EU"`.

#### Empty results?

The run ends successfully with 0 rows when nothing matches. Typical causes: a misspelt condition or drug name, a date window with no studies, a phase filter together with observational studies, or a country filter combined with a rare condition. Check `RUN_SUMMARY` in the key-value store: it shows the exact API query (`queryUrls`) and how many studies matched (`totalMatchingStudies`).

### What one row contains

**Trial rows** (`outputMode: "trials"`, the default): `nctId`, `url`, `briefTitle`, `officialTitle`, `acronym`, `sponsorProtocolId`, `sponsorProtocolIdWithheld`, `overallStatus`, `phase` (label such as "Phase 2/3"), `phases` (codes), `studyType`, `conditions`, `interventionNames`, `interventionTypes`, `interventionOtherNames` (brand and code names), `leadSponsor`, `leadSponsorClass`, `leadSponsorWithheld`, `collaborators`, `collaboratorsWithheld`, `enrollment`, `enrollmentType` (ACTUAL or ESTIMATED), `startDate`, `startDateType`, `primaryCompletionDate`, `primaryCompletionDateType`, `completionDate`, `completionDateType`, `firstPostedDate`, `lastUpdatePostedDate`, `statusVerifiedDate`, `hasResults`, `resultsFirstPostedDate`, `primaryOutcomes` (names of the primary outcome measures), `locationCountries`, `locationCount`, `ctgovDataTimestamp`.

**Site rows** (`outputMode: "sites"`): `nctId`, `url`, `briefTitle`, `acronym`, `overallStatus`, `phase`, `studyType`, `conditions`, `interventionNames`, `leadSponsor`, `leadSponsorClass`, `leadSponsorWithheld`, `siteNumber`, `siteCount`, `facility`, `facilityWithheld`, `city`, `state`, `country`, `siteStatus`, `ctgovDataTimestamp`.

Every row also has `recordType` (`trial` or `site`), `source`, `sourceUrl`, `license` and `retrievedAt`.

#### Output example (trial row)

```json
{
  "recordType": "trial",
  "nctId": "NCT07060807",
  "url": "https://clinicaltrials.gov/study/NCT07060807",
  "briefTitle": "A Clinical Study of Patritumab Deruxtecan to Treat Breast Cancer (MK-1022-016)",
  "officialTitle": "An Open-label, Randomized, Phase 3 Study to Evaluate Patritumab Deruxtecan Monotherapy Versus Treatment of Physician's Choice in Hormone Receptor-positive, HER2-negative Unresectable Locally Advanced or Metastatic Breast Cancer (HERTHENA-Breast04).",
  "acronym": null,
  "sponsorProtocolId": "1022-016",
  "sponsorProtocolIdWithheld": false,
  "overallStatus": "RECRUITING",
  "phase": "Phase 3",
  "phases": "PHASE3",
  "studyType": "INTERVENTIONAL",
  "conditions": "Breast Neoplasms",
  "interventionNames": "Patritumab deruxtecan | Paclitaxel | Nab-paclitaxel | Capecitabine | Pegylated liposomal doxorubicin | Trastuzumab deruxtecan | Rescue Medication",
  "interventionTypes": "BIOLOGICAL | DRUG",
  "interventionOtherNames": "MK-1022 | HER3-DXd | U3-1402 | TAXOL® | ONXAL® | Abraxane® | XELODA® | Doxil® | T-DXd | Enhertu®",
  "leadSponsor": "Merck Sharp & Dohme LLC",
  "leadSponsorClass": "INDUSTRY",
  "leadSponsorWithheld": false,
  "collaborators": "Daiichi Sankyo",
  "collaboratorsWithheld": 0,
  "enrollment": 1000,
  "enrollmentType": "ESTIMATED",
  "startDate": "2025-07-21",
  "startDateType": "ACTUAL",
  "primaryCompletionDate": "2033-07-14",
  "primaryCompletionDateType": "ESTIMATED",
  "completionDate": "2033-07-14",
  "completionDateType": "ESTIMATED",
  "firstPostedDate": "2025-07-11",
  "lastUpdatePostedDate": "2026-10-08",
  "statusVerifiedDate": "2026-10",
  "hasResults": false,
  "resultsFirstPostedDate": null,
  "primaryOutcomes": "Progression Free Survival (PFS) | Overall Survival (OS)",
  "locationCountries": "United States | Argentina | Australia | Brazil | Canada | Chile | China | Colombia | France | Germany | Greece | Hong Kong | Hungary | Israel | Italy | Japan | Mexico | Peru | Poland | South Korea | Spain | Taiwan | Thailand | Turkey (Türkiye) | United Kingdom | Vietnam",
  "locationCount": 201,
  "ctgovDataTimestamp": "2026-10-09T09:00:05",
  "source": "ClinicalTrials.gov (U.S. National Library of Medicine, NIH)",
  "sourceUrl": "https://clinicaltrials.gov/",
  "license": "Source: ClinicalTrials.gov, a U.S. Government database of the National Library of Medicine (NIH). Data processed by ClinicalTrials.gov on 2026-10-09T09:00:05 (API dataTimestamp). Modifications by this Actor: … (full text below)",
  "retrievedAt": "2026-10-12T21:04:20.000Z"
}
```

#### Output example (site row)

```json
{
  "recordType": "site",
  "nctId": "NCT07060807",
  "url": "https://clinicaltrials.gov/study/NCT07060807",
  "briefTitle": "A Clinical Study of Patritumab Deruxtecan to Treat Breast Cancer (MK-1022-016)",
  "acronym": null,
  "overallStatus": "RECRUITING",
  "phase": "Phase 3",
  "studyType": "INTERVENTIONAL",
  "conditions": "Breast Neoplasms",
  "interventionNames": "Patritumab deruxtecan | Paclitaxel | Nab-paclitaxel | Capecitabine | Pegylated liposomal doxorubicin | Trastuzumab deruxtecan | Rescue Medication",
  "leadSponsor": "Merck Sharp & Dohme LLC",
  "leadSponsorClass": "INDUSTRY",
  "leadSponsorWithheld": false,
  "siteNumber": 125,
  "siteCount": 201,
  "facility": "Aichi Cancer Center ( Site 3200)",
  "facilityWithheld": false,
  "city": "Nagoya",
  "state": "Aichi-ken",
  "country": "Japan",
  "siteStatus": "RECRUITING",
  "ctgovDataTimestamp": "2026-10-09T09:00:05",
  "source": "ClinicalTrials.gov (U.S. National Library of Medicine, NIH)",
  "sourceUrl": "https://clinicaltrials.gov/",
  "license": "Source: ClinicalTrials.gov, … (same text as above)",
  "retrievedAt": "2026-10-12T21:04:20.000Z"
}
```

### How the filters work

- Within one list a study matches **any** entry. Different fields are combined with **and**.
- `conditions`, `interventions`, `sponsors`, `keywords` and `locations` use the same search as the ClinicalTrials.gov website, including its synonyms. Each entry can also be a ClinicalTrials.gov search expression (quotes, AND/OR/NOT, `AREA[...]`).
- `phases`: a study matches if **any** of its phases is listed, so a Phase 2/3 study matches `PHASE3`.
- `countries`: exact ClinicalTrials.gov country names (for example `South Korea`, `Turkey (Türkiye)`, `Côte d’Ivoire`; ISO codes and common names are converted). A study matches if at least one of its sites is in one of the countries. Regions: Europe, European Union, Asia, Africa, North America, Latin America and the Caribbean, South America, Oceania (UN M49 continents; Europe also lists Cyprus) and Middle East. In site mode only the sites in the selected countries are returned.
- Dates: estimated (planned) dates count as well as actual ones. A month or a year means the whole month or year.
- `advancedFilter` adds your own ClinicalTrials.gov search expression with AND, for example `AREA[DesignAllocation]RANDOMIZED`. [Syntax](https://clinicaltrials.gov/find-studies/constructing-complex-search-queries).

### Attribution and terms

The [ClinicalTrials.gov Terms and Conditions](https://clinicaltrials.gov/about-site/terms-conditions) ask everyone who publishes or distributes ClinicalTrials.gov data to: attribute the source of the data as ClinicalTrials.gov; update the data so that they are current at all times; clearly display the date the data were processed by ClinicalTrials.gov; and state any modifications made to the content, with a complete description of the modifications.

This Actor supports this on every row:

- `ctgovDataTimestamp` is the date ClinicalTrials.gov processed the data (the `dataTimestamp` of the API's `/api/v2/version`). The same date is in `license`.
- `license` names the source, gives that date, the complete list of modifications below, the terms link and the disclaimer.
- Complete description of the modifications made by this Actor:

> Modifications by this Actor: selected fields of each study record are rearranged into one flat row per study (or one row per study site); lists are joined with " | " and duplicates removed; added fields: url, phase (a label such as "Phase 2/3"), locationCountries, locationCount, siteNumber, siteCount, ctgovDataTimestamp; investigator and contact names, e-mail addresses and phone numbers are not included; sponsor, collaborator and site names that are or may be a person's name are replaced by null (marked by the \*Withheld fields): a sponsor or collaborator registered as an individual; a name with a personal title or degree, unless it also names a hospital, university or similar institution (for sponsors classed INDUSTRY, NIH, FED, OTHER_GOV or NETWORK: any organisation); a name without a word that marks an organisation (not applied to those five sponsor classes); for the other sponsor classes, a protocol number that contains words instead of a code is replaced by null (sponsorProtocolIdWithheld); free-text descriptions, eligibility criteria and results data are not included; site addresses are limited to city, state and country; in site rows with a countries filter, sites in other countries are left out. All other values are as published by ClinicalTrials.gov.

Keeping the data current is up to you: re-run before you publish. ClinicalTrials.gov refreshes its data Monday to Friday, generally by 9 a.m. ET. The terms also say: you shall not assert proprietary rights to the data or present it as anything other than a U.S. Government database; you shall not use e-mail addresses from the database for marketing (this Actor returns none); outside the United States the data carry an international copyright, and some data may be subject to third-party copyright. The U.S. Government makes no warranties about the data. The terms apply for as long as you keep the data.

### Privacy and GDPR

- No names, e-mail addresses or phone numbers of investigators, study contacts or site contacts. The Actor never even requests those fields from the API.
- Sponsor, collaborator and site names are shown only when they are recognisably an organisation. They are returned as `null`, with `leadSponsorWithheld`, `collaboratorsWithheld` or `facilityWithheld` set, when the name is registered as an individual (class `INDIV`), carries a personal title or degree ("Dr.", "Prof.", "MD", "PhD" ...), or contains no word that marks an organisation (such as University, Hospital, Clinic, Institute, Center, Foundation, Group, Society, Ministry, Inc, Ltd, GmbH, and the same words in other languages). A plain personal name, such as a doctor registered as the sponsor of their own study, is therefore not shown. Institutions named after a person, such as "MD Anderson Cancer Center", are kept. The organisation-word test is not applied to sponsors that ClinicalTrials.gov itself classes as INDUSTRY, NIH, FED, OTHER_GOV or NETWORK.
- The rule is deliberately cautious: a few real organisations whose names contain none of these words (for example a hospital listed only by a brand name) are withheld too. In our checks on about 5,900 real site names, fewer than 1 in 100 was withheld. In a sample of 1,000 recently updated trials, 28 of the 31 withheld sponsor and collaborator names were individual people.
- For sponsors outside those five classes, `sponsorProtocolId` (the sponsor's own protocol number) is returned as `null` with `sponsorProtocolIdWithheld: true` when it contains words instead of a code (three or more lowercase letters in a row), because academic protocol numbers sometimes include the investigator's name.
- Site addresses stop at city, state and country (no street, ZIP code or coordinates).
- Public data only. You are responsible for complying with the ClinicalTrials.gov Terms and Conditions and with applicable law, including the GDPR, when you use the data.

### How it reads the API

- Only the documented ClinicalTrials.gov API v2 endpoints `/api/v2/studies` and `/api/v2/version` are used. The website's search pages and internal endpoints are never called.
- One request at a time, at least 1.5 seconds apart. `Retry-After` is respected, server errors are retried with a growing wait, and `maxApiRequests` is a hard budget.
- The first page asks for the total number of matching studies, and the next pages follow the API's `nextPageToken`. The log and `RUN_SUMMARY` always say "N of M": nothing is cut off silently. If the run stops early (budget, time limit, an API error), the rows read so far are kept and `RUN_SUMMARY.complete` is `false` with a `stopReason`.
- One request returns up to 1,000 trials in trial mode and up to 100 trials (all their sites) in site mode.
- `RUN_SUMMARY` (key-value store) also lists `notReturnedNctIds` (NCT numbers you asked for that are unknown or excluded by the other filters) and how many names and protocol numbers were withheld.

### Limits

- `maxItems` up to 200,000 rows per run; `maxApiRequests` up to 1,000.
- A large trial can list hundreds of sites, so site mode produces many rows per trial.
- Data are as current as ClinicalTrials.gov's last weekday refresh (shown in `ctgovDataTimestamp`).

### Disclaimer

Unofficial tool. Not affiliated with or endorsed by the U.S. National Library of Medicine, the National Institutes of Health, the U.S. Department of Health and Human Services or ClinicalTrials.gov. The study information is provided by study sponsors and investigators; the U.S. Government does not review or approve the safety and science of all studies listed on ClinicalTrials.gov. This dataset is not medical advice.

# Actor input Schema

## `outputMode` (type: `string`):

trials = one row per study. sites = one row per study site (facility name, city, state, country and recruitment status of the site, plus the main study fields); with a countries filter only the sites in those countries are returned. You are charged per row, and a large trial can list hundreds of sites.

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

Optional. Disease or condition, as on the ClinicalTrials.gov search form (synonyms included), e.g. "breast cancer", "non-small cell lung cancer", "type 2 diabetes". A study matches ANY entry.

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

Optional. Drug, biologic, device or other intervention name (generic, brand or code names), e.g. "pembrolizumab", "Keytruda", "semaglutide". A study matches ANY entry.

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

Optional. Sponsor or collaborator organisation, e.g. "Pfizer", "Merck Sharp & Dohme LLC", "National Cancer Institute (NCI)". A study matches ANY entry. Searches lead sponsors and collaborators unless 'Lead sponsor only' is on.

## `leadSponsorOnly` (type: `boolean`):

Match Sponsors against the lead sponsor only (not collaborators).

## `keywords` (type: `array`):

Optional. Words searched across the whole study record, e.g. "CAR-T", "biosimilar", "decentralized". A study matches ANY entry.

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

Optional. Fetch these studies, e.g. "NCT04368728" (up to 1,000; study URLs also work). Other filters still apply. NCT numbers that are not returned are listed in RUN_SUMMARY.

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

Optional. RECRUITING, NOT_YET_RECRUITING, ENROLLING_BY_INVITATION, ACTIVE_NOT_RECRUITING, COMPLETED, SUSPENDED, TERMINATED, WITHDRAWN, UNKNOWN (and the expanded-access statuses AVAILABLE, NO_LONGER_AVAILABLE, TEMPORARILY_NOT_AVAILABLE, APPROVED_FOR_MARKETING, WITHHELD). Plain words work ("recruiting", "Active, not recruiting"), as do groups: open (recruiting + not yet recruiting), ongoing, stopped. Empty = all.

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

Optional. EARLY_PHASE1, PHASE1, PHASE2, PHASE3, PHASE4 or NA; "Phase 3", "III", "3" and "1/2" also work. A study matches if ANY of its phases is listed (a Phase 2/3 study matches PHASE3). Observational studies have no phase.

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

Optional. INTERVENTIONAL (clinical trials), OBSERVATIONAL, EXPANDED_ACCESS. Empty = all.

## `interventionTypes` (type: `array`):

Optional. DRUG, BIOLOGICAL, DEVICE, PROCEDURE, RADIATION, BEHAVIORAL, GENETIC, DIETARY_SUPPLEMENT, COMBINATION_PRODUCT, DIAGNOSTIC_TEST, OTHER ("drug", "vaccine" and "biologic" also work).

## `leadSponsorClasses` (type: `array`):

Optional. INDUSTRY ("pharma" also works), NIH, FED (other U.S. federal), OTHER_GOV, NETWORK, OTHER (academic, hospital, non-profit), INDIV, AMBIG, UNKNOWN. Use INDUSTRY for company-sponsored trials.

## `countries` (type: `array`):

Optional. Studies with at least one site in ANY of these countries: names ("United States", "Japan", "South Korea") or ISO codes ("US", "JP", "DEU"), or regions: Europe, European Union (EU), Asia, Africa, North America, Latin America and the Caribbean, South America, Oceania, Middle East. In site mode only the sites in these countries are returned.

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

Optional. Location search words, e.g. "Boston", "Texas", "Mayo Clinic". A study matches ANY entry.

## `hasResults` (type: `string`):

Filter by whether the study has results posted on ClinicalTrials.gov.

## `startDateFrom` (type: `string`):

Optional. YYYY-MM-DD, YYYY-MM or YYYY, "today" or "30 days ago". Planned (estimated) start dates count too.

## `startDateTo` (type: `string`):

Optional. Last start date, same forms (a month or year means its last day).

## `primaryCompletionFrom` (type: `string`):

Optional. Earliest primary completion date (estimated or actual), e.g. "2026-01-01" — useful for upcoming readouts.

## `primaryCompletionTo` (type: `string`):

Optional. Latest primary completion date, e.g. "2026-12-31".

## `firstPostedFrom` (type: `string`):

Optional. Studies first posted (registered) on or after this day, e.g. "7 days ago" for new registrations.

## `firstPostedTo` (type: `string`):

Optional. Studies first posted on or before this day.

## `updatedFrom` (type: `string`):

Optional. Studies whose last update was posted on or after this day, e.g. "7 days ago" for a weekly monitor.

## `updatedTo` (type: `string`):

Optional. Studies whose last update was posted on or before this day.

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

Order of the results; with maxItems you get the first N in this order.

## `sortOrder` (type: `string`):

Ignored for relevance.

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

Maximum rows (1..200000): trials in trial mode, sites in site mode. You are charged per row. The log and RUN_SUMMARY always say how many studies matched in total.

## `maxApiRequests` (type: `integer`):

Hard budget of requests to the API (1..1000), plus one request for the data timestamp. Requests are sent one at a time at least 1.5 s apart. One request returns up to 1,000 trials (100 in site mode). If the budget runs out, the run still succeeds with what it read (complete=false in RUN_SUMMARY).

## `advancedFilter` (type: `string`):

Optional, for experts: a ClinicalTrials.gov search expression added with AND, e.g. AREA\[MinimumAge]RANGE\[MIN, 18 years] or AREA\[DesignAllocation]RANDOMIZED. Syntax: https://clinicaltrials.gov/find-studies/constructing-complex-search-queries

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

Optional and normally not needed: the API answers Apify datacenter IPs. If set, one sticky session is used for the whole run (never rotation).

## Actor input object example

```json
{
  "outputMode": "trials",
  "conditions": [],
  "interventions": [],
  "sponsors": [],
  "leadSponsorOnly": false,
  "keywords": [],
  "nctIds": [],
  "statuses": [],
  "phases": [],
  "studyTypes": [],
  "interventionTypes": [],
  "leadSponsorClasses": [],
  "countries": [],
  "locations": [],
  "hasResults": "any",
  "startDateFrom": "",
  "startDateTo": "",
  "primaryCompletionFrom": "",
  "primaryCompletionTo": "",
  "firstPostedFrom": "",
  "firstPostedTo": "",
  "updatedFrom": "",
  "updatedTo": "",
  "sortBy": "lastUpdate",
  "sortOrder": "desc",
  "maxItems": 25,
  "maxApiRequests": 30,
  "advancedFilter": "",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `records` (type: `string`):

One row per trial (or per site) with source, sourceUrl, license (attribution, ClinicalTrials.gov processing date and the list of modifications) and retrievedAt on every item.

# 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 = {
    "outputMode": "trials",
    "conditions": [],
    "interventions": [],
    "sponsors": [],
    "leadSponsorOnly": false,
    "keywords": [],
    "nctIds": [],
    "statuses": [],
    "phases": [],
    "studyTypes": [],
    "interventionTypes": [],
    "leadSponsorClasses": [],
    "countries": [],
    "locations": [],
    "hasResults": "any",
    "startDateFrom": "",
    "startDateTo": "",
    "primaryCompletionFrom": "",
    "primaryCompletionTo": "",
    "firstPostedFrom": "",
    "firstPostedTo": "",
    "updatedFrom": "",
    "updatedTo": "",
    "sortBy": "lastUpdate",
    "sortOrder": "desc",
    "maxItems": 25,
    "maxApiRequests": 30,
    "advancedFilter": "",
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("jpopendata/us-clinical-trials").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 = {
    "outputMode": "trials",
    "conditions": [],
    "interventions": [],
    "sponsors": [],
    "leadSponsorOnly": False,
    "keywords": [],
    "nctIds": [],
    "statuses": [],
    "phases": [],
    "studyTypes": [],
    "interventionTypes": [],
    "leadSponsorClasses": [],
    "countries": [],
    "locations": [],
    "hasResults": "any",
    "startDateFrom": "",
    "startDateTo": "",
    "primaryCompletionFrom": "",
    "primaryCompletionTo": "",
    "firstPostedFrom": "",
    "firstPostedTo": "",
    "updatedFrom": "",
    "updatedTo": "",
    "sortBy": "lastUpdate",
    "sortOrder": "desc",
    "maxItems": 25,
    "maxApiRequests": 30,
    "advancedFilter": "",
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("jpopendata/us-clinical-trials").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 '{
  "outputMode": "trials",
  "conditions": [],
  "interventions": [],
  "sponsors": [],
  "leadSponsorOnly": false,
  "keywords": [],
  "nctIds": [],
  "statuses": [],
  "phases": [],
  "studyTypes": [],
  "interventionTypes": [],
  "leadSponsorClasses": [],
  "countries": [],
  "locations": [],
  "hasResults": "any",
  "startDateFrom": "",
  "startDateTo": "",
  "primaryCompletionFrom": "",
  "primaryCompletionTo": "",
  "firstPostedFrom": "",
  "firstPostedTo": "",
  "updatedFrom": "",
  "updatedTo": "",
  "sortBy": "lastUpdate",
  "sortOrder": "desc",
  "maxItems": 25,
  "maxApiRequests": 30,
  "advancedFilter": "",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call jpopendata/us-clinical-trials --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jpopendata/us-clinical-trials"
        }
    }
}
```

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/yDJtjNgn2Ms6wnlv5/builds/B3Fw3QfcXS0w6B9nO/openapi.json
