{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://daycarenearme.co.nz/api/schema.json",
  "title": "Daycare Near Me — centre facts",
  "description": "Per-centre payload returned by /api/centre/{slug}/facts.json. Each NZ licensed early childhood education service has one. Source: Ministry of Education ECE Directory (CC-BY 4.0) plus Daycare Near Me enrichments (suburb linkage, nearby-centre computation, provider matching).",
  "type": "object",
  "required": [
    "moe_number",
    "name",
    "slug",
    "service_type"
  ],
  "properties": {
    "moe_number": {
      "type": "string",
      "description": "Ministry of Education service ID. Stable; primary key.",
      "examples": [
        "10002",
        "47730"
      ]
    },
    "name": {
      "type": "string",
      "description": "Centre trading name as published by MoE."
    },
    "slug": {
      "type": "string",
      "description": "URL-safe slug used in /centre/{slug}. kebab-case.",
      "pattern": "^[a-z0-9-]+$"
    },
    "service_type": {
      "type": "string",
      "enum": [
        "kindergarten",
        "education_and_care",
        "home_based",
        "kohanga_reo",
        "playcentre",
        "casual_education_and_care",
        "hospital_based",
        "correspondence"
      ],
      "description": "MoE-classified service type."
    },
    "provider_id": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Foreign key to ece.providers. Null when centre is standalone."
    },
    "address": {
      "type": [
        "string",
        "null"
      ],
      "description": "Street address line 1."
    },
    "suburb": {
      "type": [
        "string",
        "null"
      ],
      "description": "Suburb name (MoE Add1_Suburb field)."
    },
    "territorial_authority": {
      "type": [
        "string",
        "null"
      ],
      "description": "Local body. For Auckland, includes local board e.g. \"Auckland - Howick\"."
    },
    "regional_council": {
      "type": [
        "string",
        "null"
      ],
      "description": "NZ regional council, with \" Region\" suffix in source."
    },
    "latitude": {
      "type": [
        "number",
        "null"
      ],
      "minimum": -47.5,
      "maximum": -34,
      "description": "WGS84. ~99.7% coverage in source."
    },
    "longitude": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 166,
      "maximum": 179
    },
    "licensed_capacity": {
      "type": "object",
      "description": "Maximum licensed child places. Currently null for all centres — MoE does not publish this in its public open-data feed. Sourcing path via OIA/ERO ingest in progress.",
      "properties": {
        "under_2": {
          "type": [
            "integer",
            "null"
          ]
        },
        "over_2": {
          "type": [
            "integer",
            "null"
          ]
        }
      }
    },
    "current_roll": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Number of children enrolled, from latest Annual ECE Census.",
      "minimum": 0
    },
    "roll_year": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Year of the roll figure (e.g. 2025)."
    },
    "funding_band": {
      "type": [
        "string",
        "null"
      ],
      "description": "Equity Index funding band where published (e.g. \"EQI > 5\")."
    },
    "status": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "current",
        "provisional",
        "suspended",
        "cancelled",
        null
      ],
      "description": "Licence status. Currently always null — sourcing via OIA."
    },
    "website": {
      "type": [
        "string",
        "null"
      ],
      "description": "Centre website. ~58% coverage — derived from email-domain backfill where the domain is non-freemail (e.g. somerville@aka.org.nz → https://aka.org.nz)."
    },
    "latest_ero": {
      "type": [
        "object",
        "null"
      ],
      "description": "Most recent Education Review Office report. Currently 0 ingested due to Cloudflare Turnstile block on ero.govt.nz; per-centre source URL still surfaced.",
      "properties": {
        "review_date": {
          "type": "string",
          "format": "date"
        },
        "report_type": {
          "type": "string"
        },
        "source_url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "tags": {
      "type": "array",
      "description": "Derived flags (Equity decile band, 20 Hours yes, service category, etc.).",
      "items": {
        "type": "object",
        "properties": {
          "tag": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        }
      }
    },
    "suburb_link": {
      "type": [
        "object",
        "null"
      ],
      "description": "Cross-reference to crimestats.co.nz / SafeSuburbs for suburb safety + 2023 Stats NZ Census demographics. 98% coverage.",
      "properties": {
        "suburb_id": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "match_method": {
          "type": "string",
          "enum": [
            "exact_name",
            "name_unique_within_region",
            "geo_nearest_5km",
            "geo_nearest_10km"
          ]
        },
        "match_confidence": {
          "type": "string",
          "enum": [
            "A",
            "B",
            "C"
          ]
        },
        "source_url": {
          "type": "string",
          "format": "uri"
        }
      }
    }
  },
  "$defs": {
    "provenance": {
      "primary_source": "https://www.educationcounts.govt.nz/__data/assets/text_file/0004/219874/ece-apiv3.json",
      "primary_licence": "CC-BY 4.0",
      "primary_licence_url": "https://creativecommons.org/licenses/by/4.0/",
      "attribution_required": "Source: Ministry of Education ECE Directory (CC-BY 4.0 via data.govt.nz) + Daycare Near Me enrichments (https://daycarenearme.co.nz/sources)",
      "refresh_cadence": "Nightly upstream; re-pulled on every Netlify deploy. Roll data updates annually each July.",
      "full_methodology": "https://daycarenearme.co.nz/methodology",
      "full_sources": "https://daycarenearme.co.nz/sources"
    },
    "endpoints": {
      "per_centre_html": "https://daycarenearme.co.nz/centre/{slug}",
      "per_centre_facts": "https://daycarenearme.co.nz/api/centre/{slug}/facts.json",
      "per_centre_markdown": "https://daycarenearme.co.nz/api/centre/{slug}/markdown.md",
      "full_index": "https://daycarenearme.co.nz/llms-full.txt",
      "mcp_server": "https://daycarenearme.co.nz/mcp"
    }
  }
}