# CDC WONDER & FluView — Public Health Data API (`nexgendata/cdc-wonder-fluview-public-health-surveillance`) Actor

Weekly hospitalizations + deaths for influenza, COVID-19, and RSV by US state and age group, normalized against the 5-year MMWR-week seasonal baseline. Pulled directly from CDC NHSN + NCHS provisional deaths + WONDER. Public health, pharma surveillance, insurance actuarial, hospital o

- **URL**: https://apify.com/nexgendata/cdc-wonder-fluview-public-health-surveillance.md
- **Developed by:** [NexGenData](https://apify.com/nexgendata) (community)
- **Categories:** Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $80.00 / 1,000 disease-week records

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 WONDER & FluView

CDC WONDER and FluView public-health surveillance records — disease counts by week, state and age group.

> Public regulatory/health data — not medical advice.

### ⏰ Run this as a monitoring subscription (recommended)
Regulatory data is monitoring data. Schedule a weekly sweep (`0 8 * * 1`) and catch new records as they post — an always-on official-records feed.

### 📊 What you get
Clean JSON, one record per record (full output has 18 fields):

- `disease` — Disease
- `week` — Week
- `year` — Year
- `week_ending_date` — Week ending date
- `state` — State
- `state_code` — State code
- `age_group` — Age group
- `case_count` — Case count
- `hospitalization_count` — Hospitalization count
- `hospitalization_rate_per_100k` — Hospitalization rate per 100k

**Pricing:** Pay-Per-Event; see the Pricing tab.

### 🤖 Use with AI agents
Point Claude, the OpenAI Agents SDK, an n8n flow or any MCP-aware client at it and pull official records on demand.

**Agentic payments (x402):** Supports agentic payment via x402 — agents can call this actor with USDC, no API key required.

### 🔗 Related regulatory actors
**FDA & public-health records family:**

[OpenFDA Drug](https://apify.com/nexgendata/openfda-drug-search) · [Drug Approvals](https://apify.com/nexgendata/fda-drug-approvals) · [Drug Shortages](https://apify.com/nexgendata/fda-drug-shortages-monitor) · [Purple Book](https://apify.com/nexgendata/fda-purple-book-biologics-biosimilars) · [Warning Letters/483](https://apify.com/nexgendata/fda-warning-letters-483-inspections) · [Pharma Pipeline](https://apify.com/nexgendata/fda-pharma-catalyst-pipeline) · [Adverse Events](https://apify.com/nexgendata/fda-adverse-events-faers-maude) · [Medical Devices](https://apify.com/nexgendata/medical-device-fda-intelligence)

**Product-safety recalls:** [NHTSA Recalls](https://apify.com/nexgendata/nhtsa-us-vehicle-recalls) · [NHTSA Defects](https://apify.com/nexgendata/nhtsa-vehicle-recall-defect-tracker) · [NHTSA Safety](https://apify.com/nexgendata/nhtsa-vehicle-safety-intelligence) · [CPSC Recalls](https://apify.com/nexgendata/cpsc-product-recalls)

**Agent front door — Healthcare & FDA MCP:** [Healthcare & FDA MCP](https://apify.com/nexgendata/healthcare-fda-intelligence-mcp)

---
*Public official records and enforcement data, assembled for research and monitoring.*

# Actor input Schema

## `disease` (type: `string`):

Which respiratory disease to track. `influenza` = seasonal flu, `covid-19` = SARS-CoV-2, `rsv` = respiratory syncytial virus, `any` = all three in one run. Death counts are available for influenza and COVID-19; RSV deaths are reported as null (CDC does not publish weekly RSV death counts).
## `state_filter` (type: `string`):

Comma-separated list of US state codes (e.g. `CA,NY,TX`) or full state names. Use `USA` for the national aggregate. Leave empty to pull every state + DC + PR + USA aggregate. Accepts both formats (`CA` or `California`).
## `age_group` (type: `string`):

Age stratum. The NHSN weekly admissions feed publishes one aggregate per jurisdiction/week — this actor apportions to the requested age bucket using the CDC FluView surveillance age distribution (`0-4`, `5-17`, `18-49`, `50-64`, `65+`). Use `all` for the unsplit aggregate.
## `weeks_back` (type: `integer`):

Look-back window in MMWR weeks. NHSN HRD updates every Friday. 52 weeks = one season; 104 weeks = two seasons (recommended for seasonal-baseline comparisons); 260 weeks = full 5 years (max).
## `compare_seasonal_baseline` (type: `boolean`):

If true, the actor fetches the 5-year NHSN history and emits `vs_5yr_seasonal_avg_pct` per record — the percent deviation from the same MMWR-week's 5-year average. This is the headline analyst-time-saver: instantly see which state/week is `+200%` vs trend.
## `max_records` (type: `integer`):

Hard cap on emitted records. A typical full-USA flu season run = ~52 weeks × 52 states × 1 disease ≈ 2,704 raw rows; the actor caps at 2000. Set to 5 for a smoke test, 200-2000 for analyst runs.

## Actor input object example

```json
{
  "disease": "influenza",
  "state_filter": "",
  "age_group": "all",
  "weeks_back": 52,
  "compare_seasonal_baseline": true,
  "max_records": 200
}
````

# 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 = {
    "disease": "influenza",
    "state_filter": "",
    "age_group": "all",
    "weeks_back": 52,
    "compare_seasonal_baseline": true,
    "max_records": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("nexgendata/cdc-wonder-fluview-public-health-surveillance").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 = {
    "disease": "influenza",
    "state_filter": "",
    "age_group": "all",
    "weeks_back": 52,
    "compare_seasonal_baseline": True,
    "max_records": 200,
}

# Run the Actor and wait for it to finish
run = client.actor("nexgendata/cdc-wonder-fluview-public-health-surveillance").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 '{
  "disease": "influenza",
  "state_filter": "",
  "age_group": "all",
  "weeks_back": 52,
  "compare_seasonal_baseline": true,
  "max_records": 200
}' |
apify call nexgendata/cdc-wonder-fluview-public-health-surveillance --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=nexgendata/cdc-wonder-fluview-public-health-surveillance",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "CDC WONDER & FluView — Public Health Data API",
        "description": "Weekly hospitalizations + deaths for influenza, COVID-19, and RSV by US state and age group, normalized against the 5-year MMWR-week seasonal baseline. Pulled directly from CDC NHSN + NCHS provisional deaths + WONDER. Public health, pharma surveillance, insurance actuarial, hospital o",
        "version": "0.0",
        "x-build-id": "C4JmULtUMIxaXI1D9"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/nexgendata~cdc-wonder-fluview-public-health-surveillance/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-nexgendata-cdc-wonder-fluview-public-health-surveillance",
                "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/nexgendata~cdc-wonder-fluview-public-health-surveillance/runs": {
            "post": {
                "operationId": "runs-sync-nexgendata-cdc-wonder-fluview-public-health-surveillance",
                "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/nexgendata~cdc-wonder-fluview-public-health-surveillance/run-sync": {
            "post": {
                "operationId": "run-sync-nexgendata-cdc-wonder-fluview-public-health-surveillance",
                "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": {
                    "disease": {
                        "title": "Disease",
                        "enum": [
                            "influenza",
                            "covid-19",
                            "rsv",
                            "any"
                        ],
                        "type": "string",
                        "description": "Which respiratory disease to track. `influenza` = seasonal flu, `covid-19` = SARS-CoV-2, `rsv` = respiratory syncytial virus, `any` = all three in one run. Death counts are available for influenza and COVID-19; RSV deaths are reported as null (CDC does not publish weekly RSV death counts).",
                        "default": "influenza"
                    },
                    "state_filter": {
                        "title": "State filter (optional)",
                        "type": "string",
                        "description": "Comma-separated list of US state codes (e.g. `CA,NY,TX`) or full state names. Use `USA` for the national aggregate. Leave empty to pull every state + DC + PR + USA aggregate. Accepts both formats (`CA` or `California`).",
                        "default": ""
                    },
                    "age_group": {
                        "title": "Age group",
                        "enum": [
                            "0-4",
                            "5-17",
                            "18-49",
                            "50-64",
                            "65+",
                            "all"
                        ],
                        "type": "string",
                        "description": "Age stratum. The NHSN weekly admissions feed publishes one aggregate per jurisdiction/week — this actor apportions to the requested age bucket using the CDC FluView surveillance age distribution (`0-4`, `5-17`, `18-49`, `50-64`, `65+`). Use `all` for the unsplit aggregate.",
                        "default": "all"
                    },
                    "weeks_back": {
                        "title": "Weeks back from today",
                        "minimum": 1,
                        "maximum": 260,
                        "type": "integer",
                        "description": "Look-back window in MMWR weeks. NHSN HRD updates every Friday. 52 weeks = one season; 104 weeks = two seasons (recommended for seasonal-baseline comparisons); 260 weeks = full 5 years (max).",
                        "default": 52
                    },
                    "compare_seasonal_baseline": {
                        "title": "Compare to 5-year seasonal baseline",
                        "type": "boolean",
                        "description": "If true, the actor fetches the 5-year NHSN history and emits `vs_5yr_seasonal_avg_pct` per record — the percent deviation from the same MMWR-week's 5-year average. This is the headline analyst-time-saver: instantly see which state/week is `+200%` vs trend.",
                        "default": true
                    },
                    "max_records": {
                        "title": "Max records",
                        "minimum": 1,
                        "maximum": 2000,
                        "type": "integer",
                        "description": "Hard cap on emitted records. A typical full-USA flu season run = ~52 weeks × 52 states × 1 disease ≈ 2,704 raw rows; the actor caps at 2000. Set to 5 for a smoke test, 200-2000 for analyst runs.",
                        "default": 200
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
