# ⚖️ FDA Warning Letters Scraper (`taroyamada/fda-warning-letter-digest`) Actor

Extract public FDA warning letters to discover actionable legal and consulting leads. Build targeted watchlists for compliance subjects and track enforcement dates.

- **URL**: https://apify.com/taroyamada/fda-warning-letter-digest.md
- **Developed by:** [太郎 山田](https://apify.com/taroyamada) (community)
- **Categories:** Lead generation, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.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.

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

## FDA Warning Letters Digest | Summary-First Feed

Monitor public FDA warning letters with one summary-first digest row per configured feed. Import alerts and GovDelivery remain optional advanced sources but stay off by default in v1.

### Store Quickstart

- Leave `feeds` empty to use the default **FDA Warning Letters** feed.
- Keep `lookbackDays=30`, `delivery=dataset`, and reuse the same `snapshotKey` on recurring runs.
- Add `watchTerms` when you want `action_needed` only for matched companies, subjects, or offices.

### Key Features

- 🏛️ **Government-sourced** — Pulls directly from official agency feeds — no third-party aggregators
- ⏱️ **Timely digests** — Daily/weekly rollups of new filings, rulings, or actions
- 🔍 **Keyword watchlists** — Flag items matching your compliance/legal watch terms
- 📊 **Structured metadata** — Agency, date, docket, document type, link — all dataset-ready
- 📡 **Webhook alerts** — Push to legal/compliance teams the moment new items match watchlist

### Use Cases

| Who | Why |
|-----|-----|
| Developers | Automate recurring data fetches without building custom scrapers |
| Data teams | Pipe structured output into analytics warehouses |
| Ops teams | Monitor changes via webhook alerts |
| Product managers | Track competitor/market signals without engineering time |

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| feeds | array | — | One entry per monitored feed or watchlist. Leave empty to use the default public warning_letters_latest feed. import_ale |
| watchTerms | string | — | Applied to every feed in addition to any feed-level watchTerms. Matching new/changed items trigger action_needed. |
| lookbackDays | integer | `30` | How far back to look for warning-letter posting dates, import-alert publish dates, or bulletin send dates. |
| maxItemsPerFeed | integer | `50` | Upper bound on normalized items per feed. Lower values keep recurring runs maintenance-light. |
| maxPagesPerFeed | integer | `5` | Only used for warning_letters feeds. Stop after this many public datatables requests even if the lookback window is broa |
| maxDetailFetchesPerFeed | integer | `25` | Cap on detail-page enrichment for import_alerts feeds. |
| delivery | string | `"dataset"` | dataset writes digest rows to the Apify dataset; webhook POSTs the digest payload to webhookUrl. |
| webhookUrl | string | — | POST target for the digest payload. |

#### Input Example

```json
{
  "feeds": [
    {
      "id": "cder-warning-letters",
      "name": "CDER Warning Letters",
      "source": "warning_letters",
      "issuingOffices": ["Center for Drug Evaluation and Research"],
      "maxItems": 25
    }
  ],
  "watchTerms": "Acme, sterile, cGMP",
  "lookbackDays": 30,
  "delivery": "dataset",
  "datasetMode": "all",
  "snapshotKey": "fda-warning-letters-prod",
  "dryRun": false
}
````

### Output

| Field | Type | Description |
|-------|------|-------------|
| `meta` | object |  |
| `errors` | array |  |
| `digests` | array |  |
| `digests[].feedId` | string |  |
| `digests[].feedName` | string |  |
| `digests[].source` | string |  |
| `digests[].checkedAt` | timestamp |  |
| `digests[].windowStart` | timestamp |  |
| `digests[].lookbackDays` | number |  |
| `digests[].isInitial` | boolean |  |
| `digests[].status` | string |  |
| `digests[].changedItemCount` | number |  |
| `digests[].newItemCount` | number |  |
| `digests[].updatedItemCount` | number |  |
| `digests[].totalItemCount` | number |  |
| `digests[].watchTermHitCount` | number |  |
| `digests[].changedSinceLastRun` | boolean |  |
| `digests[].actionNeeded` | boolean |  |
| `digests[].recommendedAction` | string |  |
| `digests[].signalTags` | array |  |
| `digests[].changeTypeBreakdown` | object |  |
| `digests[].topIssuingOffices` | array |  |
| `digests[].watchTermHits` | array |  |
| `digests[].changedItems` | array |  |
| `digests[].items` | array |  |
| `digests[].error` | null |  |

#### Output Example

```json
{
  "digests": [
    {
      "feedId": "cder-warning-letters",
      "status": "action_needed",
      "changedItemCount": 1,
      "watchTermHitCount": 1,
      "recommendedAction": "Review 1 changed warning letter item(s) matching watch terms (Acme Sterile)."
    }
  ]
}
```

### API Usage

Run this actor programmatically using the Apify API. Replace `YOUR_API_TOKEN` with your token from [Apify Console → Settings → Integrations](https://console.apify.com/account/integrations).

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/taroyamada~fda-warning-letter-digest/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "feeds": [ { "id": "cder-warning-letters", "name": "CDER Warning Letters", "source": "warning_letters", "issuingOffices": ["Center for Drug Evaluation and Research"], "maxItems": 25 } ], "watchTerms": "Acme, sterile, cGMP", "lookbackDays": 30, "delivery": "dataset", "datasetMode": "all", "snapshotKey": "fda-warning-letters-prod", "dryRun": false }'
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("taroyamada/fda-warning-letter-digest").call(run_input={
  "feeds": [
    {
      "id": "cder-warning-letters",
      "name": "CDER Warning Letters",
      "source": "warning_letters",
      "issuingOffices": ["Center for Drug Evaluation and Research"],
      "maxItems": 25
    }
  ],
  "watchTerms": "Acme, sterile, cGMP",
  "lookbackDays": 30,
  "delivery": "dataset",
  "datasetMode": "all",
  "snapshotKey": "fda-warning-letters-prod",
  "dryRun": false
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

#### JavaScript / Node.js

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

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('taroyamada/fda-warning-letter-digest').call({
  "feeds": [
    {
      "id": "cder-warning-letters",
      "name": "CDER Warning Letters",
      "source": "warning_letters",
      "issuingOffices": ["Center for Drug Evaluation and Research"],
      "maxItems": 25
    }
  ],
  "watchTerms": "Acme, sterile, cGMP",
  "lookbackDays": 30,
  "delivery": "dataset",
  "datasetMode": "all",
  "snapshotKey": "fda-warning-letters-prod",
  "dryRun": false
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Tips & Limitations

- Run daily for active watchlists; weekly for passive monitoring.
- Webhook delivery works well for compliance team Slack channels — include docket URL for 1-click access.
- Use `watchKeywords` generously — false positives are cheap to triage, false negatives miss filings.
- Pair with `regulatory-change-monitor` for cross-agency coverage.
- Archive Dataset rows weekly for long-term compliance evidence retention.

### FAQ

**How far back does history go?**

This actor monitors forward-only — new items since first run. For historical data, use the agency's own search tool.

**What timezones are used?**

All timestamps are UTC. Use your downstream pipeline to convert to agency-local time if needed.

**Does it translate non-English content?**

No — original language is preserved. Use downstream translation services if needed.

**Is the data official?**

Yes — sourced directly from official government websites and feeds. Not a third-party aggregator.

**Can I use this for legal research?**

For alerting and monitoring, yes. For litigation research, cross-verify with primary sources (agency websites) — this actor is a monitoring tool, not a legal database.

### Related Actors

Government & Regulatory cluster — explore related Apify tools:

- [EPA Enforcement Digest | ECHO Compliance Risk Monitor](https://apify.com/taroyamada/epa-enforcement-digest) — Monitor EPA ECHO all-media facility search, corporate compliance screener, and enforcement case feeds with one summary-first digest row per watched company, facility, or case feed.
- [Federal Register Digest | Agency Rule & Notice Monitor](https://apify.com/taroyamada/federal-register-digest) — Monitor Federal Register documents — rules, proposed rules, and notices — per configured agency feed.
- [Government Contract Award Monitor | Award & Competitor Watch](https://apify.com/taroyamada/government-contract-award-monitor) — Monitor public-sector contract award notices for new wins, notable awardees, incumbent recompetes, and competitor signals — one digest row per configured feed without brittle broad crawling.
- [Grants.gov Funding Digest | Opportunity Watch & Signal Digest](https://apify.com/taroyamada/grants-gov-funding-digest) — Monitor Grants.
- [NHTSA Vehicle Recall Digest | Recalls + Complaints Watch](https://apify.com/taroyamada/nhtsa-vehicle-recall-digest) — Monitor official NHTSA vehicle recall and complaint endpoints for watched model-family, VIN, and manufacturer feeds.
- [Product Safety Recall Digest | CPSC + openFDA Alerts](https://apify.com/taroyamada/product-safety-recall-digest) — Monitor CPSC saferproducts.
- [Regulatory Change Monitor API](https://apify.com/taroyamada/regulatory-change-monitor) — Monitor official regulator update feeds, government bulletin pages, and public compliance notices with one action-oriented digest row per monitored source.
- [OFAC Sanctions Change Digest | SDN List Monitor](https://apify.com/taroyamada/sanctions-change-digest) — Monitor the OFAC SDN (Specially Designated Nationals) sanctions list for additions and removals.
- [Tariff Trade Change Digest | Federal Register + HTS Monitor](https://apify.com/taroyamada/tariff-trade-change-digest) — Monitor U.
- [Treasury Fiscal Data Digest | Debt, Rates & Budget Monitor](https://apify.com/taroyamada/treasury-fiscal-data-digest) — Monitor the U.
- [USPTO Patent Monitor API | JSON + Webhook](https://apify.com/taroyamada/uspto-patent-scraper) — Search and monitor US patent filings with multi-source fallback.
- [Campaign Finance & Lobbying Digest | FEC + LDA Watch](https://apify.com/taroyamada/campaign-finance-lobbying-digest) — Monitor official FEC OpenFEC committee reports and LDA.

### Cost

**Pay Per Event**:

- `actor-start`: $0.01 (flat fee per run)
- `dataset-item`: $0.003 per output item

**Example**: 1,000 items = $0.01 + (1,000 × $0.003) = **$3.01**

No subscription required — you only pay for what you use.

# Actor input Schema

## `feeds` (type: `array`):

One entry per monitored feed or watchlist. Leave empty to use the default public warning\_letters\_latest feed. import\_alerts and govdelivery are optional advanced feeds and are not enabled by default in v1.

## `watchTerms` (type: `string`):

Applied to every feed in addition to any feed-level watchTerms. Matching new/changed items trigger action\_needed.

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

How far back to look for warning-letter posting dates, import-alert publish dates, or bulletin send dates.

## `maxItemsPerFeed` (type: `integer`):

Upper bound on normalized items per feed. Lower values keep recurring runs maintenance-light.

## `maxPagesPerFeed` (type: `integer`):

Only used for warning\_letters feeds. Stop after this many public datatables requests even if the lookback window is broader.

## `maxDetailFetchesPerFeed` (type: `integer`):

Cap on detail-page enrichment for import\_alerts feeds.

## `delivery` (type: `string`):

dataset writes digest rows to the Apify dataset; webhook POSTs the digest payload to webhookUrl.

## `webhookUrl` (type: `string`):

POST target for the digest payload.

## `datasetMode` (type: `string`):

all emits every digest row. action\_needed emits only feeds with changed items matching watch terms (plus errors). changed\_only emits only feeds with new or updated items (plus errors).

## `snapshotKey` (type: `string`):

Stable key used to persist prior signatures per record so new and updated warning letters/import alerts can be detected across scheduled runs.

## `notifyOnNoNew` (type: `boolean`):

When false, delivery outputs omit feeds with no new or updated items unless the feed errored. Local output/results.json still contains the full payload.

## `requestTimeoutSeconds` (type: `integer`):

Timeout for each public source request.

## `batchDelayMs` (type: `integer`):

Milliseconds to wait between feed fetches.

## `warningLettersApiUrl` (type: `string`):

Advanced override for the public FDA warning letters datatables endpoint.

## `importAlertsIndexUrl` (type: `string`):

Advanced override for the public import alerts by publish date page.

## `dryRun` (type: `boolean`):

Fetch and assemble the digest without persisting state or posting webhooks.

## `nowIso` (type: `string`):

Set to a fixed ISO timestamp to make runs deterministic against fixture data.

## Actor input object example

```json
{
  "lookbackDays": 30,
  "maxItemsPerFeed": 50,
  "maxPagesPerFeed": 5,
  "maxDetailFetchesPerFeed": 25,
  "delivery": "dataset",
  "datasetMode": "all",
  "snapshotKey": "fda-warning-letter-digest-state",
  "notifyOnNoNew": true,
  "requestTimeoutSeconds": 30,
  "batchDelayMs": 0,
  "warningLettersApiUrl": "https://www.fda.gov/datatables/views/ajax",
  "importAlertsIndexUrl": "https://www.accessdata.fda.gov/cms_ia/iapublishdate.html",
  "dryRun": 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("taroyamada/fda-warning-letter-digest").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("taroyamada/fda-warning-letter-digest").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 taroyamada/fda-warning-letter-digest --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=taroyamada/fda-warning-letter-digest",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "⚖️ FDA Warning Letters Scraper",
        "description": "Extract public FDA warning letters to discover actionable legal and consulting leads. Build targeted watchlists for compliance subjects and track enforcement dates.",
        "version": "0.1",
        "x-build-id": "hbTugrNevLgs9avZ6"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/taroyamada~fda-warning-letter-digest/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-taroyamada-fda-warning-letter-digest",
                "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/taroyamada~fda-warning-letter-digest/runs": {
            "post": {
                "operationId": "runs-sync-taroyamada-fda-warning-letter-digest",
                "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/taroyamada~fda-warning-letter-digest/run-sync": {
            "post": {
                "operationId": "run-sync-taroyamada-fda-warning-letter-digest",
                "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": {
                    "feeds": {
                        "title": "Feeds to monitor",
                        "type": "array",
                        "description": "One entry per monitored feed or watchlist. Leave empty to use the default public warning_letters_latest feed. import_alerts and govdelivery are optional advanced feeds and are not enabled by default in v1.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "title": "Feed ID",
                                    "description": "Stable identifier used in snapshots and output rows.",
                                    "type": "string"
                                },
                                "name": {
                                    "title": "Feed name",
                                    "description": "Human-readable label for this digest row.",
                                    "type": "string"
                                },
                                "source": {
                                    "title": "Source",
                                    "description": "warning_letters is the recommended v1 default. import_alerts and govdelivery are optional advanced sources for later expansion.",
                                    "type": "string",
                                    "enum": [
                                        "warning_letters",
                                        "import_alerts",
                                        "govdelivery"
                                    ]
                                },
                                "searchQuery": {
                                    "title": "Search query",
                                    "description": "Optional feed-scope query. For warning letters this is sent to the FDA datatables search endpoint; for other sources it is matched against parsed text.",
                                    "type": "string"
                                },
                                "watchTerms": {
                                    "title": "Feed watch terms (comma-separated)",
                                    "description": "Optional per-feed watchlist used to trigger action_needed when a new/changed item matches.",
                                    "type": "string"
                                },
                                "lookbackDays": {
                                    "title": "Lookback window (days, per-feed override)",
                                    "description": "Overrides the global lookbackDays for this feed only.",
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 365
                                },
                                "maxItems": {
                                    "title": "Max items for this feed",
                                    "description": "Upper bound on normalized items included for this feed in one run.",
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 200
                                },
                                "maxPages": {
                                    "title": "Max warning-letter pages for this feed",
                                    "description": "Only used for warning_letters feeds. Each datatables page fetches up to 100 rows.",
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 50
                                },
                                "issuingOffices": {
                                    "title": "Warning-letter issuing offices (comma-separated)",
                                    "description": "Optional exact-match filter for warning letter issuing offices, e.g. Center for Drug Evaluation and Research (CDER).",
                                    "type": "string"
                                },
                                "alertNumbers": {
                                    "title": "Import alert numbers (comma-separated)",
                                    "description": "Optional exact-match filter for import alerts, e.g. 66-40,99-41.",
                                    "type": "string"
                                },
                                "bulletinUrls": {
                                    "title": "GovDelivery bulletin URLs",
                                    "description": "Required for govdelivery feeds. Provide one or more public bulletin page URLs from content.govdelivery.com.",
                                    "type": "array",
                                    "editor": "json",
                                    "items": {
                                        "type": "string"
                                    }
                                },
                                "includeDetailPages": {
                                    "title": "Fetch import alert detail pages",
                                    "description": "When true, import_alerts feeds fetch and parse alert detail pages for reason/guidance excerpts. Recommended for watchlists.",
                                    "type": "boolean"
                                },
                                "detailFetchLimit": {
                                    "title": "Import alert detail page cap",
                                    "description": "Maximum number of import alert detail pages to fetch for this feed.",
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 100
                                }
                            },
                            "required": [
                                "source"
                            ]
                        }
                    },
                    "watchTerms": {
                        "title": "Global watch terms (comma-separated)",
                        "type": "string",
                        "description": "Applied to every feed in addition to any feed-level watchTerms. Matching new/changed items trigger action_needed."
                    },
                    "lookbackDays": {
                        "title": "Global lookback window (days)",
                        "minimum": 1,
                        "maximum": 365,
                        "type": "integer",
                        "description": "How far back to look for warning-letter posting dates, import-alert publish dates, or bulletin send dates.",
                        "default": 30
                    },
                    "maxItemsPerFeed": {
                        "title": "Max items per feed",
                        "minimum": 1,
                        "maximum": 200,
                        "type": "integer",
                        "description": "Upper bound on normalized items per feed. Lower values keep recurring runs maintenance-light.",
                        "default": 50
                    },
                    "maxPagesPerFeed": {
                        "title": "Max warning-letter datatables pages",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "Only used for warning_letters feeds. Stop after this many public datatables requests even if the lookback window is broader.",
                        "default": 5
                    },
                    "maxDetailFetchesPerFeed": {
                        "title": "Max import alert detail pages per feed",
                        "minimum": 0,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Cap on detail-page enrichment for import_alerts feeds.",
                        "default": 25
                    },
                    "delivery": {
                        "title": "Delivery mode",
                        "enum": [
                            "dataset",
                            "webhook"
                        ],
                        "type": "string",
                        "description": "dataset writes digest rows to the Apify dataset; webhook POSTs the digest payload to webhookUrl.",
                        "default": "dataset"
                    },
                    "webhookUrl": {
                        "title": "Webhook URL (required when delivery=webhook)",
                        "type": "string",
                        "description": "POST target for the digest payload."
                    },
                    "datasetMode": {
                        "title": "Dataset output mode",
                        "enum": [
                            "all",
                            "action_needed",
                            "changed_only"
                        ],
                        "type": "string",
                        "description": "all emits every digest row. action_needed emits only feeds with changed items matching watch terms (plus errors). changed_only emits only feeds with new or updated items (plus errors).",
                        "default": "all"
                    },
                    "snapshotKey": {
                        "title": "Snapshot key for recurring state",
                        "type": "string",
                        "description": "Stable key used to persist prior signatures per record so new and updated warning letters/import alerts can be detected across scheduled runs.",
                        "default": "fda-warning-letter-digest-state"
                    },
                    "notifyOnNoNew": {
                        "title": "Emit stable digest rows in delivery outputs",
                        "type": "boolean",
                        "description": "When false, delivery outputs omit feeds with no new or updated items unless the feed errored. Local output/results.json still contains the full payload.",
                        "default": true
                    },
                    "requestTimeoutSeconds": {
                        "title": "HTTP request timeout (seconds)",
                        "minimum": 5,
                        "maximum": 120,
                        "type": "integer",
                        "description": "Timeout for each public source request.",
                        "default": 30
                    },
                    "batchDelayMs": {
                        "title": "Delay between feeds (ms)",
                        "minimum": 0,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Milliseconds to wait between feed fetches.",
                        "default": 0
                    },
                    "warningLettersApiUrl": {
                        "title": "Warning letters datatables API URL",
                        "type": "string",
                        "description": "Advanced override for the public FDA warning letters datatables endpoint.",
                        "default": "https://www.fda.gov/datatables/views/ajax"
                    },
                    "importAlertsIndexUrl": {
                        "title": "Import alerts index URL",
                        "type": "string",
                        "description": "Advanced override for the public import alerts by publish date page.",
                        "default": "https://www.accessdata.fda.gov/cms_ia/iapublishdate.html"
                    },
                    "dryRun": {
                        "title": "Dry run (skip snapshot writes and delivery)",
                        "type": "boolean",
                        "description": "Fetch and assemble the digest without persisting state or posting webhooks.",
                        "default": false
                    },
                    "nowIso": {
                        "title": "Override current time (ISO string, for testing)",
                        "type": "string",
                        "description": "Set to a fixed ISO timestamp to make runs deterministic against fixture data."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
