Query Australian Bureau of Statistics (ABS) datasets via natural language and return data with citations. Use when: (1) the user asks about Australian economic indicators (CPI, inflation, GDP, wages, unemployment, retail trade, housing prices, job vacancies, population, births, deaths, migration, trade); (2) the user wants live ABS data or time series; (3) the user asks to compare ABS statistics across states, periods, or industries; (4) the user wants to visualise or export ABS data (chart, CSV, table); (5) any request referencing ABS catalogue numbers (e.g. 6401.0, 6202.0) or ABS dataset names. NOT for: Census DataPacks (use the census-database skill instead).
Query live ABS datasets, return data + citations, optional tables/charts/reports.
| File | Purpose |
|---|---|
scripts/abs_cache.py | Metadata cache manager — refresh catalog, search all 1,200+ dataflows, generate structured metadata |
scripts/abs_search.py | NL → dataset mapper — curated lookup + fuzzy fallback + ambiguity detection |
scripts/abs_query.py | Query engine — fetches data, formats output, summary/report/describe modes |
scripts/test_presets.py | Preset validation — tests all presets against live API, pass/fail summary |
presets.json | 20 validated preset queries for common indicators |
metadata.overrides.json | Manual overrides for discontinued datasets and nicer labels |
references/dataset-catalog.md | ~55 curated datasets with IDs, versions, notes (human reference) |
references/api-guide.md | ABS API URL patterns, response structure, example queries |
references/sdmx-patterns.md | Dimension codes (REGION, TSEST, FREQ, MEASURE) per dataset |
# 1. Warm the cache (do once; auto-refreshes after 24h)
python3 scripts/abs_cache.py refresh
python3 scripts/abs_cache.py gen-metadata
# 2. Search for a dataset (with ambiguity hints)
python3 scripts/abs_search.py "unemployment rate"
# 3. List presets
python3 scripts/abs_query.py --list-presets
# 4. Describe a preset
python3 scripts/abs_query.py --describe-preset cpi-annual-change
# 5. Query latest
python3 scripts/abs_query.py --preset cpi-annual-change --latest --format table
# 6. Summary brief (latest + change context)
python3 scripts/abs_query.py --preset cpi-annual-change --summary latest
# 7. Macro snapshot
python3 scripts/abs_query.py --report macro-snapshot
# 8. Chart
python3 scripts/abs_query.py --preset gdp-chain-volume --start-period 2020-Q1 --chart
references/dataset-catalog.md for the dataflow ID and versionpython3 scripts/abs_search.py "<user query>" for fuzzy match + ambiguity hintspython3 scripts/abs_cache.py search "<term>" (searches all 1,200+ dataflows)presets.json — if a preset exists, use it directlyreferences/sdmx-patterns.md for common dimension codespython3 scripts/abs_cache.py structure <ID> <VERSION>
python3 scripts/abs_query.py <ID> [KEY] [--version V] [--start-period P] [--end-period P] [--latest] [--format text|csv|json|table] [--chart] [--out FILE]
--format table for markdown tables.matplotlib; gracefully falls back if not installed.--summary latest for quick briefs with change context.--report macro-snapshot for a full multi-indicator briefing.Common indicator queries are bundled in presets.json. All validated live March 2026.
# List all available presets
python3 scripts/abs_query.py --list-presets
# Describe a preset (shows what it measures and when to use it)
python3 scripts/abs_query.py --describe-preset unemployment-rate
# Run a preset
python3 scripts/abs_query.py --preset cpi-annual-change --latest --format table
python3 scripts/abs_query.py --preset unemployment-rate --latest
python3 scripts/abs_query.py --preset gdp-annual-change --chart
python3 scripts/abs_query.py --preset wage-annual-change --start-period 2020-Q1
python3 scripts/abs_query.py --preset population-national --format csv
python3 scripts/abs_query.py --preset dwelling-prices-mean --format table
python3 scripts/abs_query.py --preset trade-balance --start-period 2024-01
python3 scripts/abs_query.py --preset household-spending-change --summary latest
Key presets: cpi-annual-change, unemployment-rate, participation-rate, employment-level,
underemployment-rate, labour-force-size, gdp-annual-change, wage-annual-change,
population-national, dwelling-prices-mean, trade-balance, goods-exports, goods-imports,
household-spending-change.
| Flag | Output |
|---|---|
| (default) | Human-readable text with friendly labels + citation |
--format table | Markdown table with friendly labels and rendered periods |
--format csv | CSV with raw codes + citation comment |
--format json | JSON with raw codes + *_label fields + TIME_PERIOD_rendered |
--chart | PNG chart with dataset title, subtitle, latest-point annotation |
--summary latest | Latest value + previous + absolute/percentage-point deltas + textual summary |
--report macro-snapshot | Compact multi-indicator macro briefing (7 key economic indicators) |
--citation-style analyst | Analyst-style source footnote block |
--flat-view | AllDimensions format (wider; may be large) |
All output modes now render periods in human-readable format:
2026-01 → January 20262025-Q4 → December quarter 20252025-Q1 → March quarter 2025March quarter 2024 to December quarter 2025This applies to table headers, text output, citations, chart labels, and summary/report output.
--format json returns both raw dimension codes and friendly *_label fields:
{
"TSEST": "20",
"TSEST_label": "Seasonally Adjusted",
"TIME_PERIOD": "2026-02",
"TIME_PERIOD_rendered": "February 2026",
"value": 4.277
}
Backward compatible — raw codes are preserved.
abs_search.py classifies ambiguity when multiple datasets match:
Prints clarifying questions to help the user or agent narrow the query.
| Command | Description |
|---|---|
abs_cache.py refresh | Fetch all dataflows from ABS, save to ~/.cache/abs-data-api/catalog.json |
abs_cache.py gen-metadata | Generate metadata.generated.json from presets + catalog + overrides |
abs_cache.py status | Show cache age, dataflow count, structure count, metadata status |
abs_cache.py search <term> | Search across all cached dataflows |
abs_cache.py structure <ID> [VER] | Fetch and cache DSD for a specific dataflow |
Runtime metadata priority: metadata.generated.json > catalog.json > dataset-catalog.md.
Override quirks (discontinued datasets, nicer labels) in metadata.overrides.json.
python3 scripts/test_presets.py # test all presets
python3 scripts/test_presets.py --verbose # with timing
python3 scripts/test_presets.py --preset unemployment-rate # single
CPI beats CPI_M beats PPI.all — the API will return everything; then filter. If the response is large (>100 observations), the tool warns you.1.0.0 as last resort.--latest flag (uses lastNObservations=1).census-database skill; this skill handles ABS time-series only.HSI_M or BUSINESS_TURNOVER instead.RES_DWELL_ST for current dwelling prices.All responses include a citation:
Source: Australian Bureau of Statistics,
<Full Dataset Name>(Cat.<catalogue-number>; dataset<ID>; v<version>).<human-readable-period>. Retrieved via ABS Data API:<url>.
Example:
Source: Australian Bureau of Statistics, Consumer Price Index (Cat. 6401.0; dataset
CPI; v2.0.0). January 2026. Retrieved via ABS Data API:https://data.api.abs.gov.au/rest/data/ABS,CPI,2.0.0/.
gen-metadata command: Builds unified metadata from presets + live catalog + manual overridespython3 scripts/abs_cache.py gen-metadata
python3 scripts/abs_search.py "inflation" # May suggest CPI, CPI_M, PPI with clarifying Qs
--summary latest: Shows latest value + previous + absolute deltas + brief summarypython3 scripts/abs_query.py --preset unemployment-rate --summary latest
# Output: Current: 4.3% | Previous: 4.0% (Feb) | Change: +0.3pp | [Brief context]
--report macro-snapshot: Single-command economic briefing covering 7 key indicatorspython3 scripts/abs_query.py --report macro-snapshot
The query engine appends this automatically. Do not strip it from tool output.
New Features:
gen-metadata command) — builds unified metadata from presets + catalog + overrides with auto-refresh--summary latest) — shows latest + previous + absolute deltas + brief summary--report macro-snapshot) — single-command economic briefing covering 7 key indicatorsintent_group and ambiguity_tags for smarter disambiguationImprovements:
Affected Scripts:
abs_cache.py — added gen-metadata command and generate_metadata() functionabs_search.py — added ambiguity detection, intent grouping, and clarifying questionsabs_query.py — added --summary latest, --report macro-snapshot, percentage-point delta detectionmetadata.overrides.json — new file for manual dataset overrides