# FDA Drug Safety Signal Intelligence Monitor (`quanmatrix/fda-drug-safety-adverse-event-monitor`) Actor

Monitor openFDA FAERS report volume, serious/death shares, reaction composition and changes over time for drug watchlists, with persistent state and explicit non-causal safety interpretation.

- **URL**: https://apify.com/quanmatrix/fda-drug-safety-adverse-event-monitor.md
- **Developed by:** [Rafael Barreto Haddad](https://apify.com/quanmatrix) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $21.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## FDA Drug Safety Signal Intelligence Monitor

Turn openFDA FAERS into a recurring drug-safety watchlist workflow instead of another raw adverse-event exporter. For each drug name, the Actor compares equal-length current and previous reporting windows, measures total report volume, serious-report share, death-indicator share, top reaction composition, and persisted changes from the previous Actor run. It produces one aggregated signal-intelligence report per watched drug.

### Why use this Actor

FAERS contains spontaneous safety reports that are valuable for surveillance but easy to misuse. Raw-row scraping creates volume without necessarily creating operational intelligence. This Actor emphasizes repeatable monitoring: compare report counts over time, surface serious/death indicators, summarize the most frequent reaction terms, and record whether the monitored profile changed since the previous run. The output is explicitly non-causal and is designed for pharmacovigilance operations, regulatory intelligence, research monitoring, and watchlist triage rather than diagnosis or clinical decision-making.

### Key features

- Official openFDA drug adverse-event API as the source.
- Equal-length current versus previous window comparison.
- Current report count and percentage change versus the previous window.
- Serious-report and death-indicator counts and shares.
- Top reported MedDRA reaction terms from the current query.
- Persistent run-to-run state for report-count and reaction-composition changes.
- One aggregated report per drug instead of billing by every FAERS record.
- Optional openFDA API key for higher source request limits.
- Explicit causality disclaimer in every output item.

### Input

Provide `drugNames` as medicinal-product names to monitor. `windowDays` sets both the current and previous comparison windows and is bounded between 90 and 1,825 days to reduce misleading ultra-short comparisons against reporting lag. `openFdaApiKey` is optional and secret. `persistState` enables comparison with the previous Actor run for the same drug name.

### Output

Each dataset item contains `totalReports`, `previousWindowReports`, `reportGrowthPct`, `seriousReports`, `seriousSharePct`, `deathReports`, `deathSharePct`, `topReactions`, `signalScore`, and run-to-run change fields. `signalScore` is a deterministic operational triage heuristic. It is not a clinical risk score, incidence estimate, disproportionality statistic, or causal conclusion. The `causalityDisclaimer` field is always included so downstream agents and workflows preserve this limitation.

### Example

Input: `{"drugNames":["ASPIRIN"],"windowDays":365,"persistState":true}`. The Actor queries the current 365-day FAERS window, the immediately preceding 365-day window, serious and death indicators, and current reaction counts. The first stateful run is `INITIALIZED`; later runs can become `SIGNAL_CHANGED` when the monitored count or top-reaction composition differs.

### Use cases

Use it for pharmacovigilance watchlists, regulatory research, portfolio monitoring, safety-operations triage, recurring product surveillance, or research pipelines that need a compact machine-readable FAERS signal surface. Public Tasks can represent distinct watched drugs, while downstream automations can route unusually large changes to human review.

### Pricing

Pay per event. One primary event is charged for each aggregated drug-safety signal report written to the default dataset. There is no separate QuanMatrix start fee. The pricing design intentionally values the analytical report rather than multiplying charges by thousands of raw FAERS rows.

### Limitations

FAERS is a spontaneous reporting system. Reports do not establish that a drug caused an event and cannot be used directly to calculate incidence, prevalence, comparative safety, or clinical risk. Reporting is affected by duplication, stimulated reporting, publicity, product age, coding, incomplete information, and reporting lag. Drug-name matching follows the medicinal-product text searchable through openFDA and may not capture every synonym, formulation, or product alias. This Actor is operational signal intelligence, not medical advice and not a substitute for formal pharmacovigilance methods or expert review.

# Actor input Schema

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

Medicinal product names to monitor in openFDA FAERS.

## `windowDays` (type: `integer`):

Current and previous windows are compared using the same duration.

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

Optional openFDA API key for higher request limits.

## `persistState` (type: `boolean`):

Compare signal metrics with the previous Actor run.

## Actor input object example

```json
{
  "drugNames": [
    "ASPIRIN"
  ],
  "windowDays": 365,
  "persistState": true
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("quanmatrix/fda-drug-safety-adverse-event-monitor").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("quanmatrix/fda-drug-safety-adverse-event-monitor").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{}' |
apify call quanmatrix/fda-drug-safety-adverse-event-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,quanmatrix/fda-drug-safety-adverse-event-monitor"
        }
    }
}

```

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/76MS4GSlPslqNpxuJ/builds/MM0EPIlmx13d6og4I/openapi.json
