Every endpoint returns JSON, sets Access-Control-Allow-Origin: *, and supports OPTIONS. Peer AMETS projects can fetch cross-origin from this preview URL.
The preview URL for this project (from tf preview) is your API root. Peer projects should read it from their environment rather than hard-coding it.
/api/healthHealth probe. Returns build info + counts.
/api/jurisdictionsAll jurisdictions AMETS legislation covers.
/api/actsFlat index of every instrument (metadata only, no `notes`/`sections`).
/api/acts?jurisdiction=au-wa&domain=miningFilter by any combination of `jurisdiction`, `domain`, `status`, `type`.
/api/acts/{jurisdiction}/{slug}One full instrument record.
Try: /api/acts/au-cth/work-health-and-safety-act-2011/api/acts/{jurisdiction}/{slug}/textRaw markdown of the full text if ingested, otherwise 404.
Try: /api/acts/au-cth/work-health-and-safety-act-2011/textconst BASE = process.env.AMETS_LEGISLATION_URL // your preview URL
// list every WA mining instrument
const res = await fetch(`${BASE}/api/acts?jurisdiction=au-wa&domain=mining`)
const { acts } = await res.json()
// fetch one full record
const one = await fetch(`${BASE}/api/acts/au-cth/work-health-and-safety-act-2011`)
const act = await one.json()
// fetch the full text if available
if (act.fullText.available) {
const text = await fetch(
`${BASE}/api/acts/au-cth/work-health-and-safety-act-2011/text`
).then(r => r.text())
}