ausdata-cli
v0.2.0
Published
CLI for the Australian public data API. ausdata.io
Maintainers
Readme
ausdata-cli
The Australian public data API, from your terminal.
A pipe-friendly CLI for ausdata.io — the unified API across 9 Australian public-data sources (ABS, RBA, ATO, APRA, AIHW, ASIC, Open-Meteo / BOM, AEMO, WGEA). JSON to stdout by default; CSV and table formats available.
Install
npm install -g ausdata-cli
# or one-shot
npx ausdata-cli wages --start 2019-Q1Quick start
# 1. Authenticate (sign up at https://ausdata.io for a key)
ausdata login ak_xxxxxxxxxxxxxxxx
# 2. Inspect your account
ausdata whoami
# 3. Fetch real-wages — nominal wage growth minus inflation, quarterly
ausdata wages --start 2019-Q1 --format csv > real_wages.csvCommands
ausdata login [api-key] Save an API key to ~/.ausdata/config.json
ausdata logout Remove the saved API key
ausdata whoami Show the current key + tier + monthly usage
ausdata health GET /v1/health (no auth)
ausdata search "<query>" GET /v1/search-datasets
ausdata list <source> GET /v1/datasets/<source> — enumerate curated datasets
ausdata describe <source.id> GET /v1/describe/<source>/<id> — show schema, valid filters
ausdata wages GET /v1/real-wages
ausdata dashboard GET /v1/economic-dashboard
ausdata get <source.id> GET /v1/data/<source>/<id> — fetch any datasetGlobal flags
--api-key <key> Override AUSDATA_API_KEY env / config file
--base-url <url> Override default https://ausdata-api.fly.dev
--format json|csv|table Output format (default: json)
--no-color Disable ANSI colour
--verbose Print HTTP details to stderr
--help Show command helpExamples
# Real-wages CSV ready for Datawrapper
ausdata wages --start 2019-Q1 --format csv > real_wages.csv
# Economic dashboard, piped to jq
ausdata dashboard | jq '.data.cash_rate_pct'
# Search the catalogue
ausdata search "unemployment" --limit 5 --format table
# Generic dataset with filters
ausdata get abs.LF --filter region=nsw --start 2024-01 --end 2024-12Configuration
The CLI stores config at ~/.ausdata/config.json:
{
"api_key": "ak_xxxxxxxxxxxxxxxx",
"base_url": "https://api.ausdata.io"
}API-key resolution order
--api-keyflagAUSDATA_API_KEYenvironment variable~/.ausdata/config.json(created byausdata login)
If none of the above resolve to a key, the CLI exits with an instruction to
run ausdata login.
Output formats
--format json(default): pretty-printed JSON to stdout--format csv: CSV with header row, derived from thedataarray--format table: ANSI-formatted table (plain text in non-TTY)
Errors always go to stderr; stdout is safe to pipe to jq, > file.csv, etc.
Exit codes
| Code | Meaning | |------|---------| | 0 | Success | | 1 | Generic error (HTTP 4xx / 5xx, network) | | 2 | Auth error (no key, 401, 403) | | 3 | Rate limited (HTTP 429) | | 4 | Config error |
Versioning
Semantic versioning. The CLI tracks the API at https://api.ausdata.io/v1/ —
breaking API changes will bump the CLI major version.
License
MIT. See LICENSE.
Links
- ausdata.io — sign up, browse the docs
- API reference — endpoint specs
