openapi: "3.1.0"
info:
  title: "Crunched Cover public data API"
  version: "1.0.0"
  summary: "JSON twins of the public pages, plus the ask protocol and build-time status."
  description: "Crunched Cover publishes the same figures as JSON that appear on the pages. This is version 1.0.0 of that contract. Current addresses stay stable. Licensed from the Commonwealth of Australia under a Creative Commons Attribution 3.0 Australia licence. This material is from the Private Health Information Statements published on data.gov.au and available from the Private Health Insurance Ombudsman website at https://privatehealth.gov.au/. Licence: https://creativecommons.org/licenses/by/3.0/au/. Versioning is semver. The field api_version appears on every JSON object. Current paths stay stable. /api/v1/ is a rewrite of the same files. Version 1 (the current addresses and the /api/v1/ aliases) stays available until a published sunset date. A breaking change or removal is announced on /api/changelog/ at least 90 days before it takes effect. Deprecated routes then send Deprecation and Sunset headers (RFC 8594) and a Link to the successor. No route is deprecated in version 1.0.0. Additive fields on a JSON object are a minor change and do not need a notice period."
  license:
    name: "Creative Commons Attribution 3.0 Australia"
    identifier: "CC-BY-3.0-AU"
    url: "https://creativecommons.org/licenses/by/3.0/au/"
  contact:
    name: "Crunched Cover"
    url: "https://crunchedcover.com.au/api/"
servers:
  - url: "https://crunchedcover.com.au"
    description: "This build’s public origin."
paths:
  "/openapi.json":
    get:
      summary: "OpenAPI 3.1 description (JSON)."
      description: "The machine-readable description of the public JSON resources."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
  "/openapi.yaml":
    get:
      summary: "OpenAPI 3.1 description (YAML)."
      responses:
        "200":
          description: "The same description as /openapi.json, in YAML."
          content:
            "application/yaml":
              schema:
                type: "string"
  "/api/openapi.json":
    get:
      summary: "Copy of /openapi.json under /api/."
      description: "Copy of /openapi.json under /api/."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
  "/api.json":
    get:
      summary: "Public API docs as JSON."
      description: "Public API docs as JSON."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
              example:
                page: "/api/"
                title: "Public data API"
                api_version: "1.0.0"
                lede: "Crunched Cover publishes the same figures as JSON that appear on the pages. This is version 1.0.0 of that contract. Current addresses stay stable."
                deprecation_policy: "Version 1 (the current addresses and the /api/v1/ aliases) stays available until a published sunset date. A breaking change or removal is announced on /api/changelog/ at least 90 days before it takes effect. Deprecated routes then send Deprecation and Sunset headers (RFC 8594) and a Link to the successor. No route is deprecated in version 1.0.0. Additive fields on a JSON object are a minor change and do not need a notice period."
                deprecation_notice_days: 90
                licence: "Licensed from the Commonwealth of Australia under a Creative Commons Attribution 3.0 Australia licence. This material is from the Private Health Information Statements published on data.gov.au and available from the Private Health Insurance Ombudsman website at https://privatehealth.gov.au/. Licence: https://creativecommons.org/licenses/by/3.0/au/."
                licence_url: "https://creativecommons.org/licenses/by/3.0/au/"
                source: "https://data.gov.au/data/dataset/private-health-insurance"
                openapi: "/openapi.json"
                openapi_yaml: "/openapi.yaml"
                changelog: "/api/changelog/"
                status: "/status/"
                v1_prefix: "/api/v1/"
                examples:
                  cover_json: "/cover/nib/gold-top-hospital-750-excess/nsw/single.json"
                  data_p: "/data/p/nib-gold-top-hospital-750-excess-nsw-single.json"
                  national_data_p: "/data/p/mildura-five-star-gold-750-excess-f4-all-single.json"
                  cheapest: "/cheapest/gold/nsw/single.json"
                  lowest_price: "/lowest-price/gold/nsw/single.json"
                changelog_entries:
                  - version: "1.0.0"
                    date: "2026-12-02"
                    date_h: "2 Dec 2026"
                    title: "First published contract"
                    summary: "Version 1.0.0 documents the existing JSON twins, the ask protocol, the status page and the OpenAPI description. The PHIS release on the pages is 1 Dec 2026. Last checked against PHIS 3 Dec 2026. Current addresses stay stable. /api/v1/ is a rewrite of the same files."
                    changes:
                      - "JSON object payloads include api_version set to 1.0.0. Root arrays are unchanged."
                      - "OpenAPI 3.1 is at /openapi.json and /openapi.yaml, with a copy at /api/openapi.json."
                      - "Docs are at /api/, the changelog at /api/changelog/, and a build-time status page at /status/."
                release: "2026-12-01"
                release_h: "1 Dec 2026"
                checked: "2026-12-03"
                checked_h: "3 Dec 2026"
                commission_mode: "none"
                commission_line: "We don’t currently receive commission from any fund. If that changes, every result will say so before it affects the order."
                last_checked_against_phis: "2026-12-03"
                phis_release_date: "2026-12-01"
                last_checked_against_phis_label: "Last checked against PHIS 3 Dec 2026"
                group_id: "default"
                variant: "A"
                cite_this_title: "Public data API"
                citation_permalink: "https://crunchedcover.com.au/r/2026-12-01/api/"
                cite_this: "Crunched Cover, Public data API, figures from the Private Health Information Statement release of 1 Dec 2026, checked 3 Dec 2026, https://crunchedcover.com.au/r/2026-12-01/api/."
  "/api/changelog.json":
    get:
      summary: "API changelog as JSON."
      description: "API changelog as JSON."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
              example:
                page: "/api/changelog/"
                title: "API changelog"
                api_version: "1.0.0"
                lede: "Changes to the public JSON contract. Breaking removals are announced here at least 90 days before they take effect."
                deprecation_policy: "Version 1 (the current addresses and the /api/v1/ aliases) stays available until a published sunset date. A breaking change or removal is announced on /api/changelog/ at least 90 days before it takes effect. Deprecated routes then send Deprecation and Sunset headers (RFC 8594) and a Link to the successor. No route is deprecated in version 1.0.0. Additive fields on a JSON object are a minor change and do not need a notice period."
                deprecation_notice_days: 90
                licence: "Licensed from the Commonwealth of Australia under a Creative Commons Attribution 3.0 Australia licence. This material is from the Private Health Information Statements published on data.gov.au and available from the Private Health Insurance Ombudsman website at https://privatehealth.gov.au/. Licence: https://creativecommons.org/licenses/by/3.0/au/."
                licence_url: "https://creativecommons.org/licenses/by/3.0/au/"
                entries:
                  - version: "1.0.0"
                    date: "2026-12-02"
                    date_h: "2 Dec 2026"
                    title: "First published contract"
                    summary: "Version 1.0.0 documents the existing JSON twins, the ask protocol, the status page and the OpenAPI description. The PHIS release on the pages is 1 Dec 2026. Last checked against PHIS 3 Dec 2026. Current addresses stay stable. /api/v1/ is a rewrite of the same files."
                    changes:
                      - "JSON object payloads include api_version set to 1.0.0. Root arrays are unchanged."
                      - "OpenAPI 3.1 is at /openapi.json and /openapi.yaml, with a copy at /api/openapi.json."
                      - "Docs are at /api/, the changelog at /api/changelog/, and a build-time status page at /status/."
                release: "2026-12-01"
                release_h: "1 Dec 2026"
                checked: "2026-12-03"
                checked_h: "3 Dec 2026"
                commission_mode: "none"
                commission_line: "We don’t currently receive commission from any fund. If that changes, every result will say so before it affects the order."
                last_checked_against_phis: "2026-12-03"
                phis_release_date: "2026-12-01"
                last_checked_against_phis_label: "Last checked against PHIS 3 Dec 2026"
                group_id: "default"
                variant: "A"
                cite_this_title: "API changelog"
                citation_permalink: "https://crunchedcover.com.au/r/2026-12-01/api/changelog/"
                cite_this: "Crunched Cover, API changelog, figures from the Private Health Information Statement release of 1 Dec 2026, checked 3 Dec 2026, https://crunchedcover.com.au/r/2026-12-01/api/changelog/."
  "/status.json":
    get:
      summary: "Build-time status."
      description: "Last PHIS release adopted, last checked date, the official-file check and its counts, and the build commit and time. Generated when the site is built. No third-party service is called."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
              example:
                page: "/status/"
                title: "Status"
                api_version: "1.0.0"
                lede: "Build-time status for this site. This page does not call any third-party service."
                last_phis_release_adopted: "2026-12-01"
                last_phis_release_adopted_h: "1 Dec 2026"
                last_checked_against_phis: "2026-12-03"
                last_checked_against_phis_h: "3 Dec 2026"
                source_zip: "privatehealth-01-dec-2026.zip"
                content_hash: "d71430fbd5f3b1e2d72d5b0b5f007c5b0262bb7b7defe2f3715b917a20e59079"
                gate_result: "passed"
                gate_line: "Checked against the official PHIS file: 150,522 figures, 0 mismatches, 0 missing."
                figures_checked: 150522
                mismatch_count: 0
                missing_count: 0
                build_commit: "71fd9618d976c58b5528902d333790692b127221"
                build_commit_short: "71fd961"
                build_time: "2026-12-03T12:45:54+11:00"
                build_time_label: "3 Dec 2026, 12:45 PM Australia/Sydney"
                build_time_zone: "Australia/Sydney"
                same_content_for_bots_and_humans: true
                same_content_line: "Same content for bots and humans. The HTML, JSON and Markdown versions of a page carry the same figures."
                licence: "Licensed from the Commonwealth of Australia under a Creative Commons Attribution 3.0 Australia licence. This material is from the Private Health Information Statements published on data.gov.au and available from the Private Health Insurance Ombudsman website at https://privatehealth.gov.au/. Licence: https://creativecommons.org/licenses/by/3.0/au/."
                licence_url: "https://creativecommons.org/licenses/by/3.0/au/"
                release: "2026-12-01"
                release_h: "1 Dec 2026"
                checked: "2026-12-03"
                checked_h: "3 Dec 2026"
  "/index.json":
    get:
      summary: "Site index JSON twin."
      description: "Site index JSON twin."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
  "/data/products.json":
    get:
      summary: "Index of the split product CSV extracts."
      description: "Index of the split product CSV extracts."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
  "/data/funds.json":
    get:
      summary: "Fund list."
      description: "Fund list."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
  "/data/offers.json":
    get:
      summary: "Current join offers."
      description: "Current join offers."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
  "/data/p/{slug}.json":
    get:
      summary: "Per-policy file used by the start page."
      description: "Slug form: {fund}-{policy}-{state}-{scale}. National products (official state ALL) use -all- in the canonical slug and are also served under each state slug."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
              example:
                api_version: "1.0.0"
                release_date: "2026-12-01"
                _example_trimmed: "This example is shortened. Fetch the URL for the full object."
      parameters:
        - name: "slug"
          in: "path"
          required: true
          schema:
            type: "string"
          example: "nib-gold-top-hospital-750-excess-nsw-single"
  "/data/history/releases.json":
    get:
      summary: "Index of compiled official PHIS releases."
      description: "Index of compiled official PHIS releases."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
  "/cover/{fund}/{policy}/{state}/{scale}.json":
    get:
      summary: "JSON twin of a policy page, including working.v1 and listed monthly premium history where present."
      description: "JSON twin of a policy page, including working.v1 and listed monthly premium history where present."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
              example:
                api_version: "1.0.0"
                page: "/cover/nib/gold-top-hospital-750-excess/nsw/single/"
                summary: "nib Gold Top Hospital $750 Excess (closed to new members), $750 excess, single, NSW & ACT: Medibank Gold Protect gives the same or better hospital cover for $720 a year less after the base rebate (release 1 Dec 2026)."
                release_date: "2026-12-01"
                checked: "2026-12-03"
                verdict: "switch"
                licence: "Licensed from the Commonwealth of Australia under a Creative Commons Attribution 3.0 Australia licence. This material is from the Private Health Information Statements published on data.gov.au and available from the Private Health Insurance Ombudsman website at https://privatehealth.gov.au/. Licence: https://creativecommons.org/licenses/by/3.0/au/."
                cite_this: "Crunched Cover, nib Gold Top Hospital $750 Excess (closed to new members): $750 excess, single, NSW & ACT, figures from the Private Health Information Statement release of 1 Dec 2026, checked 3 Dec 2026, https://crunchedcover.com.au/r/2026-12-01/cover/nib/gold-top-hospital-750-excess/nsw/single/."
                citation_permalink: "https://crunchedcover.com.au/r/2026-12-01/cover/nib/gold-top-hospital-750-excess/nsw/single/"
                phis_release_date: "2026-12-01"
                last_checked_against_phis: "2026-12-03"
                _example_trimmed: "This example is shortened. Fetch the URL for the full object."
      parameters:
        - name: "fund"
          in: "path"
          required: true
          schema:
            type: "string"
          example: "nib"
        - name: "policy"
          in: "path"
          required: true
          schema:
            type: "string"
          example: "gold-top-hospital-750-excess"
        - name: "state"
          in: "path"
          required: true
          schema:
            type: "string"
          example: "nsw"
        - name: "scale"
          in: "path"
          required: true
          schema:
            type: "string"
          example: "single"
  "/cheapest/{tier}/{state}/{scale}.json":
    get:
      summary: "JSON twin of a lowest-price page (original address). The heading is “Lowest price at the base rebate tier”."
      description: "JSON twin of a lowest-price page (original address). The heading is “Lowest price at the base rebate tier”."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
              example:
                api_version: "1.0.0"
                page: "/cheapest/gold/nsw/single/"
                title: "Gold hospital cover, single, NSW & ACT"
                summary: "The lowest price for Gold hospital cover open to everyone for a single policy in NSW & ACT, at the base rebate tier, is Mildura Health Fund Five Star Gold $750 Excess - F4 (PHIS ID MDH/H8/AACA10) at $2,263 a year after the rebate ($248.55 a month before the rebate, $750 excess). The lowest-price like-for-like policy (gap cover scheme, ambulance cover, no co-payments, private room in public hospitals) is Medibank Gold Protect at $3,538 a year after the rebate."
                release_date: "2026-12-01"
                checked: "2026-12-03"
                licence: "Licensed from the Commonwealth of Australia under a Creative Commons Attribution 3.0 Australia licence. This material is from the Private Health Information Statements published on data.gov.au and available from the Private Health Insurance Ombudsman website at https://privatehealth.gov.au/. Licence: https://creativecommons.org/licenses/by/3.0/au/."
                cite_this: "Crunched Cover, Lowest price at the base rebate tier: Gold hospital cover, single, NSW & ACT, figures from the Private Health Information Statement release of 1 Dec 2026, checked 3 Dec 2026, https://crunchedcover.com.au/r/2026-12-01/cheapest/gold/nsw/single/."
                citation_permalink: "https://crunchedcover.com.au/r/2026-12-01/cheapest/gold/nsw/single/"
                phis_release_date: "2026-12-01"
                last_checked_against_phis: "2026-12-03"
                _example_trimmed: "This example is shortened. Fetch the URL for the full object."
      parameters:
        - name: "tier"
          in: "path"
          required: true
          schema:
            type: "string"
          example: "gold"
        - name: "state"
          in: "path"
          required: true
          schema:
            type: "string"
          example: "nsw"
        - name: "scale"
          in: "path"
          required: true
          schema:
            type: "string"
          example: "single"
  "/lowest-price/{tier}/{state}/{scale}.json":
    get:
      summary: "JSON twin of a lowest-price page (current address). Same figures as the matching /cheapest/ path."
      description: "JSON twin of a lowest-price page (current address). Same figures as the matching /cheapest/ path."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
              example:
                api_version: "1.0.0"
                page: "/lowest-price/gold/nsw/single/"
                title: "Lowest price at the base rebate tier"
                checked: "2026-12-03"
                cite_this: "Crunched Cover, Lowest price at the base rebate tier: Gold hospital cover, single, NSW & ACT, figures from the Private Health Information Statement release of 1 Dec 2026, checked 3 Dec 2026, https://crunchedcover.com.au/r/2026-12-01/lowest-price/gold/nsw/single/."
                citation_permalink: "https://crunchedcover.com.au/r/2026-12-01/lowest-price/gold/nsw/single/"
                phis_release_date: "2026-12-01"
                last_checked_against_phis: "2026-12-03"
                _example_trimmed: "This example is shortened. Fetch the URL for the full object."
      parameters:
        - name: "tier"
          in: "path"
          required: true
          schema:
            type: "string"
          example: "gold"
        - name: "state"
          in: "path"
          required: true
          schema:
            type: "string"
          example: "nsw"
        - name: "scale"
          in: "path"
          required: true
          schema:
            type: "string"
          example: "single"
  "/history.json":
    get:
      summary: "Compiled PHIS history index."
      description: "Compiled PHIS history index."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
  "/history/{release}.json":
    get:
      summary: "One official monthly release in the compiled history."
      description: "One official monthly release in the compiled history."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
      parameters:
        - name: "release"
          in: "path"
          required: true
          schema:
            type: "string"
            format: "date"
          example: "2026-12-01"
  "/history/funds/{fund}.json":
    get:
      summary: "Compiled history for one fund."
      description: "Compiled history for one fund."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
      parameters:
        - name: "fund"
          in: "path"
          required: true
          schema:
            type: "string"
          example: "nib"
  "/history/rate-rises/{year}.json":
    get:
      summary: "Derived April rate-rise table for one year."
      description: "Derived April rate-rise table for one year."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
      parameters:
        - name: "year"
          in: "path"
          required: true
          schema:
            type: "integer"
          example: 2026
  "/funds/{fund}.json":
    get:
      summary: "JSON twin of a fund page."
      description: "JSON twin of a fund page."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
      parameters:
        - name: "fund"
          in: "path"
          required: true
          schema:
            type: "string"
          example: "nib"
  "/updates.json":
    get:
      summary: "Data-refresh and corrections changelog."
      description: "Data-refresh and corrections changelog."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
  "/updates/changelog.json":
    get:
      summary: "Data-refresh log only."
      description: "Data-refresh log only."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
  "/updates/corrections.json":
    get:
      summary: "Corrections log only."
      description: "Corrections log only."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
  "/offers.json":
    get:
      summary: "Current join offers (page twin)."
      description: "Current join offers (page twin)."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
  "/guides/{slug}.json":
    get:
      summary: "JSON twin of a guide."
      description: "JSON twin of a guide."
      responses:
        "200":
          description: "The JSON resource."
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/JsonObject"
      parameters:
        - name: "slug"
          in: "path"
          required: true
          schema:
            type: "string"
          example: "waiting-periods"
  "/llms.txt":
    get:
      summary: "Plain-text guide to the public pages and JSON resources."
      responses:
        "200":
          description: "Plain text, same figures as the pages."
          content:
            "text/plain":
              schema:
                type: "string"
  "/":
    get:
      summary: "Ask a question about a page (GET)."
      description: "Available on every public HTML page, not only the home page. Prefer POST so the question is not kept in a URL. Answers are Markdown. Questions about a person’s own health are refused with 400. An empty question is 400. A path with no page is 404. Maximum 300 characters. Fair-use limits: 30 requests a minute and 200 a day."
      parameters:
        - name: "q"
          in: "query"
          required: false
          schema:
            type: "string"
            maxLength: 300
          example: "What is the waiting period for hospital cover?"
      responses:
        "200":
          description: "Markdown answer."
          content:
            "text/markdown":
              schema:
                type: "string"
        "400":
          description: "Empty question, or a personal health question, which is refused."
        "404":
          description: "No page at this path."
        "405":
          description: "Method not allowed."
      x-applies-to-every-html-page: true
    post:
      summary: "Ask a question about a page (POST)."
      description: "Preferred way to ask, so the question is not kept in a URL. Send JSON `{\"q\": \"…\"}` or a form field named q or question. Available on every public HTML page."
      requestBody:
        required: true
        content:
          "application/json":
            schema:
              type: "object"
              properties:
                q:
                  type: "string"
                  maxLength: 300
                question:
                  type: "string"
                  maxLength: 300
            example:
              q: "What is the waiting period for hospital cover?"
          "application/x-www-form-urlencoded":
            schema:
              type: "object"
              properties:
                q:
                  type: "string"
                question:
                  type: "string"
      responses:
        "200":
          description: "Markdown answer."
          content:
            "text/markdown":
              schema:
                type: "string"
        "400":
          description: "Empty question, or a personal health question, which is refused."
        "404":
          description: "No page at this path."
        "405":
          description: "Method not allowed."
      x-applies-to-every-html-page: true
components:
  schemas:
    JsonObject:
      type: "object"
      additionalProperties: true
      required:
        - "api_version"
      properties:
        api_version:
          type: "string"
          description: "Semantic version of this payload’s contract. Version 1.0.0 uses the string \"1.0.0\"."
          example: "1.0.0"
externalDocs:
  description: "Human-readable API docs, licence and deprecation policy."
  url: "https://crunchedcover.com.au/api/"
