{
  "openapi": "3.1.0",
  "info": {
    "title": "publicdata.au",
    "version": "2026-04-24",
    "summary": "Australian government open data as versioned, immutable files.",
    "description": "Every path is public. No keys, accounts or rate limits. Files under /v/<date>/ never change. Every JSON, NDJSON, GeoJSON, Parquet and SQLite file carries a publicdata provenance header. No government agency runs or has endorsed this site.",
    "contact": {
      "name": "National Digital",
      "url": "https://nationaldigital.com.au/contact/"
    },
    "license": {
      "name": "Data under each publisher's licence, see backlog.json",
      "url": "https://publicdata.au/about/"
    }
  },
  "servers": [
    {
      "url": "https://publicdata.au"
    }
  ],
  "tags": [
    {
      "name": "catalogue"
    },
    {
      "name": "dataset"
    },
    {
      "name": "version"
    },
    {
      "name": "backlog"
    }
  ],
  "paths": {
    "/catalog.json": {
      "get": {
        "tags": [
          "catalogue"
        ],
        "summary": "DCAT catalogue of every live dataset",
        "operationId": "getCatalog",
        "responses": {
          "200": {
            "description": "DCAT-AP JSON-LD",
            "content": {
              "application/ld+json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/backlog.json": {
      "get": {
        "tags": [
          "backlog"
        ],
        "summary": "Every register entry with status, licence and blocked reason",
        "operationId": "getBacklog",
        "responses": {
          "200": {
            "description": "Register entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entries": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latest.json": {
      "get": {
        "tags": [
          "catalogue"
        ],
        "summary": "Latest version date per dataset",
        "operationId": "getLatest",
        "responses": {
          "200": {
            "description": "slug to date",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string",
                    "format": "date"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/health.json": {
      "get": {
        "tags": [
          "catalogue"
        ],
        "summary": "Build health",
        "operationId": "getHealth",
        "responses": {
          "200": {
            "description": "ok",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/d/{slug}/datapackage.json": {
      "get": {
        "tags": [
          "dataset"
        ],
        "summary": "Frictionless data package pointing at the latest version",
        "operationId": "getDatapackage",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "qld-road-crash-locations",
                "qld-road-casualties",
                "qld-road-crash-driver-demographics",
                "qld-road-crash-restraint-helmet-use",
                "qld-road-crash-vehicle-types",
                "qld-road-crash-factors"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Data package",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/d/{slug}/schema.json": {
      "get": {
        "tags": [
          "dataset"
        ],
        "summary": "Table Schema for every field",
        "operationId": "getSchema",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "qld-road-crash-locations",
                "qld-road-casualties",
                "qld-road-crash-driver-demographics",
                "qld-road-crash-restraint-helmet-use",
                "qld-road-crash-vehicle-types",
                "qld-road-crash-factors"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Table Schema",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/d/{slug}/versions.json": {
      "get": {
        "tags": [
          "dataset"
        ],
        "summary": "Every version with date, rows, fields and source hash",
        "operationId": "getVersions",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "qld-road-crash-locations",
                "qld-road-casualties",
                "qld-road-crash-driver-demographics",
                "qld-road-crash-restraint-helmet-use",
                "qld-road-crash-vehicle-types",
                "qld-road-crash-factors"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Versions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/d/{slug}/changes.json": {
      "get": {
        "tags": [
          "dataset"
        ],
        "summary": "Diff summary for every consecutive pair of versions",
        "operationId": "getChanges",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "qld-road-crash-locations",
                "qld-road-casualties",
                "qld-road-crash-driver-demographics",
                "qld-road-crash-restraint-helmet-use",
                "qld-road-crash-vehicle-types",
                "qld-road-crash-factors"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Changes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/d/{slug}/diff/{from}..{to}.json": {
      "get": {
        "tags": [
          "dataset"
        ],
        "summary": "Rows added, removed and changed between two versions, by key",
        "operationId": "getDiff",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "qld-road-crash-locations",
                "qld-road-casualties",
                "qld-road-crash-driver-demographics",
                "qld-road-crash-restraint-helmet-use",
                "qld-road-crash-vehicle-types",
                "qld-road-crash-factors"
              ]
            }
          },
          {
            "name": "from",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Diff",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "No such pair"
          }
        }
      }
    },
    "/d/{slug}/history.tar.zst": {
      "get": {
        "tags": [
          "dataset"
        ],
        "summary": "Every version's Parquet and manifest in one archive",
        "operationId": "getHistory",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "qld-road-crash-locations",
                "qld-road-casualties",
                "qld-road-crash-driver-demographics",
                "qld-road-crash-restraint-helmet-use",
                "qld-road-crash-vehicle-types",
                "qld-road-crash-factors"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "zstd tar",
            "content": {
              "application/zstd": {}
            }
          }
        }
      }
    },
    "/d/{slug}/index.md": {
      "get": {
        "tags": [
          "dataset"
        ],
        "summary": "The dataset page as Markdown",
        "operationId": "getDatasetMarkdown",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "qld-road-crash-locations",
                "qld-road-casualties",
                "qld-road-crash-driver-demographics",
                "qld-road-crash-restraint-helmet-use",
                "qld-road-crash-vehicle-types",
                "qld-road-crash-factors"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Markdown with front matter",
            "content": {
              "text/markdown": {}
            }
          }
        }
      }
    },
    "/d/{slug}/latest/data.{format}": {
      "get": {
        "tags": [
          "version"
        ],
        "summary": "Redirects to the newest dated version of the file",
        "operationId": "getLatestData",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "qld-road-crash-locations",
                "qld-road-casualties",
                "qld-road-crash-driver-demographics",
                "qld-road-crash-restraint-helmet-use",
                "qld-road-crash-vehicle-types",
                "qld-road-crash-factors"
              ]
            }
          },
          {
            "name": "format",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "parquet",
                "json",
                "csv",
                "sqlite",
                "ndjson",
                "geojson"
              ]
            },
            "description": "geojson exists only for datasets that declare geometry."
          }
        ],
        "responses": {
          "302": {
            "description": "Location is the dated file. Cached 5 minutes.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          }
        }
      }
    },
    "/d/{slug}/v/{version}/data.{format}": {
      "get": {
        "tags": [
          "version"
        ],
        "summary": "The whole dataset in one format. Immutable, cached one year. Range requests are honoured.",
        "operationId": "getData",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "qld-road-crash-locations",
                "qld-road-casualties",
                "qld-road-crash-driver-demographics",
                "qld-road-crash-restraint-helmet-use",
                "qld-road-crash-vehicle-types",
                "qld-road-crash-factors"
              ]
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "description": "A dated version from versions.json.",
            "schema": {
              "type": "string",
              "format": "date",
              "examples": [
                "2026-04-24"
              ]
            }
          },
          {
            "name": "format",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "parquet",
                "json",
                "csv",
                "sqlite",
                "ndjson",
                "geojson"
              ]
            },
            "description": "geojson exists only for datasets that declare geometry."
          }
        ],
        "responses": {
          "200": {
            "description": "The file",
            "content": {
              "application/vnd.apache.parquet": {},
              "application/json": {},
              "text/csv": {},
              "application/vnd.sqlite3": {},
              "application/x-ndjson": {},
              "application/geo+json": {}
            }
          },
          "206": {
            "description": "Partial content"
          },
          "404": {
            "description": "No such version or format"
          }
        }
      }
    },
    "/d/{slug}/v/{version}/manifest.json": {
      "get": {
        "tags": [
          "version"
        ],
        "summary": "Where the bytes came from and when",
        "operationId": "getManifest",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "qld-road-crash-locations",
                "qld-road-casualties",
                "qld-road-crash-driver-demographics",
                "qld-road-crash-restraint-helmet-use",
                "qld-road-crash-vehicle-types",
                "qld-road-crash-factors"
              ]
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "description": "A dated version from versions.json.",
            "schema": {
              "type": "string",
              "format": "date",
              "examples": [
                "2026-04-24"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Manifest",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/d/{slug}/v/{version}/schema.json": {
      "get": {
        "tags": [
          "version"
        ],
        "summary": "Table Schema as at this version",
        "operationId": "getVersionSchema",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "qld-road-crash-locations",
                "qld-road-casualties",
                "qld-road-crash-driver-demographics",
                "qld-road-crash-restraint-helmet-use",
                "qld-road-crash-vehicle-types",
                "qld-road-crash-factors"
              ]
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "description": "A dated version from versions.json.",
            "schema": {
              "type": "string",
              "format": "date",
              "examples": [
                "2026-04-24"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Table Schema",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/d/{slug}/v/{version}/source.{ext}": {
      "get": {
        "tags": [
          "version"
        ],
        "summary": "The publisher's file, byte for byte",
        "operationId": "getSource",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "qld-road-crash-locations",
                "qld-road-casualties",
                "qld-road-crash-driver-demographics",
                "qld-road-crash-restraint-helmet-use",
                "qld-road-crash-vehicle-types",
                "qld-road-crash-factors"
              ]
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "description": "A dated version from versions.json.",
            "schema": {
              "type": "string",
              "format": "date",
              "examples": [
                "2026-04-24"
              ]
            }
          },
          {
            "name": "ext",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "examples": [
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The source bytes"
          }
        }
      }
    },
    "/d/{slug}/v/{version}/by/{field}/index.json": {
      "get": {
        "tags": [
          "version"
        ],
        "summary": "Every partition file for one field, with row counts",
        "operationId": "getPartitionIndex",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "qld-road-crash-locations",
                "qld-road-casualties",
                "qld-road-crash-driver-demographics",
                "qld-road-crash-restraint-helmet-use",
                "qld-road-crash-vehicle-types",
                "qld-road-crash-factors"
              ]
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "description": "A dated version from versions.json.",
            "schema": {
              "type": "string",
              "format": "date",
              "examples": [
                "2026-04-24"
              ]
            }
          },
          {
            "name": "field",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Partition index",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/d/{slug}/v/{version}/by/{field}/{value}.json": {
      "get": {
        "tags": [
          "version"
        ],
        "summary": "The rows for one value of a partition field, with the provenance header",
        "operationId": "getPartition",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "qld-road-crash-locations",
                "qld-road-casualties",
                "qld-road-crash-driver-demographics",
                "qld-road-crash-restraint-helmet-use",
                "qld-road-crash-vehicle-types",
                "qld-road-crash-factors"
              ]
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "description": "A dated version from versions.json.",
            "schema": {
              "type": "string",
              "format": "date",
              "examples": [
                "2026-04-24"
              ]
            }
          },
          {
            "name": "field",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "value",
            "in": "path",
            "required": true,
            "description": "The slugified value from index.json",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rows",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "publicdata": {
                      "type": "object",
                      "description": "Provenance header carried inside every JSON, NDJSON, GeoJSON, Parquet and SQLite file.",
                      "properties": {
                        "site": {
                          "type": "string"
                        },
                        "dataset": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "version": {
                          "type": "string",
                          "format": "date"
                        },
                        "as_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date"
                        },
                        "url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "publisher": {
                          "type": "object"
                        },
                        "licence": {
                          "type": "object"
                        },
                        "attribution": {
                          "type": "string"
                        },
                        "source": {
                          "type": "object"
                        },
                        "rows": {
                          "type": "integer"
                        },
                        "fields": {
                          "type": "integer"
                        },
                        "not_endorsed": {
                          "type": "string"
                        }
                      }
                    },
                    "fields": {
                      "type": "array"
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/votes": {
      "get": {
        "tags": [
          "backlog"
        ],
        "summary": "Vote counts per backlog dataset",
        "operationId": "getVotes",
        "responses": {
          "200": {
            "description": "slug to count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/vote/{slug}": {
      "get": {
        "tags": [
          "backlog"
        ],
        "summary": "Vote count for one dataset",
        "operationId": "getVote",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "backlog"
        ],
        "summary": "Add one vote. No identity is recorded; one per browser per day.",
        "operationId": "vote",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "New count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "slug": {
                      "type": "string"
                    },
                    "votes": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not open for votes: live, building or unknown"
          }
        }
      },
      "delete": {
        "tags": [
          "backlog"
        ],
        "summary": "Remove today's vote from this browser",
        "operationId": "unvote",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "New count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/request": {
      "post": {
        "tags": [
          "backlog"
        ],
        "summary": "Ask for a dataset by URL. A person reads it and adds it to the register.",
        "operationId": "requestDataset",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Not a URL"
          },
          "429": {
            "description": "Five a day per browser"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Provenance": {
        "type": "object",
        "description": "Provenance header carried inside every JSON, NDJSON, GeoJSON, Parquet and SQLite file.",
        "properties": {
          "site": {
            "type": "string"
          },
          "dataset": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "version": {
            "type": "string",
            "format": "date"
          },
          "as_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "publisher": {
            "type": "object"
          },
          "licence": {
            "type": "object"
          },
          "attribution": {
            "type": "string"
          },
          "source": {
            "type": "object"
          },
          "rows": {
            "type": "integer"
          },
          "fields": {
            "type": "integer"
          },
          "not_endorsed": {
            "type": "string"
          }
        }
      }
    }
  }
}
