# FDA Adverse Drug Event Signal Monitor (`frankycheese/drug-safety-signal`) Actor

Monitor FDA adverse drug event reports against your drugs or MedDRA terms. Pay only for new reports or material source corrections, not every raw entry.

- **URL**: https://apify.com/frankycheese/drug-safety-signal.md
- **Developed by:** [franklin mccheese](https://apify.com/frankycheese) (community)
- **Categories:** Automation, Business
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $100.00 / 1,000 new adverse event reports

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

## FDA Adverse Drug Event Signal Monitor

Run daily or weekly. Pay only for newly seen adverse drug event reports that match your drugs or MedDRA reaction terms.

### buyer wedge

Built for pharmacovigilance teams, pharma compliance groups, and healthcare product safety officers who need a narrow adverse-event feed—not another bulk FDA dump.

### why it is different

- **signal, not retrieval:** unmatched adverse event reports are omitted and free.
- **MedDRA term filtering:** phrase match against reaction terms in the report.
- **correction-aware:** a materially changed source record emits `SOURCE_CORRECTION` once.
- **replay-safe:** stable event IDs and provider idempotency keys suppress duplicate charges.
- **bounded spend:** `maxEvents` and `maxTotalChargeUsd` cap each run before charging.
- **audit evidence:** every row includes the official openFDA query, source fingerprint, timestamp, and disclaimer.

**price example:** five new adverse event reports plus one material source correction cost `$0.55`; unmatched and unchanged reports cost `$0.00`.

### source and scope

The Actor queries the official [openFDA adverse drug event API](https://open.fda.gov/apis/drug/event/). No API key, browser, proxy, personal data, or AI inference is required. FDA states that adverse event data is generally updated daily and is not maintained as an authoritative safety-signal tracker. Accordingly, this Actor is an **internal screening aid** and emits new or corrected reports; it does not issue public alerts, provide medical advice, or claim a safety signal was confirmed or escalated.

### matching

At least one watch term is required:

- `drugs`: phrase match against drug names in the report
- `medDraTerms`: phrase match against MedDRA reaction terms in the report

`baselineMode=emit_matches` returns matching reports in the initial lookback window. Use `silent` to establish state without emitting or charging initial matches. Reuse the same `watchlistId`, settings, and `stateStoreName` for scheduled monitoring.

### output

Paid dataset rows are either:

- `NEW_REPORT` — `$0.10`
- `SOURCE_CORRECTION` — `$0.05`

Unmatched reports, unchanged replays, silent baselines, malformed input, and failed source fetches are not paid events. A deterministic run report is stored as `REPORT` with source window, counts, receipts, state size, and claim scope.

### operational note

If openFDA returns an error or an unexpected response shape, the run fails before state is advanced or events are charged. Event settlement is fail-closed: an ambiguous prior settlement refuses another provider charge.

### quick start

Start with a silent baseline so historical reports do not create paid events, then schedule the identical input daily or weekly.

```json
{
  "watchlistId": "drug-safety-watch",
  "drugs": ["atorvastatin", "lisinopril"],
  "medDraTerms": ["rash", "hypotension"],
  "lookbackDays": 14,
  "baselineMode": "silent",
  "maxEvents": 20,
  "maxTotalChargeUsd": 5,
  "stateStoreName": "drug-safety-watch-state"
}
```

After the baseline, keep `watchlistId`, watch terms, and `stateStoreName` stable. Route returned `NEW_REPORT` rows to a pharmacovigilance review queue. Confirm every action against the linked openFDA source; this feed is deliberately not an emergency notification or safety-signal-confirmation system.

Other focused monitors: [FDA food recall matches](https://apify.com/frankycheese/fda-recall-match-delta), [regulatory rule changes](https://apify.com/frankycheese/regulatory-change-watch), and [weather business impact alerts](https://apify.com/frankycheese/weather-business-impact).

# Actor input Schema

## `watchlistId` (type: `string`):

Stable 3-64 character ID for this drug-safety watchlist.

## `drugs` (type: `array`):

Generic or brand drug names to monitor for adverse events.

## `medDraTerms` (type: `array`):

Specific adverse reaction terms to filter on.

## `lookbackDays` (type: `integer`):

Rolling window for source queries.

## `baselineMode` (type: `string`):

Emit current matches or silently establish baseline.

## `maxEvents` (type: `integer`):

Hard cap on paid signals per run.

## `maxTotalChargeUsd` (type: `number`):

Hard ceiling before any charge.

## `maxSourceRecords` (type: `integer`):

Bound the API response size.

## `stateStoreName` (type: `string`):

Reuse for scheduled runs to suppress replays.

## `resetState` (type: `boolean`):

Discard this watchlist's baseline.

## Actor input object example

```json
{
  "watchlistId": "my-drug-safety-signal-watchlist",
  "drugs": [],
  "medDraTerms": [],
  "lookbackDays": 7,
  "baselineMode": "emit_matches",
  "maxEvents": 100,
  "maxTotalChargeUsd": 20,
  "maxSourceRecords": 1000,
  "stateStoreName": "drug-safety-signal-state",
  "resetState": false
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `report` (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("frankycheese/drug-safety-signal").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("frankycheese/drug-safety-signal").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 frankycheese/drug-safety-signal --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,frankycheese/drug-safety-signal"
        }
    }
}
```

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/wdO5nXyy5aXKNmdCu/builds/CB6dKtveZzUjzKhCA/openapi.json
