get_data
Retrieve Australian Bureau of Statistics observations for any dataflow. Filter by dimensions like region or measure and specify a period range for precise time-series data.
Instructions
Query an ABS dataflow and return observations.
Pass filters and/or a period range — unfiltered queries on large dataflows can return tens of thousands of observations.
Curated dataflows accept plain-English filter keys and values that
are translated to SDMX codes server-side. For example, on LF:
{"region": "nsw", "measure": "unemployment_rate"} resolves to
SDMX key M13.3.1599.20.1.M with hidden-dim defaults auto-applied.
Examples: # NSW unemployment monthly for 2024 resp = await get_data( "LF", filters={"region": "nsw", "measure": "unemployment_rate"}, start_period="2024", end_period="2024-12", ) # → resp.records[0]: period='2024-01', value=4.8, unit='Percent'
# Multi-state comparison
resp = await get_data(
"LF",
filters={"region": ["nsw","vic","qld"], "measure": "unemployment_rate"},
start_period="2024",
format="csv",
)
# → resp.csv contains 36 rows (3 states × 12 months)
# Australia quarterly CPI annual change
resp = await get_data(
"CPI",
filters={"region": "australia", "measure": "change_year"},
start_period="2020",
)When to use: - You want observations over a time range (use latest() for the most-recent only) - You want a multi-state or multi-measure comparison via list filters - You want a CSV for downstream charting / spreadsheet tools
Returns: DataResponse with records (list of {period, value, dimensions, unit}), unit (when homogeneous), period bounds, the resolved query echo, the ABS source URL, and the CC-BY 4.0 attribution string.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_id | Yes | ABS dataflow ID like 'LF', 'CPI'. Use search_datasets to discover. | |
| filters | No | Dimension filters. For curated dataflows: plain-English keys and values, e.g. {'region': 'nsw', 'measure': 'unemployment_rate'}. For raw dataflows: SDMX dimension IDs and codes. Pass a list as the value to query multiple values for a dimension. Whitespace is stripped; empty list / empty value rejected with a hint. | |
| start_period | No | Inclusive start period. Format follows the dataflow's cadence: annual 'YYYY' (e.g. '2020'), monthly 'YYYY-MM' (e.g. '2024-03'), quarterly 'YYYY-Q1', half-yearly 'YYYY-S1', daily 'YYYY-MM-DD'. An int year (e.g. 2024) is also accepted and treated as 'YYYY'. URL-unsafe characters (?, &, /, etc.) are rejected at the boundary. | |
| end_period | No | Inclusive end period. Same format as start_period. | |
| format | No | Response shape. 'records' (default): flat list of observations. 'series': observations grouped by dimension key for chart-friendly shapes. 'csv': returns the table as a CSV string in the `csv` field with records empty. | records |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_id | Yes | ||
| dataset_name | Yes | ||
| query | No | ||
| period | No | ||
| unit | No | ||
| records | No | ||
| csv | No | ||
| source | No | Australian Bureau of Statistics | |
| attribution | No | Data sourced from the Australian Bureau of Statistics and licensed under Creative Commons Attribution 4.0 International (CC BY 4.0). https://www.abs.gov.au/about/copyright-and-creative-commons | |
| retrieved_at | Yes | ||
| abs_url | Yes | ||
| server_version | No |