# ClinicalTrials.gov V2 Export (`foxk1996/clinicaltrials-v2-export`) Actor

Export clean, structured ClinicalTrials.gov v2 API study records by condition, intervention, phase, status, and location. Built for biotech BD, CRO analysts, and clinical intelligence workflows.

- **URL**: https://apify.com/foxk1996/clinicaltrials-v2-export.md
- **Developed by:** [Kronos Fox](https://apify.com/foxk1996) (community)
- **Categories:** Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$20.00 / 1,000 study scrapeds

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 V2 Export

Export structured study records from the public ClinicalTrials.gov v2 API. This Apify actor is designed for biotech business-development teams, CRO analysts, clinical operations researchers, competitive intelligence teams, and data vendors who need clean trial metadata without building and maintaining their own API pagination, filtering, and normalization layer.

### ClinicalTrials.gov study search by condition, intervention, phase, status, and location

The actor calls only HTTP-only public ClinicalTrials.gov v2 endpoints and does not require logins, proxies, cookies, or credentials. Search by condition, intervention, general keyword, and location, then narrow results with optional recruitment statuses, study phases, study types, and first-posted date ranges. Defaults are intentionally small so a trial run completes quickly, while `maxResults` can be increased for larger exports. The actor uses ClinicalTrials.gov pagination and honors `maxResults` exactly, truncating client-side if an API page contains more records than the requested cap.

### What you get in each exported study record

Each output row is a normalized study record with the NCT ID, ClinicalTrials.gov URL, brief and official titles, acronym, overall status, last known status, results availability, key study dates, lead sponsor, collaborators, responsible party, condition list, keywords, study type, phases, enrollment, design details, interventions, arm groups, primary and secondary outcomes, eligibility criteria, age/sex fields, central contacts, officials, locations, countries, and ClinicalTrials.gov browse terms when provided by the API. The parser keeps nested details where they matter, such as contacts and site locations, while also adding convenient flat fields like `leadSponsorName`, `interventionNames`, `locationCount`, and `countries` for spreadsheets and lead lists.

### Use cases for biotech BD and CRO analysts

Use this actor to find recruiting studies in a therapeutic area, monitor sponsor activity around a target drug, build site and country maps for feasibility research, create competitive landscapes by condition and phase, enrich CRM accounts with trial activity, or export structured trial feeds for dashboards and downstream analytics. Because it uses the official v2 API, it avoids brittle HTML scraping and preserves modern v2 fields that older scrapers often flatten poorly or miss entirely.

### How to use

Start with the default input to export a small diabetes sample. Add an `intervention` such as `pembrolizumab`, set `statuses` to values like `RECRUITING` or `ACTIVE_NOT_RECRUITING`, add `phases` such as `PHASE2` or `PHASE3`, and optionally provide a `location` such as `United States` or `France`. Increase `maxResults` when you are ready for a larger export. If you use a broad query, keep `pageSize` near the default until you confirm the result shape, then increase it to reduce the number of API calls.

### Pricing

This actor uses Apify pay-per-event pricing. The single paid event is `study-scraped` at $0.02 per exported study record. There are no extra paid events for pages, errors, or nested locations. Local, free, or non-PPE runs are capped by the built-in free-run guard.

### FAQ

#### Does this scrape ClinicalTrials.gov web pages?

No. It only calls the official public ClinicalTrials.gov v2 API at `clinicaltrials.gov/api/v2/studies`.

#### Do I need an API key?

No. The endpoint used by this actor is public and does not require authentication.

#### Are contacts included?

Yes, when ClinicalTrials.gov provides them. Central contacts, overall officials, and site-level contacts are normalized into structured fields. Contact availability varies by study and sponsor.

#### Can I export every trial in a disease area?

Yes, within Apify run limits and the `maxResults` you choose. The actor paginates through API pages until it reaches your exact cap, the API runs out of results, or spending/free-run limits stop the run.

# Actor input Schema

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

Condition, disease, or medical topic to search in ClinicalTrials.gov, for example diabetes, melanoma, Alzheimer's disease, or heart failure.
## `intervention` (type: `string`):

Optional drug, biologic, device, procedure, or other intervention search term, for example pembrolizumab or insulin.
## `term` (type: `string`):

Optional general query term applied through the ClinicalTrials.gov v2 query.term parameter for broader keyword matching.
## `location` (type: `string`):

Optional location search text such as United States, Boston, France, or a site/city name.
## `statuses` (type: `array`):

Optional ClinicalTrials.gov overall statuses to include. Leave empty for all statuses.
## `phases` (type: `array`):

Optional ClinicalTrials.gov phase filters such as PHASE1, PHASE2, PHASE3, or PHASE4. Leave empty for all phases.
## `studyTypes` (type: `array`):

Optional study type filters such as INTERVENTIONAL, OBSERVATIONAL, or EXPANDED_ACCESS. Leave empty for all study types.
## `fromFirstPostedDate` (type: `string`):

Optional inclusive lower bound for first posted date in YYYY-MM-DD format, applied with the ClinicalTrials.gov query date range expression.
## `toFirstPostedDate` (type: `string`):

Optional inclusive upper bound for first posted date in YYYY-MM-DD format, applied with the ClinicalTrials.gov query date range expression.
## `maxResults` (type: `integer`):

Maximum number of study records to export. The actor honors this cap exactly and truncates client-side if the API over-serves.
## `pageSize` (type: `integer`):

Number of studies requested per ClinicalTrials.gov API page. Smaller values are useful for smoke tests; larger values reduce page requests.

## Actor input object example

```json
{
  "condition": "diabetes",
  "statuses": [
    "RECRUITING"
  ],
  "maxResults": 25,
  "pageSize": 25
}
````

# 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",
    "statuses": [
        "RECRUITING"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("foxk1996/clinicaltrials-v2-export").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",
    "statuses": ["RECRUITING"],
}

# Run the Actor and wait for it to finish
run = client.actor("foxk1996/clinicaltrials-v2-export").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",
  "statuses": [
    "RECRUITING"
  ]
}' |
apify call foxk1996/clinicaltrials-v2-export --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "ClinicalTrials.gov V2 Export",
        "description": "Export clean, structured ClinicalTrials.gov v2 API study records by condition, intervention, phase, status, and location. Built for biotech BD, CRO analysts, and clinical intelligence workflows.",
        "version": "0.1",
        "x-build-id": "uSMPsQVCr4Z7h8cFX"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/foxk1996~clinicaltrials-v2-export/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-foxk1996-clinicaltrials-v2-export",
                "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/foxk1996~clinicaltrials-v2-export/runs": {
            "post": {
                "operationId": "runs-sync-foxk1996-clinicaltrials-v2-export",
                "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/foxk1996~clinicaltrials-v2-export/run-sync": {
            "post": {
                "operationId": "run-sync-foxk1996-clinicaltrials-v2-export",
                "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",
                "required": [
                    "maxResults"
                ],
                "properties": {
                    "condition": {
                        "title": "Condition or disease",
                        "type": "string",
                        "description": "Condition, disease, or medical topic to search in ClinicalTrials.gov, for example diabetes, melanoma, Alzheimer's disease, or heart failure."
                    },
                    "intervention": {
                        "title": "Intervention",
                        "type": "string",
                        "description": "Optional drug, biologic, device, procedure, or other intervention search term, for example pembrolizumab or insulin."
                    },
                    "term": {
                        "title": "General search term",
                        "type": "string",
                        "description": "Optional general query term applied through the ClinicalTrials.gov v2 query.term parameter for broader keyword matching."
                    },
                    "location": {
                        "title": "Location",
                        "type": "string",
                        "description": "Optional location search text such as United States, Boston, France, or a site/city name."
                    },
                    "statuses": {
                        "title": "Recruitment statuses",
                        "type": "array",
                        "description": "Optional ClinicalTrials.gov overall statuses to include. Leave empty for all statuses.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "phases": {
                        "title": "Study phases",
                        "type": "array",
                        "description": "Optional ClinicalTrials.gov phase filters such as PHASE1, PHASE2, PHASE3, or PHASE4. Leave empty for all phases.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "studyTypes": {
                        "title": "Study types",
                        "type": "array",
                        "description": "Optional study type filters such as INTERVENTIONAL, OBSERVATIONAL, or EXPANDED_ACCESS. Leave empty for all study types.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "fromFirstPostedDate": {
                        "title": "From first posted date",
                        "type": "string",
                        "description": "Optional inclusive lower bound for first posted date in YYYY-MM-DD format, applied with the ClinicalTrials.gov query date range expression."
                    },
                    "toFirstPostedDate": {
                        "title": "To first posted date",
                        "type": "string",
                        "description": "Optional inclusive upper bound for first posted date in YYYY-MM-DD format, applied with the ClinicalTrials.gov query date range expression."
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of study records to export. The actor honors this cap exactly and truncates client-side if the API over-serves.",
                        "default": 25
                    },
                    "pageSize": {
                        "title": "Page size",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Number of studies requested per ClinicalTrials.gov API page. Smaller values are useful for smoke tests; larger values reduce page requests.",
                        "default": 25
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
