{
  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}