# CDC NNDSS Weekly Outbreak & Disease Anomaly Monitor (`malonestar/cdc-nndss-outbreak-monitor`) Actor

Monitor CDC NNDSS weekly notifiable-disease cases. Computes spike ratio (current vs 52-week max), YoY cumulative change, and flags outbreak anomalies (new 52-week highs / spikes) per disease and reporting area. Keyless.

- **URL**: https://apify.com/malonestar/cdc-nndss-outbreak-monitor.md
- **Developed by:** [Kyle Maloney](https://apify.com/malonestar) (community)
- **Categories:** Lead generation, Developer tools, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

## CDC NNDSS Weekly Outbreak & Disease Anomaly Monitor

Turn the CDC's **National Notifiable Diseases Surveillance System (NNDSS)** weekly provisional case tables into a clean, deduplicated feed of **outbreak signals**. For every disease, reporting area, and MMWR week the actor computes a **spike ratio** (this week vs. the prior 52-week peak), the **year-over-year cumulative change**, and flags **anomalies** — new 52-week highs and case spikes — so you can catch emerging outbreaks the moment CDC publishes them.

Data source: CDC NNDSS weekly data on `data.cdc.gov` (Socrata resource `x9gk-5huc`). **Keyless** — no API token required.

### Who uses this

- **Pharma & vaccine demand forecasting** — track measles, pertussis, influenza-associated conditions, and other vaccine-preventable diseases by region and week.
- **Public-health & epidemiology analytics** — a ready-to-model surveillance feed with spike and YoY metrics already computed.
- **Newsrooms & data journalists** — surface where a disease just hit a 52-week high.
- **Health-tech & risk teams** — feed outbreak signals into dashboards and alerts.

### Example input

```json
{
  "diseases": ["Measles"],
  "areas": ["Colorado", "New England"],
  "year": "2026",
  "anomalyThreshold": "2.0",
  "onlyAnomalies": false,
  "maxResults": 1000
}
````

Leave `diseases`, `areas`, and `year` empty to pull every notifiable condition for all available weeks (bounded by `maxResults`). Disease and area matching is **case-insensitive substring** — `"Measles"` matches `"Measles, Total"` and `"Measles, Imported"`.

### Output fields

One row per **disease x reporting area x MMWR week**:

| field | meaning |
|-------|---------|
| `disease` | NNDSS condition label |
| `reporting_area` | State / region / national reporting area |
| `year`, `week` | MMWR year and week |
| `current_week_cases` | Cases this week (NNDSS m1; null if suppressed) |
| `max_52wk` | Max weekly count over the prior 52 weeks (m2) |
| `cum_ytd` | Cumulative cases year-to-date (m3) |
| `cum_prior_ytd` | Cumulative cases, same period prior year (m4) |
| `spike_ratio` | `current_week_cases / max_52wk` (zero-safe; null when max is 0) |
| `yoy_cum_change_pct` | `(cum_ytd - cum_prior_ytd) / cum_prior_ytd * 100` (zero-safe) |
| `anomaly` | True for a new 52-week high or a spike at/above the threshold |
| `anomaly_reasons` | `new_52wk_high` and/or `spike_ratio>=<threshold>` |
| `sort_order` | NNDSS stable sort key |

### Filters

- `diseases[]`, `areas[]` — case-insensitive substring, OR-ed within each list.
- `year`, `weekFrom`, `weekTo` — time window.
- `minCases` — minimum current-week count.
- `anomalyThreshold` — spike multiple (default 2.0).
- `onlyAnomalies` — return only flagged rows.
- `maxResults` — hard cap.

### Use as an MCP tool

This actor is available to AI agents (Claude, Cursor, etc.) via `mcp.apify.com` — an agent can call it to fetch weekly outbreak anomalies and chain the structured rows into a larger public-health or forecasting workflow.

### FAQ

**How do I detect a measles outbreak by state?** Set `diseases: ["Measles"]`, add your `areas`, and set `onlyAnomalies: true` to get only the disease-weeks that hit a new 52-week high or spiked.

**Where does the data come from?** CDC NNDSS weekly provisional case tables published on `data.cdc.gov` (Socrata `x9gk-5huc`), keyless.

**What does spike ratio mean?** Current-week cases divided by the highest weekly count in the prior 52 weeks. A ratio at or above 1 means this week matched or beat the year's peak.

**Why are some case counts null?** CDC suppresses small or non-notifiable cells; those arrive as flags with no numeric value and are returned as null.

**How current is the data?** It tracks CDC's weekly publishing cadence (provisional MMWR weeks), typically updated within days of each MMWR week.

# Actor input Schema

## `diseases` (type: `array`):

List of NNDSS disease/condition names to match (case-insensitive substring, e.g. "Measles" matches "Measles, Total" and "Measles, Imported"). Leave empty to include every notifiable condition. Multiple terms are OR-ed.

## `areas` (type: `array`):

List of reporting areas to match (case-insensitive substring against the NNDSS 'states' column), e.g. \["Colorado", "New England", "U.S. Residents"]. Leave empty for all reporting areas. Multiple terms are OR-ed.

## `year` (type: `string`):

MMWR reporting year to filter on, e.g. "2026". Leave blank to include all available years (the dataset currently spans 2022 to the latest published week). Do not hard-code a stale year for recurring runs.

## `weekFrom` (type: `integer`):

Optional lower bound MMWR week number (1-53). Rows before this week are excluded. Leave blank for no lower bound.

## `weekTo` (type: `integer`):

Optional upper bound MMWR week number (1-53). Rows after this week are excluded. Leave blank for no upper bound.

## `minCases` (type: `integer`):

Only keep rows whose current-week case count (m1) is at least this value. Rows with suppressed / null current counts are excluded when this is above 0. Default 0 keeps everything.

## `anomalyThreshold` (type: `string`):

Flag a disease-week as an anomaly when spike\_ratio (current-week cases / max of prior 52 weeks) is at or above this multiple. Default 2.0 (current at least double the 52-week peak). New 52-week highs are always flagged regardless.

## `onlyAnomalies` (type: `boolean`):

When true, only disease-week rows flagged as anomalies (new 52-week high, or spike\_ratio at/above the threshold) are returned. Useful for outbreak-alert monitoring.

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

Hard cap on the number of disease-week rows returned across all pages (protects run time and cost). Default 1000.

## Actor input object example

```json
{
  "diseases": [
    "Measles"
  ],
  "areas": [],
  "year": "",
  "minCases": 0,
  "anomalyThreshold": "2.0",
  "onlyAnomalies": false,
  "maxResults": 1000
}
```

# Actor output Schema

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

The default dataset.

# 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 = {
    "diseases": [
        "Measles"
    ],
    "anomalyThreshold": "2.0",
    "maxResults": 1000
};

// Run the Actor and wait for it to finish
const run = await client.actor("malonestar/cdc-nndss-outbreak-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 = {
    "diseases": ["Measles"],
    "anomalyThreshold": "2.0",
    "maxResults": 1000,
}

# Run the Actor and wait for it to finish
run = client.actor("malonestar/cdc-nndss-outbreak-monitor").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 '{
  "diseases": [
    "Measles"
  ],
  "anomalyThreshold": "2.0",
  "maxResults": 1000
}' |
apify call malonestar/cdc-nndss-outbreak-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=malonestar/cdc-nndss-outbreak-monitor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "CDC NNDSS Weekly Outbreak & Disease Anomaly Monitor",
        "description": "Monitor CDC NNDSS weekly notifiable-disease cases. Computes spike ratio (current vs 52-week max), YoY cumulative change, and flags outbreak anomalies (new 52-week highs / spikes) per disease and reporting area. Keyless.",
        "version": "1.0",
        "x-build-id": "rolaJmmCbxo6vLgoR"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/malonestar~cdc-nndss-outbreak-monitor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-malonestar-cdc-nndss-outbreak-monitor",
                "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/malonestar~cdc-nndss-outbreak-monitor/runs": {
            "post": {
                "operationId": "runs-sync-malonestar-cdc-nndss-outbreak-monitor",
                "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/malonestar~cdc-nndss-outbreak-monitor/run-sync": {
            "post": {
                "operationId": "run-sync-malonestar-cdc-nndss-outbreak-monitor",
                "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": {
                    "diseases": {
                        "title": "Diseases / conditions",
                        "type": "array",
                        "description": "List of NNDSS disease/condition names to match (case-insensitive substring, e.g. \"Measles\" matches \"Measles, Total\" and \"Measles, Imported\"). Leave empty to include every notifiable condition. Multiple terms are OR-ed.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "areas": {
                        "title": "Reporting areas / states",
                        "type": "array",
                        "description": "List of reporting areas to match (case-insensitive substring against the NNDSS 'states' column), e.g. [\"Colorado\", \"New England\", \"U.S. Residents\"]. Leave empty for all reporting areas. Multiple terms are OR-ed.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "year": {
                        "title": "MMWR year",
                        "type": "string",
                        "description": "MMWR reporting year to filter on, e.g. \"2026\". Leave blank to include all available years (the dataset currently spans 2022 to the latest published week). Do not hard-code a stale year for recurring runs.",
                        "default": ""
                    },
                    "weekFrom": {
                        "title": "Week from (MMWR week)",
                        "type": "integer",
                        "description": "Optional lower bound MMWR week number (1-53). Rows before this week are excluded. Leave blank for no lower bound."
                    },
                    "weekTo": {
                        "title": "Week to (MMWR week)",
                        "type": "integer",
                        "description": "Optional upper bound MMWR week number (1-53). Rows after this week are excluded. Leave blank for no upper bound."
                    },
                    "minCases": {
                        "title": "Minimum current-week cases",
                        "type": "integer",
                        "description": "Only keep rows whose current-week case count (m1) is at least this value. Rows with suppressed / null current counts are excluded when this is above 0. Default 0 keeps everything.",
                        "default": 0
                    },
                    "anomalyThreshold": {
                        "title": "Spike ratio anomaly threshold",
                        "type": "string",
                        "description": "Flag a disease-week as an anomaly when spike_ratio (current-week cases / max of prior 52 weeks) is at or above this multiple. Default 2.0 (current at least double the 52-week peak). New 52-week highs are always flagged regardless.",
                        "default": "2.0"
                    },
                    "onlyAnomalies": {
                        "title": "Only return anomalies",
                        "type": "boolean",
                        "description": "When true, only disease-week rows flagged as anomalies (new 52-week high, or spike_ratio at/above the threshold) are returned. Useful for outbreak-alert monitoring.",
                        "default": false
                    },
                    "maxResults": {
                        "title": "Maximum results",
                        "type": "integer",
                        "description": "Hard cap on the number of disease-week rows returned across all pages (protects run time and cost). Default 1000.",
                        "default": 1000
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
