# CDC State Flu Activity Tracker (`automation-lab/cdc-flu-tracker`) Actor

Export the newest weekly CDC state and territory acute respiratory illness activity levels for surveillance snapshots and recurring trend archives.

- **URL**: https://apify.com/automation-lab/cdc-flu-tracker.md
- **Developed by:** [Stas Persiianenko](https://apify.com/automation-lab) (community)
- **Categories:** Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 State Flu Activity Tracker

Export weekly CDC state and territory respiratory activity data as clean, typed rows.

This Actor reads the official CDC **Level of Acute Respiratory Illness (ARI) Activity by State** dataset.
It turns the newest weekly snapshot into an Apify dataset ready for spreadsheets, dashboards, alerts, scheduled surveillance, and a trend archive built from recurring runs.

ARI includes respiratory diagnoses such as influenza, RSV, COVID-19, and the common cold.
It is a broad activity measure, not a case count and not an influenza-only diagnosis measure.

### What this CDC tracker does

- Fetches anonymous, aggregate public-health rows from the official CDC API.
- Returns the newest available weekly snapshot.
- Filters by exact state or territory names.
- Preserves the CDC activity label and source build timestamp.
- Adds the official source URL and the Actor fetch timestamp.
- Supports up to 10,000 accepted records if the CDC snapshot expands.
- Excludes `Data Unavailable` rows by default.

The source is updated by CDC weekly, normally on Fridays.
A scheduled Actor run can therefore maintain a simple longitudinal surveillance table without manual downloads.

### Who is it for

Public-health analysts can collect the same state-level indicator every week.

Data journalists can compare activity labels among selected states.

Healthcare strategy teams can feed a current activity signal into internal dashboards.

Researchers can schedule reproducible weekly snapshots and retain them as state-week history.

Automation teams can trigger downstream workflows when a state label changes.

This Actor is best when the buyer needs the CDC ARI activity label.
It is not a replacement for case-level records, laboratory positivity, hospitalization counts, or mortality datasets.

### Why use this Actor

The CDC source is already structured, but production workflows still need validation, filtering, normalization, retries, dataset storage, scheduling, and integrations.

The Actor packages those steps into one reusable run.
It does not require a browser, proxy, CDC account, or API key.

Every saved record has a stable state-week identity.
That makes repeated exports straightforward to merge or compare downstream.

### Extracted CDC data

| Field | Type | Meaning |
| --- | --- | --- |
| `weekEnd` | date | CDC MMWR week-ending date |
| `geography` | string | State, territory, or other CDC geography |
| `activityLevel` | string | CDC ARI activity label |
| `sourceBuildTimestamp` | string | Build timestamp supplied by the CDC dataset |
| `sourceUrl` | URL | Official CDC dataset page |
| `fetchedAt` | datetime | UTC time when this Actor fetched the row |

Activity labels are source values such as `Very Low`, `Low`, `Moderate`, or `Data Unavailable`.
The set may change if CDC revises its classification.

### Getting started

1. Open the Actor input page.
2. Leave `geographies` empty for nationwide coverage, or enter exact names such as `California` and `Texas`.
3. Choose whether to keep unavailable rows.
4. Set `maxItems` for the maximum accepted records.
5. Click **Start**.
6. Open the default dataset to download JSON, CSV, Excel, XML, or another Apify-supported format.

The prefilled input requests current records for California and Texas.

### Input parameters

#### `geographies`

Optional array of exact CDC geography names.
Matching is case-sensitive.
Examples include `California`, `New York`, `Texas`, and `Puerto Rico`.
Leave it empty to include all source geographies.

#### `includeUnavailable`

Defaults to `false`.
Enable it to retain records labeled `Data Unavailable` by CDC.

#### `maxItems`

An integer from 1 to 10,000.
The Actor stops after this many unique accepted state-week rows.

### Input examples

Current nationwide snapshot:

```json
{
  "includeUnavailable": false,
  "maxItems": 100
}
```

Current California and Texas activity:

```json
{
  "geographies": ["California", "Texas"],
  "includeUnavailable": false,
  "maxItems": 10
}
```

Complete weekly archive snapshot, including unavailable statuses:

```json
{
  "includeUnavailable": true,
  "maxItems": 100
}
```

### Output example

A current output row looks like this:

```json
{
  "weekEnd": "2026-07-18",
  "geography": "California",
  "activityLevel": "Very Low",
  "sourceBuildTimestamp": "2026-07-24T16:01:36.076Z",
  "sourceUrl": "https://data.cdc.gov/d/f3zz-zga5",
  "fetchedAt": "2026-07-29T03:20:00.000Z"
}
```

Dates and labels come from current source data and will change over time.
Use `weekEnd` plus `geography` as a practical downstream merge key.

### How much does it cost to export CDC state flu activity?

Pricing uses one `start` event per run plus one `item` event per saved state-week record.
The current pricing charges a $0.005 start fee.
The BRONZE item rate is $0.03472 per record, with lower unit prices on higher Apify tiers.

At the BRONZE rate:

- 2 current state rows cost about $0.07444.
- 50 current geography rows cost about $1.741.
- 56 complete snapshot rows cost about $1.94932.

These examples describe Actor event charges, not CDC charges.
The CDC public API does not require a paid key for this workflow.
Final event prices shown by Apify at run time are authoritative.

### Scheduling weekly surveillance

CDC says the dataset is updated weekly on Fridays.
Create an Apify schedule after the expected update window.

For trend storage:

1. Run the current snapshot after each CDC update.
2. Keep all desired geographies in scope.
3. Export or integrate the dataset after each run.
4. Upsert records by `weekEnd` and `geography`.
5. Compare `activityLevel` against the preceding saved week.

The Actor itself does not send alerts or maintain a cross-run change database.
Use Apify webhooks, integrations, or your destination system for that step.

### Spreadsheet and data-pipeline workflows

Open the run dataset and use its export URL to download CSV or Excel.

For a data warehouse, consume dataset items through the Apify API and merge by state-week.

For a dashboard, schedule the Actor and refresh the destination after successful runs.

For monitoring, route a webhook to Make, Zapier, Slack automation, or your own endpoint, then compare the new rows with prior records.

### Run with the Apify API

Replace `YOUR_TOKEN` with an Apify API token.

#### cURL

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/automation-lab~cdc-flu-tracker/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"geographies":["California","Texas"],"includeUnavailable":false,"maxItems":10}'
```

#### JavaScript

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/cdc-flu-tracker').call({
  geographies: ['California', 'Texas'],
  includeUnavailable: false,
  maxItems: 10,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient(token="YOUR_TOKEN")
run = client.actor("automation-lab/cdc-flu-tracker").call(run_input={
    "geographies": ["California", "Texas"],
    "includeUnavailable": False,
    "maxItems": 10,
})
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)
```

Do not put long-lived tokens directly into public code or notebooks.
Use environment variables or a secret manager.

### Use with Apify MCP

Add the Actor to Claude Code:

```bash
claude mcp add --transport http apify \
  "https://mcp.apify.com?tools=automation-lab/cdc-flu-tracker"
```

Use this same configuration in **Claude Desktop**, **Cursor**, or **VS Code**:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=automation-lab/cdc-flu-tracker"
    }
  }
}
```

Example prompts for MCP:

- “Use the CDC State Flu Activity Tracker MCP tool to export the latest CDC respiratory activity labels for all states.”
- “Run the MCP Actor for current activity in California, Texas, and New York.”
- “Use MCP to run a complete weekly snapshot, including unavailable statuses, for my surveillance archive.”

MCP tool availability depends on your Apify account and MCP client configuration.

### Data quality and limitations

The Actor reports the CDC source as published.
It does not estimate missing values or reinterpret activity labels.

ARI is broader than influenza.
Do not describe the output as confirmed flu cases.

The newest week can include `Data Unavailable` for some jurisdictions.
Enable `includeUnavailable` if absence itself matters to your workflow.

Exact geography matching is intentional.
A misspelled or differently cased geography can produce zero rows.

Snapshot availability and classifications are controlled by CDC.
The source currently exposes only the newest week and may revise field definitions, update timing, or labels.

The Actor uses the public Socrata API without an application token.
Very large or frequent workloads may encounter upstream throttling.
The Actor retries transient failures three times and then fails rather than returning a silently incomplete result.

### Legality and responsible use

The dataset contains aggregate, anonymous public-health indicators and no person-level records.

Use the output for legitimate analysis, reporting, planning, and automation.
Review CDC documentation before making health, clinical, or policy decisions.
Cite the official CDC source in public analysis.

This Actor is independent software and is not affiliated with or endorsed by CDC.
Users are responsible for complying with applicable terms, laws, and organizational policies.

### Troubleshooting

#### The dataset is empty

Check spelling and capitalization in `geographies`.
Remove date filters to confirm the geography exists in the current source.
If `includeUnavailable` is false, a selected geography may have no accepted current row.

#### I expected influenza case counts

This Actor returns CDC ARI activity labels.
It does not return cases, tests, positivity, hospitalizations, or deaths.
Choose a dataset designed for that measure instead.

#### The run failed with a CDC API error

Inspect the run log.
Transient failures are retried automatically.
If the official API remains unavailable, rerun later rather than treating partial data as complete.

#### I received fewer rows than `maxItems`

`maxItems` is a ceiling, not a promised count.
Filters, latest-week mode, duplicate prevention, and unavailable-row exclusion can all reduce output.

### FAQ

#### Is this a CDC flu tracker?

It supports flu-surveillance workflows through CDC's broad ARI activity measure.
Because ARI includes multiple respiratory illnesses, the label is not influenza-specific.

#### How fresh is the data?

CDC describes the source as updated weekly on Fridays.
Every row includes `sourceBuildTimestamp`, so you can inspect the source build used by a run.

#### Can I request every state at once?

Yes.
Leave `geographies` empty and keep `maxItems` high enough for the selected scope.

#### Can I export historical trends?

The CDC source used here exposes the newest snapshot rather than a historical series.
Schedule the Actor weekly and retain each dataset in your destination to build a trend history.

#### Does it need a proxy or CDC API key?

No.
It uses the official public CDC Socrata endpoint directly.

#### Does the Actor alert me when activity changes?

Not by itself.
Schedule runs and use a webhook or downstream comparison workflow.

#### Can I use the result in Google Sheets or Excel?

Yes.
Download the default dataset in CSV or Excel format, or connect it through an Apify integration.

### Related Automation Lab actors

This is currently a standalone public-health utility.
No other Automation Lab Actor is linked because a related product should add a distinct, verified health-surveillance output rather than duplicate the same source rows.

Browse the [Automation Lab profile](https://apify.com/automation-lab) for general data-extraction and integration tools.

# Actor input Schema

## `geographies` (type: `array`):

Optional exact CDC geography names, such as California, Texas, or Puerto Rico. Matching is case-sensitive.

## `includeUnavailable` (type: `boolean`):

Include rows whose CDC activity label is Data Unavailable.

## `maxItems` (type: `integer`):

Maximum number of current geography records to save, from 1 to 10,000.

## Actor input object example

```json
{
  "geographies": [
    "California",
    "Texas"
  ],
  "includeUnavailable": false,
  "maxItems": 10
}
```

# Actor output Schema

## `overview` (type: `string`):

Open all state and territory activity rows in the overview view.

# 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 = {
    "geographies": [
        "California",
        "Texas"
    ],
    "includeUnavailable": false,
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/cdc-flu-tracker").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 = {
    "geographies": [
        "California",
        "Texas",
    ],
    "includeUnavailable": False,
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/cdc-flu-tracker").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 '{
  "geographies": [
    "California",
    "Texas"
  ],
  "includeUnavailable": false,
  "maxItems": 10
}' |
apify call automation-lab/cdc-flu-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=automation-lab/cdc-flu-tracker",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/a0ySkAG21ee3zp91M/builds/MlZwaWmst7xCMQSSm/openapi.json
