Developer documentation
Access legislative definitions, provenance and cross-references as structured data.
Legislation API
A read-only JSON API over the legislation records shown on this site. The v1 base URL is https://myopengov.au/api/v1. Defined terms, their definitions and shared meanings are separate resources.
Get started
Sign in to create an API key. Send it in the Authorization: Bearer header; a signed-in browser session alone does not authorise API data requests. Explore the interactive Swagger documentation or download the OpenAPI specification.
For an agent integration, follow the search, date and citation guide.
Set MYOPENGOV_API_KEY to your key in your local environment, then search:
curl -H "Authorization: Bearer $MYOPENGOV_API_KEY" \
"https://myopengov.au/api/v1/search?q=financial%20year&type=defined_term&limit=2"
A shortened excerpt from the recorded 4 October 2026 (UTC) response is below. It shows the response structure and that run's data version; results and identifiers may change with a new data release.
{
"data_version": "b18-042903e0",
"items": [
{
"type": "defined_term_summary",
"iri": "https://myopengov.au/C2004L03938/term/1990-1991-financial-year",
"label": "1990-1991 financial year",
"api_url": "https://myopengov.au/api/v1/terms/C2004L03938/1990-1991-financial-year"
}
]
}
Resources and endpoints
| Resource | Paths | Returns |
|---|---|---|
| Works | /works/works/{work-id}/works/{work-id}/terms | Acts and Instruments, their metadata and defined terms, including catalogue-only coverage. |
| Defined terms | /terms/{work-id}/{term-slug}/terms/{work-id}/{term-slug}/history | A term at a provision and references to its recorded definitions over time. |
| Definitions | /definitions/{work-id}/{term-slug}/{definition-segment}/definitions/{work-id}/{term-slug}/{definition-segment}/attracted-meanings | A definition's text, provenance and signpost records, including unresolved diagnostics. |
| Shared meanings | /shared-meanings/shared-meanings/{slug}/shared-meanings/{slug}/members | Recorded groups and member-definition references. |
| Search | /search?q={query}&type={type} | One category: defined_term (default), work or shared_meaning. |
| Resolve an IRI | /resolve?iri={encoded-iri} | The resource identified by a published local IRI, including an exact fragment. |
| Point in time | /terms/{work-id}/{term-slug}/latest/terms/{work-id}/{term-slug}/at/{date} | Definitions recorded as in force today or on a YYYY-MM-DD date. |
Dates and attracted meanings
Point-in-time endpoints use the site's recorded commencement and ending dates. /latest uses today's calendar date in Canberra. Starts are inclusive and ends exclusive: a replacement applies from its first day.
- 302: one definition is in force. Read and retain the JSON response body:
definition_datacontains that definition with attracted meanings selected for the requested date.Locationpoints to its canonical API URL, whose default selection uses today. Automatically following that redirect loses the requested date context. Disable automatic redirect following when you need the dated answer. - 300: several definitions are in force together; read the response body for all listed definitions and their date-specific details. There is no single redirect target.
- 404: no settled in-force answer. Read
error.code:not_yet_defined,dates_unsettled,definition_ended,work_ended,work_end_unrecordedorno_definitions.
For example, the recorded requests for /terms/C1901A00002/office--s-33A/at/2011-12-26 and /terms/C1901A00002/office--s-33A/at/2011-12-27 each returned 302, selecting the earlier and replacement definitions respectively.
Attracted meanings use published dated slices. Each slice may resolve to zero, one or several source definitions. Read resolution_status, the resolved attracted_definitions and separate chain_stops; stopped or candidate text is evidence, never a resolved meaning. Rules, conditions and fixed version_as_at dates apply at each hop in chain_definitions. The response reports viewed_date, effective_date, life_status and resolution_basis. Canonical definition and attracted-meaning endpoints default to today’s Canberra date. Temporal response bodies use the requested date. In each case, effective_date is clamped to the signpost definition’s recorded life: its first day before commencement, or the day before its exclusive end after it has ended. life_status reports in_force, not_yet_in_force, no_longer_in_force or dates_unsettled. The selected resolution uses that effective date, while each fixed source retains its own version_as_at. The complete resolution_timeline remains available. Unknown lifetimes leave effective_date null and suppress the selected meaning. No explicit as-at query parameter is supported; use the term’s /at/{date} endpoint and retain its response body. Gaps and unsettled dates remain explicit. See the OpenAPI specification for the full response fields.
Identifiers and pagination
Treat IRIs as opaque identifiers: follow returned iri and api_url values rather than constructing slugs from labels. For /resolve, URL-encode the entire IRI, including # as %23, so its exact fragment reaches the server. A fragment names that recorded resource; it is not a date-selection parameter.
List responses contain items and pagination with page, limit, total and next. Page numbers start at 1; the default limit is 50 and the maximum is 100. Follow pagination.next, which carries data-version. A different active data version returns 409 with data_version_changed: restart pagination to avoid mixing releases.
Errors and access limits
Data responses carry data_version. Data errors have the envelope {data_version, error: {code, message, …}}; authentication and admission denials have {error: {code, message}} and do not carry data_version. Check both the HTTP status and error code.
| Status | Meaning |
|---|---|
| 301 | A recorded move; follow the returned target. None is recorded until record addresses are frozen. |
| 400 | Invalid path, date or query, including unknown or repeated parameters. |
| 401 | Missing or invalid API credential. |
| 403 | Request forbidden, such as an unsupported API origin. |
| 404 | No published resource or no settled temporal answer; inspect the code. Until record addresses are frozen, an address the current data does not publish answers 404. |
| 405 | Unsupported method. Use GET or HEAD; HEAD returns status and headers without a body. |
| 409 | The requested data version differs from the active release. |
| 410 | The address is recorded as retired. None is recorded until record addresses are frozen. |
| 429 | Request allowance exceeded; honour Retry-After. |
| 503 | Data or account verification unavailable, an unsupported data format, or a retrieval limit. |
Keys expire after 90 days. An account may hold three active keys and issue five keys in a rolling 24 hours. Keep keys secret and revoke unused keys from your account. The allowance is 60 requests per account per minute, shared by its keys, with an additional edge limit of approximately 120 per IP per minute. Responses are private and not stored in shared caches.
No CORS is enabled for v1. Use a server client or this site's same-origin Swagger page for browser requests.
API licensing and attribution
Legislative text is from the Federal Register of Legislation, licensed under CC BY 4.0. MyOpenGov's derived data is licensed under CC BY-NC 4.0. Response Link headers identify both licences. When reusing data, preserve the source attribution and cite MyOpenGov with the record IRI, data version and access date. See licensing and commercial enquiries.
Record addresses
- Act or Instrument:
/{Register ID} - Defined term:
/{Register ID}/term/{term-slug} - Definition:
/{Register ID}/term/{term-slug}/{instrument} - Scope:
/{Register ID}/scope/{scope-slug} - Part of a definition:
/{Register ID}/term/{term-slug}/{instrument}/part/{part-slug} - Groups of signpost definitions:
/meaning/{group-slug}
Use the addresses published on record pages or in the sitemap. Slugs include identifiers where needed to distinguish records; they should not be inferred from a label.
File formats
Definition pages and the data vocabulary reference are public. Sign in to download individual structured records and use structured representations.
Append .ttl, .jsonld or .nt to a record address for Turtle, JSON-LD or N-Triples.
https://myopengov.au/F2025L00473/term/adverse-action.ttl
https://myopengov.au/F2025L00473/term/adverse-action.jsonld
https://myopengov.au/F2025L00473/term/adverse-action.nt
Content negotiation
Request a record with Accept: text/turtle, application/ld+json or application/n-triples. The response is a 303 redirect to the corresponding data file.
curl -L -H 'Accept: text/turtle' https://myopengov.au/F2025L00473/term/adverse-action
Data model
Records use SKOS, Dublin Core, PROV-O and FOAF, with additional classes and properties documented in the data vocabulary reference. Existing record addresses and RDF identifiers remain stable even where the website’s display labels change.
Versions and reuse
Record the data version from the manifest when using or citing a download. Legislative text is available under CC BY 4.0; the derived artefacts are licensed under CC BY-NC 4.0. See licensing and commercial enquiries.