{
  "openapi": "3.0.1",
  "info": {
    "title": "CDC WONDER Scraper",
    "description": "Query CDC WONDER's public US health statistics: mortality (underlying cause of death, 1999-2020 and 2018-2023) and natality (births, 2007-2023), grouped by year, sex, race, Hispanic origin, age, and cause of death.",
    "version": "1.0",
    "x-build-id": "6Oy0qLLbjGKnXep3x"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~cdc-wonder-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-cdc-wonder-scraper",
        "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/crawlerbros~cdc-wonder-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-cdc-wonder-scraper",
        "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/crawlerbros~cdc-wonder-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-cdc-wonder-scraper",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Dataset",
            "enum": [
              "mortalityHistorical",
              "mortalityCurrent",
              "natality"
            ],
            "type": "string",
            "description": "Which CDC WONDER dataset to query.",
            "default": "mortalityHistorical"
          },
          "groupBy1": {
            "title": "Group results by (primary)",
            "enum": [
              "year",
              "sex",
              "race",
              "hispanicOrigin",
              "ageGroup",
              "causeOfDeath",
              "ageOfMother",
              "maritalStatus",
              "birthWeight",
              "gestationalAge"
            ],
            "type": "string",
            "description": "Primary axis to group results by. Mortality modes: year / sex / race / hispanicOrigin / ageGroup / causeOfDeath. Natality mode: year / sex / ageOfMother / race / hispanicOrigin / maritalStatus / birthWeight / gestationalAge.",
            "default": "year"
          },
          "groupBy2": {
            "title": "Group results by (secondary)",
            "enum": [
              "none",
              "year",
              "sex",
              "race",
              "hispanicOrigin",
              "ageGroup",
              "causeOfDeath",
              "ageOfMother",
              "maritalStatus",
              "birthWeight",
              "gestationalAge"
            ],
            "type": "string",
            "description": "Optional second axis to cross-tabulate with groupBy1. Leave as 'none' for a single-axis breakdown.",
            "default": "none"
          },
          "yearFrom": {
            "title": "Year from",
            "minimum": 1999,
            "maximum": 2023,
            "type": "integer",
            "description": "Start of year range. Mortality Historical: 1999-2020. Mortality Current: 2018-2023. Natality: 2007-2023.",
            "default": 2015
          },
          "yearTo": {
            "title": "Year to",
            "minimum": 1999,
            "maximum": 2023,
            "type": "integer",
            "description": "End of year range (inclusive). Values outside the selected dataset's range are clamped automatically.",
            "default": 2020
          },
          "sexFilter": {
            "title": "Filter: Sex",
            "enum": [
              "all",
              "F",
              "M"
            ],
            "type": "string",
            "description": "Restrict to one sex instead of All. Ignored if Sex is already selected as a Group By axis (in that case all sexes are broken out).",
            "default": "all"
          },
          "raceFilter": {
            "title": "Filter: Race (mode=mortalityHistorical or natality)",
            "enum": [
              "all",
              "1002-5",
              "A-PI",
              "2054-5",
              "2106-3",
              "100"
            ],
            "type": "string",
            "description": "Bridged-race category, used by the 1999-2020 mortality dataset and the natality dataset. Ignored in mortalityCurrent mode (use raceFilterCurrent instead).",
            "default": "all"
          },
          "raceFilterCurrent": {
            "title": "Filter: Race (mode=mortalityCurrent)",
            "enum": [
              "all",
              "1002-5",
              "A",
              "2054-5",
              "NHOPI",
              "2106-3",
              "M",
              "999"
            ],
            "type": "string",
            "description": "Single-race category, used by the 2018-2023 current mortality dataset only.",
            "default": "all"
          },
          "hispanicOriginFilter": {
            "title": "Filter: Hispanic origin (mortality modes)",
            "enum": [
              "all",
              "2135-2",
              "2186-2",
              "NS"
            ],
            "type": "string",
            "description": "Used by both mortality datasets (Historical and Current). For natality, use hispanicOriginFilterNatality.",
            "default": "all"
          },
          "hispanicOriginFilterNatality": {
            "title": "Filter: Mother's Hispanic origin (mode=natality)",
            "enum": [
              "all",
              "2135-2",
              "2186-5",
              "9"
            ],
            "type": "string",
            "description": "Used by the natality dataset only.",
            "default": "all"
          },
          "ageGroupFilter": {
            "title": "Filter: Age group (mortality modes)",
            "enum": [
              "all",
              "1",
              "1-4",
              "5-14",
              "15-24",
              "25-34",
              "35-44",
              "45-54",
              "55-64",
              "65-74",
              "75-84",
              "85+",
              "NS"
            ],
            "type": "string",
            "description": "Ten-year age band at time of death. Used by both mortality datasets.",
            "default": "all"
          },
          "ageOfMotherFilter": {
            "title": "Filter: Age of mother (mode=natality)",
            "enum": [
              "all",
              "15",
              "15-19",
              "20-24",
              "25-29",
              "30-34",
              "35-39",
              "40-44",
              "45-49",
              "50+"
            ],
            "type": "string",
            "description": "Mother's age band at birth. Natality dataset only.",
            "default": "all"
          },
          "maritalStatusFilter": {
            "title": "Filter: Marital status (mode=natality)",
            "enum": [
              "all",
              "1",
              "2",
              "9",
              "NR"
            ],
            "type": "string",
            "description": "Mother's marital status at birth. Natality dataset only.",
            "default": "all"
          },
          "icd10Category": {
            "title": "Filter: Cause of death (ICD-10 chapter, mortality modes)",
            "enum": [
              "all",
              "A00-B99",
              "C00-D48",
              "D50-D89",
              "E00-E88",
              "F01-F99",
              "G00-G98",
              "H00-H57",
              "H60-H93",
              "I00-I99",
              "J00-J98",
              "K00-K92",
              "L00-L98",
              "M00-M99",
              "N00-N98",
              "O00-O99",
              "P00-P96",
              "Q00-Q99",
              "R00-R99",
              "S00-T98",
              "V01-Y89",
              "Z00-Z99"
            ],
            "type": "string",
            "description": "Restrict to one top-level ICD-10 disease chapter. Used by both mortality datasets. Has no effect on natality.",
            "default": "all"
          },
          "includeAgeAdjustedRate": {
            "title": "Include age-adjusted rate (mode=mortalityHistorical)",
            "type": "boolean",
            "description": "Add the age-adjusted death rate (with 95% confidence interval) alongside the crude rate. Only available for the 1999-2020 historical mortality dataset.",
            "default": false
          },
          "maxItems": {
            "title": "Max records",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard cap on emitted records (rows in the result table, including subtotal/total rows).",
            "default": 500
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}