# FDA MAUDE Medical Device Reports Exporter (`bewildering_tapestry/maude-reports-export-w05-private`) Actor

Export FDA MAUDE medical device adverse-event reports via openFDA. Filter by date, device product code, manufacturer, brand and event type. Get 38 structured fields in Apify datasets with a run summary. Retrieval is limited to two source requests per run; exports can be partial.

- **URL**: https://apify.com/bewildering_tapestry/maude-reports-export-w05-private.md
- **Developed by:** [Donald McDoc](https://apify.com/bewildering_tapestry) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 maude 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

## MAUDE Reports Export

Export U.S. FDA **MAUDE medical-device adverse-event reports** from the public
[openFDA device/event API](https://open.fda.gov/apis/device/event/) as clean, flat,
one-row-per-report data (JSON, CSV or Excel from the Apify dataset).

*Data provided by the U.S. Food and Drug Administration (https://open.fda.gov). This tool is
not affiliated with or endorsed by the FDA.*

### What you get

- **One row per MAUDE report** (`mdr_report_key`), with a fixed set of 38 documented columns.
- **Bounded retrieval**: at most **two physical source GET attempts in total per run**, shared
  across every page and retry. Continuation uses openFDA's `search_after` cursor only while
  an attempt remains. This is not an exhaustive or large-volume export guarantee.
- **Filters**: FDA receipt date range (required), product codes, brand names, device manufacturer names
  and event types.
- **Clean output**: duplicates, malformed records, reports outside your date window and reports
  that don't match your filters are dropped. You are not charged for them.
- **Privacy-minimised by default**: no manufacturer contact names, phone numbers or addresses, no
  distributor addresses, no patient demographics and no narrative text.

### Quick start

```json
{
  "receivedFrom": "2026-10-01",
  "receivedTo": "2026-10-07",
  "productCodes": ["FRN"],
  "eventTypes": ["Malfunction"],
  "maxResults": 3,
  "includeNarrative": false
}
```

| Input | Required | Notes |
|---|---|---|
| `receivedFrom`, `receivedTo` | yes | `YYYY-MM-DD`, inclusive, on FDA `date_received`. Exports without a date window are rejected. |
| `productCodes` | no | 3-letter FDA product codes (any match). Up to 20 values. |
| `brandNames` | no | Brand-name phrases (any match). `"` and `\` are not allowed. |
| `manufacturers` | no | Device manufacturer name phrases (any match). |
| `eventTypes` | no | `Death`, `Injury`, `Malfunction`, `Other`, `No answer provided`. |
| `maxResults` | no | UI prefill 3; API default 1,000; accepted input ceiling 25,000. Delivery remains limited by two attempts. |
| `openFdaApiKey` | no | Your own free openFDA key, for higher daily limits. It is never logged or saved in the output. |
| `includeNarrative` | no | **Disabled** for now (pending a privacy review); `true` is rejected. |

Different filters are combined with AND. Values within one filter are combined with OR.
The UI prefills match this small example. API callers must supply the required dates;
`{}` does not restore UI prefills. Omitting `maxResults` retains the API default of 1,000.
Prefills are examples, not a promise that current source data will match.

### Output fields

| Field | Source (openFDA) |
|---|---|
| `mdr_report_key`, `report_number` | same |
| `date_received`, `date_of_event`, `date_report`, `date_changed` | same, converted to `YYYY-MM-DD` |
| `event_type`, `report_source_code`, `source_type[]`, `type_of_report[]` | same |
| `adverse_event_flag`, `product_problem_flag`, `product_problems[]`, `remedial_action[]` | same |
| `number_devices_in_event` | same (integer) |
| `device_count`, `patient_count` | number of `device[]` / `patient[]` entries |
| `primary_*` (brand, generic name, product code, model, catalog, lot, UDI-DI, implant flag, operator, manufacturer name) | first entry of `device[]` |
| `primary_device_class`, `primary_device_name`, `primary_regulation_number` | `device[0].openfda` (FDA classification data) |
| `pma_pmn_number` | same |
| `all_product_codes[]`, `all_brand_names[]` | all devices in the report |
| `patient_problems[]`, `patient_outcomes[]` | combined across `patient[]` |
| `source_api_url` | openFDA query URL for this exact report |
| `data_last_updated` | openFDA `meta.last_updated` |
| `retrieved_at` | time the page was fetched (UTC) |

See [`samples/sample_output.json`](samples/sample_output.json). Both example rows are invented,
synthetic Malfunction reports matching the example filters. Two sample rows do not imply that a
three-result request always returns three rows; no actual source record was used for this sample.

**Never exported:** `manufacturer_contact_*` (names, phones, addresses), manufacturer and distributor
addresses, `udi_public`, patient age, sex, weight, race and ethnicity, and narrative text (`mdr_text`). No GMDN
nomenclature terms, descriptions or derived mappings are exported. GMDN content is excluded
pending separate license/rights clearance. An allow-list reduces exposure but does not guarantee
that every future upstream string is free of personal or third-party content. Review exports
before redistributing them; do not submit patient data, narratives or credentials in support issues.

### Run outcome

The run's dataset contains **only valid report rows**. The run summary is written to the key-value store
record `RUN_SUMMARY`, not to the dataset. It includes the status, stop reason, counts of skipped and
duplicate rows, requests and errors. Possible statuses:

- `SUCCEEDED`: the query cursor ended or the requested `maxResults` target was reached.
  Reaching a target is not proof that all matching source reports were exported.
- `EMPTY`: there were no matches.
- `PARTIAL`: an operational limit or recoverable source error stopped retrieval. This includes
  `CHARGE_LIMIT_REACHED` (which may occur with zero rows), `REQUEST_BUDGET_EXHAUSTED` or a time limit.
  Existing rows remain usable as a bounded subset; inspect the stop reason and counts.
- `FAILED`: an input, configuration or source error occurred before any row was stored, **or** an
  accounting-integrity failure occurred at any point (stop reason `ACCOUNTING_INTEGRITY_FAILURE` or
  `STORE_OUTCOME_UNKNOWN`). Rows already written stay in the dataset; inspect `RUN_SUMMARY`.

The declared run outputs link to all default dataset items and to the actual `RUN_SUMMARY` record.
They do not expose `INPUT` or internal `RUN_STATE`. Platform `SUCCEEDED` can coexist with business
`EMPTY` or `PARTIAL`; use the summary, not the platform badge alone. A forced termination may prevent
a final summary from being written. Missing or stale completion evidence is not success.

### Pricing and charging semantics

- The sole priced event is `maude-report`, with a launch price of
  **USD 0.001 per valid report = USD 1.00 per 1,000 valid reports**. No priced start event or
  synthetic dataset-item event was configured. Unpriced SDK bookkeeping counters are not additional fees.
- Valid rows use one custom result event per stored report. Duplicates, invalid/filter-dropped rows,
  summaries and empty results do not generate result events. Compute, storage and other platform usage
  may still incur costs, including on failed or empty runs.
- **Owner Console observation (2026-11-19):** "User pays platform usage costs" was set to **No**. Under that observed configuration, platform usage is included in customer event pricing and is borne by the Actor creator. The launch price for the sole result event, `maude-report`, is USD 0.001 per valid report. The API does not independently confirm this billing toggle. Recheck the setting and any pending effective-date change before publication. Actual settled customer charges, creator margins and payouts remain unverified.
- An explicitly selected per-run event-charge cap limits nominal result events, not all infrastructure
  costs. The historical three-result smoke used USD 0.0003; this is not a persistent default or new authority.
  `CHARGE_LIMIT_REACHED` returns business `PARTIAL`, even when the requested three rows were stored.
- Unknown write outcomes or accounting mismatches fail closed and stop further fetching/writing.
  Already written rows/events are not rolled back. No refund or exactly-once guarantee across interruptions
  or separate runs is made. Inspect the summary before deciding whether any later run is appropriate.
- Event counts and posted prices do not establish settled customer bills, creator earnings or payout.

### Limitations — please read

- **MAUDE is a passive surveillance system.** Reports may be incomplete, inaccurate, untimely, unverified
  or biased. A report does **not** establish that a device caused an event. MAUDE alone cannot be used
  to determine incidence, prevalence or risk rates.
- This tool provides **no medical, regulatory or legal advice**. It exports public records as published.
- openFDA updates device events weekly and is not real time. Records can change between pages, so an
  export is a snapshot. It is not a guaranteed complete chronological history.
- **Rate limits**: shared cloud IPs can hit openFDA's limits. Respect `429`/outages and wait;
  do not rotate identities, proxies or repeated runs to evade limits. An optional personal key does not
  raise this Actor's two-attempt ceiling. See [openFDA authentication and limits](https://open.fda.gov/apis/authentication/).
- Keyless page size is 999 reports per request. With a key, it is 1,000.
  Two successful full pages yield at most 1,998/2,000 raw reports, respectively, before filtering,
  deduplication and other limits. Retries consume the same budget and reduce useful yield.
- **Supported release settings:** the verified immutable release build, 256 MB memory, 180-second platform timeout and restart on error disabled. Each openFDA HTTP attempt can take up to 60 seconds. Two attempts plus backoff, processing and storage operations may still exceed the platform timeout under adverse conditions. The internal wall budget remains 240 seconds, but does not override the platform timeout. Graceful summary durability following hard termination remains unverified. Actual Store default-input behavior has not yet been validated on the current build.
- Brand and manufacturer matching is openFDA's phrase search. Results are re-checked locally by word
  containment.
- Only the first device in each report fills the `primary_*` columns. The `all_*` columns cover all devices.
- [openFDA terms](https://open.fda.gov/terms/) apply. FDA public data generally uses CC0 with stated
  exceptions; do not assume that public availability clears every third-party license or privacy right.

### Support and operator incident rules

Support contact: the Actor's Apify **Issues** tab, monitored by its AUTOMATON owner
(`bewildering_tapestry`). While private, use the existing owner review channel. Include a run ID,
business status/stop reason and redacted summary; never post API keys, raw narratives or patient details.
This is the proposed operating procedure for release, not evidence of an active monitoring service.

- Owner checks issues each business day and reviews source/API, schema, pricing and privacy changes
  weekly and before each proposed release. Address notified issues as soon as possible and within
  14 days; respond to direct Apify requests within three business days, per
  [Store Publishing Terms](https://docs.apify.com/legal/store-publishing-terms-and-conditions).
- On `429`/5xx, stop after the shared two-attempt budget; report source unavailability and do not
  automatically rerun. An empty result is legitimate: never add synthetic rows to pass a Store test.
- On accounting mismatch, unknown write outcome, replay refusal, exposed secret/PII, unexpected
  priced events or forecast cost above an approved allowance: stop further execution, preserve
  redacted evidence and ask the owner to pause access/public use pending review. No automated
  sharing, pricing change, unpublishing or rerun is part of this code or local task.
- Preserve immutable 0.0.2 and 0.0.1. **0.0.1 is PRE-hard-GET guard and is NOT a safety-equivalent
  automatic rollback.** During an incident prefer a pause; any restoration needs independently
  reviewed source/build identity, preserved two-attempt protections and explicit owner approval.
- Keep evidence in owner-controlled storage with minimal access. Export/delete records according to
  the account's verified retention settings and applicable obligations; no automatic deletion schedule
  or retention period is promised here. Final release review must verify effective storage access/retention.

### Development

```bash
python -m pytest -q
```

Tests are fully offline. Tests marked `sdk` run the real Apify SDK locally in its pay-per-event test mode,
where nothing is billed. See [`ENGINEERING_NOTES.md`](ENGINEERING_NOTES.md) for architecture,
charging design and unverified items.

# Actor input Schema

## `receivedFrom` (type: `string`):

First FDA receipt date (date_received), YYYY-MM-DD. Required: unbounded exports are rejected.

## `receivedTo` (type: `string`):

Last FDA receipt date (date_received), YYYY-MM-DD. Required.

## `productCodes` (type: `array`):

3-letter FDA device product codes (device.device_report_product_code). Any of these match. Max 20.

## `brandNames` (type: `array`):

Brand-name phrases (device.brand_name). Any of these match. Double quotes and backslashes are not allowed.

## `manufacturers` (type: `array`):

Manufacturer name phrases (device.manufacturer_d_name). Any of these match.

## `eventTypes` (type: `array`):

Death, Injury, Malfunction, Other, No answer provided. Any of these match.

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

Target valid reports, subject to two physical GET attempts total across pages and retries. 25,000 is an input ceiling, not a delivery promise. UI prefill: 3; API default: 1,000.

## `includeNarrative` (type: `boolean`):

Currently DISABLED pending a privacy and data-rights review. Setting true is rejected.

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

Your own free openFDA key raises daily limits. Never logged or stored in output.

## Actor input object example

```json
{
  "receivedFrom": "2026-10-01",
  "receivedTo": "2026-10-07",
  "productCodes": [
    "FRN"
  ],
  "eventTypes": [
    "Malfunction"
  ],
  "maxResults": 3,
  "includeNarrative": false
}
```

# Actor output Schema

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

No description

## `runSummary` (type: `string`):

Business status, stop reason and counts; partial output is not a complete export.

# 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 = {
    "receivedFrom": "2026-10-01",
    "receivedTo": "2026-10-07",
    "productCodes": [
        "FRN"
    ],
    "eventTypes": [
        "Malfunction"
    ],
    "maxResults": 3,
    "includeNarrative": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("bewildering_tapestry/maude-reports-export-w05-private").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 = {
    "receivedFrom": "2026-10-01",
    "receivedTo": "2026-10-07",
    "productCodes": ["FRN"],
    "eventTypes": ["Malfunction"],
    "maxResults": 3,
    "includeNarrative": False,
}

# Run the Actor and wait for it to finish
run = client.actor("bewildering_tapestry/maude-reports-export-w05-private").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 '{
  "receivedFrom": "2026-10-01",
  "receivedTo": "2026-10-07",
  "productCodes": [
    "FRN"
  ],
  "eventTypes": [
    "Malfunction"
  ],
  "maxResults": 3,
  "includeNarrative": false
}' |
apify call bewildering_tapestry/maude-reports-export-w05-private --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bewildering_tapestry/maude-reports-export-w05-private"
        }
    }
}
```

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/D9Hnb2EBwFI4gUGqo/builds/pjlaO3gHFybeXm20a/openapi.json
