get_data
Query curated AIHW health datasets to retrieve mortality, cancer, hospital, and expenditure observations with optional filters and time periods.
Instructions
Query a curated AIHW dataset and return observations.
Examples: # Deaths from diabetes, all years and sexes resp = await get_data( "GRIM_DEATHS", filters={"cause_of_death": "Diabetes"}, measures="deaths", )
# Breast cancer incidence in females over time
resp = await get_data(
"CANCER_INCIDENCE_MORTALITY",
filters={"cancer_type": "Breast cancer", "sex": "Female", "type": "Incidence"},
)
# Public hospitals in NSW with peer group "Principal referral"
resp = await get_data(
"PUBLIC_HOSPITALS",
filters={"state": "NSW", "peer_group_name": "Principal referral"},
)Returns: DataResponse with records (or csv), unit, period bounds, row_count, source URL, and CC-BY attribution.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_id | Yes | Curated dataset ID. Use search_datasets() / list_curated(). | |
| filters | No | Dimension filters. Keys are plain-English aliases from the dataset's describe_dataset response. Values are matched against the source data; pass a list to OR across values. Examples: {'sex': 'female'}, {'year': '2023'}, {'cause_of_death': ['Diabetes', 'Stroke']}. | |
| measures | No | Which measure(s) to return. Plain-English keys from describe_dataset. Omit to return all measures. | |
| start_period | No | Inclusive start period for transposed time-series datasets. Ignored for wide single-year tables. Format: 'YYYY' or 'YYYY-MM'. | |
| end_period | No | Inclusive end period. Same format as start_period. | |
| format | No | Response shape. 'records' (default): flat list of observations. 'series': grouped by measure. 'csv': pandas CSV string in `csv` field. | records |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_id | Yes | ||
| dataset_name | Yes | ||
| query | No | ||
| period | No | ||
| unit | No | ||
| row_count | No | ||
| records | No | ||
| csv | No | ||
| source | No | Australian Institute of Health and Welfare | |
| attribution | No | Data sourced from the Australian Institute of Health and Welfare (AIHW) via data.gov.au. Licensed under Creative Commons Attribution 3.0 Australia (CC BY 3.0 AU). https://creativecommons.org/licenses/by/3.0/au/ | |
| retrieved_at | Yes | ||
| aihw_url | Yes | ||
| server_version | No |