# Clinical Trials & Drug Data Aggregator (`fascinating_lentil/clinical-trials-drug-data-aggregator`) Actor

Aggregate non-personal clinical trial, drug label, NDC, recall, and aggregate adverse-event metrics from official US government open APIs.

- **URL**: https://apify.com/fascinating\_lentil/clinical-trials-drug-data-aggregator.md
- **Developed by:** [Md Jakaria Mirza](https://apify.com/fascinating_lentil) (community)
- **Categories:** Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 trial record 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

## Clinical Trials & Drug Data Aggregator

Aggregate non-personal clinical trial and drug/regulatory records from official US government open APIs into one normalized Apify dataset. The Actor uses JSON APIs only and does not browser-scrape websites.

This Actor provides public research data and is not medical advice.

### What It Extracts

- ClinicalTrials.gov study facts: NCT ID, brief/official title, status, phase, study type, conditions, interventions, sponsor organization, collaborator organizations, enrollment count, dates, and facility/city/country location summaries.
- openFDA drug records: brand name, generic name, manufacturer organization, product type, route, dosage form, NDC identifiers, and aggregate adverse-event count metrics.
- openFDA recall records: recall ID, product description, recall status, classification, recalling organization, recall date, reason, and source URL.

The Actor intentionally excludes individual investigators, trial contacts, emails, phone numbers, patient-level adverse-event reports, and patient demographics.

### Sources

- ClinicalTrials.gov API v2 from the U.S. National Library of Medicine.
- openFDA drug label, NDC, enforcement, and aggregate adverse-event endpoints from the U.S. Food and Drug Administration.

Both sources are official US government public data APIs. openFDA works without a key, and an optional API key can be provided for higher limits.

### Input

| Field | Type | Description |
| --- | --- | --- |
| `sources` | array | Select `clinical_trials`, `openfda_drugs`, and/or `openfda_recalls`. |
| `query` | string | General keyword, condition, or drug name. |
| `conditions` | array | Optional clinical condition terms. |
| `drugNames` | array | Optional drug names for openFDA and trial search. |
| `status` | string | Optional ClinicalTrials.gov status filter. |
| `phase` | string | Optional ClinicalTrials.gov phase filter. |
| `maxResults` | integer | Maximum records to save across all sources, capped at 1000. |
| `openFdaApiKey` | string | Optional secret openFDA API key. |
| `userAgent` | string | Descriptive User-Agent for public APIs. |

### Sample Output

```json
{
  "source": "clinical_trials",
  "query": "aspirin",
  "recordType": "trial",
  "recordId": "NCT01234567",
  "title": "A Study of Aspirin in Cardiovascular Prevention",
  "name": "Aspirin Prevention Study",
  "status": "COMPLETED",
  "phase": "PHASE3",
  "conditions": ["Cardiovascular Disease"],
  "interventions": [{ "name": "Aspirin", "type": "DRUG" }],
  "genericName": null,
  "brandName": null,
  "sponsorOrManufacturer": "Example University",
  "enrollmentCount": 500,
  "completionDate": "2024-06",
  "recallDate": null,
  "classification": null,
  "adverseEventCount": null,
  "locationsSummary": [{ "facility": "Example Medical Center", "city": "Boston", "country": "United States" }],
  "sourceUrl": "https://clinicaltrials.gov/study/NCT01234567",
  "scrapedAt": "2026-06-14T00:00:00.000Z"
}
````

### Use Cases

- Pharma and biotech pipeline research.
- Competitive intelligence across trials, sponsors, products, and recalls.
- Investor and market intelligence for public drug development signals.
- Regulatory monitoring for recalls and enforcement actions.
- Research data enrichment for internal dashboards and analytics.

### Pricing

This Actor uses pay-per-event pricing.

| Event | When charged | Price |
| --- | --- | --- |
| `trial-record-scraped` | One clean non-personal trial, drug, or recall record saved | $0.004 |

Charges are made only after a record is pushed to the dataset. Empty searches and failed source requests are not charged.

### How to Scrape Clinical Trials and Drug Data

1. Choose one or more sources.
2. Enter a condition, drug name, or keyword.
3. Optionally filter ClinicalTrials.gov results by status or phase.
4. Set the maximum number of records.
5. Run the Actor and export the dataset as JSON, CSV, Excel, or via API.

### Data Safety

This Actor is designed for non-personal organizational and public research data only. It does not output trial contacts, investigator names, phone numbers, emails, patient-level reports, or patient demographics. openFDA adverse-event data is represented only as aggregate counts.

### Medical Disclaimer

This Actor provides public research data and is not medical advice. Do not use this data to diagnose, treat, prevent, or make medical decisions. Consult qualified medical and regulatory professionals for clinical interpretation.

### Responsible Use

This Actor is intended for lawful collection of publicly available information only. Users are responsible for ensuring their use complies with the source website's terms, robots.txt, applicable privacy laws, including India's DPDP Act, and all local regulations.

Do not use this Actor to collect, store, sell, or misuse personal data without a lawful basis. The Actor author is not responsible for misuse by end users.

### License

Apache-2.0

# Actor input Schema

## `sources` (type: `array`):

Official US government APIs to query. All sources are JSON APIs and require no browser scraping.

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

General keyword used for selected sources. Examples: aspirin, diabetes, oncology, melanoma.

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

Optional clinical trial condition terms, such as diabetes or breast cancer.

## `drugNames` (type: `array`):

Optional drug names for openFDA and trial searches.

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

Optional ClinicalTrials.gov overall status filter.

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

Optional ClinicalTrials.gov phase filter.

## `maxResults` (type: `integer`):

Maximum clean non-personal records saved across all selected sources.

## `openFdaApiKey` (type: `string`):

Optional openFDA API key for higher rate limits. You may also set OPENFDA\_API\_KEY as an environment variable.

## `userAgent` (type: `string`):

Descriptive User-Agent sent to official public APIs.

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

Not required for official JSON APIs, included for Apify compatibility.

## Actor input object example

```json
{
  "sources": [
    "clinical_trials",
    "openfda_drugs",
    "openfda_recalls"
  ],
  "query": "aspirin",
  "status": "all",
  "phase": "all",
  "maxResults": 10,
  "userAgent": "ClinicalTrialsDrugDataAggregator/1.0 public-data-research",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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("fascinating_lentil/clinical-trials-drug-data-aggregator").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("fascinating_lentil/clinical-trials-drug-data-aggregator").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 '{}' |
apify call fascinating_lentil/clinical-trials-drug-data-aggregator --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Clinical Trials & Drug Data Aggregator",
        "description": "Aggregate non-personal clinical trial, drug label, NDC, recall, and aggregate adverse-event metrics from official US government open APIs.",
        "version": "1.0",
        "x-build-id": "X2PGgobT0Ae2Mhu4b"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/fascinating_lentil~clinical-trials-drug-data-aggregator/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-fascinating_lentil-clinical-trials-drug-data-aggregator",
                "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/fascinating_lentil~clinical-trials-drug-data-aggregator/runs": {
            "post": {
                "operationId": "runs-sync-fascinating_lentil-clinical-trials-drug-data-aggregator",
                "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/fascinating_lentil~clinical-trials-drug-data-aggregator/run-sync": {
            "post": {
                "operationId": "run-sync-fascinating_lentil-clinical-trials-drug-data-aggregator",
                "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": {
                    "sources": {
                        "title": "Sources",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Official US government APIs to query. All sources are JSON APIs and require no browser scraping.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "clinical_trials",
                                "openfda_drugs",
                                "openfda_recalls"
                            ],
                            "enumTitles": [
                                "ClinicalTrials.gov studies",
                                "openFDA drug labels/NDC",
                                "openFDA drug recalls"
                            ]
                        },
                        "default": [
                            "clinical_trials",
                            "openfda_drugs",
                            "openfda_recalls"
                        ]
                    },
                    "query": {
                        "title": "Search query",
                        "type": "string",
                        "description": "General keyword used for selected sources. Examples: aspirin, diabetes, oncology, melanoma.",
                        "default": "aspirin"
                    },
                    "conditions": {
                        "title": "Trial conditions",
                        "type": "array",
                        "description": "Optional clinical trial condition terms, such as diabetes or breast cancer.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "drugNames": {
                        "title": "Drug names",
                        "type": "array",
                        "description": "Optional drug names for openFDA and trial searches.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "status": {
                        "title": "Trial status filter",
                        "enum": [
                            "all",
                            "RECRUITING",
                            "ACTIVE_NOT_RECRUITING",
                            "NOT_YET_RECRUITING",
                            "COMPLETED",
                            "TERMINATED",
                            "WITHDRAWN",
                            "UNKNOWN"
                        ],
                        "type": "string",
                        "description": "Optional ClinicalTrials.gov overall status filter.",
                        "default": "all"
                    },
                    "phase": {
                        "title": "Trial phase filter",
                        "enum": [
                            "all",
                            "NA",
                            "EARLY_PHASE1",
                            "PHASE1",
                            "PHASE2",
                            "PHASE3",
                            "PHASE4"
                        ],
                        "type": "string",
                        "description": "Optional ClinicalTrials.gov phase filter.",
                        "default": "all"
                    },
                    "maxResults": {
                        "title": "Maximum records",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum clean non-personal records saved across all selected sources.",
                        "default": 10
                    },
                    "openFdaApiKey": {
                        "title": "openFDA API key",
                        "type": "string",
                        "description": "Optional openFDA API key for higher rate limits. You may also set OPENFDA_API_KEY as an environment variable."
                    },
                    "userAgent": {
                        "title": "User-Agent",
                        "type": "string",
                        "description": "Descriptive User-Agent sent to official public APIs.",
                        "default": "ClinicalTrialsDrugDataAggregator/1.0 public-data-research"
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Not required for official JSON APIs, included for Apify compatibility.",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
