{
  "openapi": "3.1.0",
  "info": {
    "title": "Smith Energy Codes Commercial Jurisdiction & Transitions API",
    "version": "1.0.0",
    "summary": "Primary-sourced U.S. residential & commercial building energy code baseline, local amendment, climate zone, and rulemaking transition intelligence.",
    "description": "Authenticated REST API serving 30,484 U.S. state, county, city, and town jurisdictions across all 50 states and D.C., paired with county-level PNNL-33270 IECC climate zones, compliance software rules, ASHRAE 15 / 15.2 / 34 (A2L) refrigerant safety references, and 2026-2031 rulemaking transitions. Interactive human lookups at https://smithenergycodes.com/map are free without login. Commercial annual licensing spans Year-1 SaaS Display Pilot ($15k-$25k/yr, 1 product, customer UI display scoped by footprint or volume, upgradeable to Tier 2), Tier 1 Bulk SQLite/CSV/JSON snapshots ($18k-$28k/yr internal use), Tier 2 Hosted /api/v1/ + explicit SaaS customer UI display rights ($28k-$45k/yr, weekly updates), and Tier 3 Enterprise Data + Clean-Room Parity QA ($45k-$60k+/yr, 5-business-day priority transitions + multi-product PDF/report exports). All commercial tiers include monthly signed SQLite/JSON failover snapshots, 90-day wind-down notice, perpetual last-snapshot rights, and a clean-room copyright warranty confirming zero ICC/ASHRAE model-code text reproduction (optional third-party escrow available on Pilot, Tier 2, and Tier 3). 14-day trial Bearer keys and redlinable CDLA available on request.",
    "contact": {
      "name": "Smith Energy Codes LLC",
      "email": "alex@smithenergycodes.com",
      "url": "https://smithenergycodes.com/data-api"
    }
  },
  "servers": [
    {
      "url": "https://smithenergycodes.com",
      "description": "Production API"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Commercial API key passed in Authorization: Bearer <SEC_API_KEY>"
      }
    },
    "schemas": {
      "Error401": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "dataset": {
            "type": "object"
          },
          "endpoints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "licensingContact": {
            "type": "string"
          },
          "infoUrl": {
            "type": "string"
          }
        }
      },
      "MetaResponse": {
        "type": "object",
        "properties": {
          "apiVersion": {
            "type": "string",
            "example": "1.0"
          },
          "built": {
            "type": "string",
            "format": "date",
            "example": "2026-11-30"
          },
          "sourceDatabaseSha256": {
            "type": "string"
          },
          "total": {
            "type": "integer",
            "example": 30484
          },
          "totalJurisdictions": {
            "type": "integer",
            "example": 30484
          },
          "statesCount": {
            "type": "integer",
            "example": 51
          },
          "localCount": {
            "type": "integer",
            "example": 30433
          },
          "provenanceCounts": {
            "type": "object",
            "properties": {
              "primary": {
                "type": "integer",
                "example": 3955
              },
              "state_list": {
                "type": "integer",
                "example": 20785
              },
              "unverified": {
                "type": "integer",
                "example": 5744
              }
            }
          },
          "climateZoneCount": {
            "type": "integer",
            "example": 30408
          },
          "climateZonesResolved": {
            "type": "integer",
            "example": 30408
          },
          "distinctEventsCount": {
            "type": "integer",
            "example": 584
          },
          "pilotOverlaysCount": {
            "type": "integer",
            "example": 22
          },
          "zipsCount": {
            "type": "integer",
            "example": 33642
          },
          "zipsMapped": {
            "type": "integer",
            "example": 33642
          }
        }
      },
      "SectorCode": {
        "type": "object",
        "description": "Adopted residential or commercial energy code details.",
        "properties": {
          "b": {
            "type": [
              "string",
              "null"
            ],
            "description": "Short edition year or bucket (e.g. 2021, 2024, none)"
          },
          "l": {
            "type": "string",
            "description": "Short edition label (e.g. 2021 IECC)"
          },
          "rn": {
            "type": [
              "string",
              "null"
            ],
            "description": "Official local or state code title"
          },
          "ad": {
            "type": [
              "string",
              "null"
            ],
            "description": "Adopted date (YYYY-MM-DD)"
          },
          "ef": {
            "type": [
              "string",
              "null"
            ],
            "description": "Effective date (YYYY-MM-DD)"
          },
          "am": {
            "type": [
              "string",
              "null"
            ],
            "description": "Amendment summary label"
          },
          "aml": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "none",
              "minor",
              "moderate",
              "substantial",
              "state_written",
              "unknown",
              null
            ],
            "description": "Amendment level"
          },
          "sc": {
            "type": [
              "string",
              "null"
            ],
            "description": "Scope description (e.g. Statewide all, Other)"
          },
          "m": {
            "type": [
              "string",
              "null"
            ],
            "description": "Framework adoption model slug"
          },
          "ml": {
            "type": [
              "string",
              "null"
            ],
            "description": "Human-readable framework adoption model label"
          },
          "ka": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Key amendment highlights"
          },
          "ap": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Allowed alternative compliance paths"
          },
          "me": {
            "type": [
              "boolean",
              "integer",
              "null"
            ],
            "description": "Whether locality may exceed state energy floor (local_may_exceed)"
          },
          "mw": {
            "type": [
              "boolean",
              "integer",
              "null"
            ],
            "description": "Whether locality may adopt less stringent code (local_may_weaken)"
          },
          "split": {
            "type": [
              "string",
              "null"
            ],
            "description": "Occupancy split / story-count boundary note"
          }
        }
      },
      "JurisdictionRecord": {
        "type": "object",
        "description": "Hydrated compact jurisdiction record (matching /api/v1/sample and /api/v1/jurisdictions/{id}).",
        "properties": {
          "n": {
            "type": "string",
            "description": "Official jurisdiction name"
          },
          "t": {
            "type": "string",
            "description": "Jurisdiction type (state, county, city, town, etc.)"
          },
          "st": {
            "type": "string",
            "description": "Two-letter state abbreviation"
          },
          "g": {
            "type": [
              "string",
              "null"
            ],
            "description": "Census GEOID / FIPS"
          },
          "cf": {
            "type": "string",
            "enum": [
              "h",
              "m",
              "l"
            ],
            "description": "Confidence tier code (h = high, m = medium, l = low / lead)"
          },
          "pr": {
            "type": "string",
            "enum": [
              "p",
              "s",
              "c"
            ],
            "description": "Provenance tier code (p = primary local ordinance, s = state_list official baseline, c = composite/unverified baseline lead)"
          },
          "unv": {
            "type": "integer",
            "enum": [
              0,
              1,
              2
            ],
            "description": "Unverified flag (0 = verified primary/state list, 1 = unverified baseline lead, 2 = state list/survey with unverified local deviation)"
          },
          "ld": {
            "type": [
              "boolean",
              "integer"
            ],
            "description": "Lead indicator flag"
          },
          "pt": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "number"
            },
            "description": "Centroid [lat, lon] when available"
          },
          "pc": {
            "type": "string",
            "enum": [
              "",
              "a",
              "x",
              "r",
              "l"
            ],
            "description": "Overall pending transition stage code (a = adopted not effective, x = litigation, r = rulemaking, l = legislation/review/other)"
          },
          "pcr": {
            "type": "string",
            "enum": [
              "",
              "a",
              "x",
              "r",
              "l"
            ],
            "description": "Residential pending transition stage code"
          },
          "pcc": {
            "type": "string",
            "enum": [
              "",
              "a",
              "x",
              "r",
              "l"
            ],
            "description": "Commercial pending transition stage code"
          },
          "pl": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "",
              "e",
              "b",
              "v",
              "g",
              null
            ],
            "description": "Active adjacent policy/stretch tag (e = stretch/electrification, b = BPS/benchmarking, v = EV/solar ready, g = state gas preemption)"
          },
          "ka": {
            "type": "integer",
            "enum": [
              0,
              1,
              2
            ],
            "description": "Amendment flag (0 = none, 1 = local amendments, 2 = substantial / state-written)"
          },
          "ac": {
            "type": [
              "string",
              "null"
            ],
            "description": "Statutory local authority category (residential)"
          },
          "acc": {
            "type": [
              "string",
              "null"
            ],
            "description": "Statutory local authority category (commercial)"
          },
          "acn": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Local authority statutory summary notes"
          },
          "dt": {
            "type": [
              "string",
              "null"
            ],
            "description": "Verification date (YYYY-MM-DD)"
          },
          "cz": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "z18": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "2018 & earlier IECC climate zone"
                  },
                  "z21": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "2021/2024 IECC PNNL-33270 climate zone"
                  },
                  "ba": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Building America climate region"
                  },
                  "co": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "County or parish name"
                  },
                  "sh": {
                    "type": [
                      "integer",
                      "boolean",
                      "null"
                    ],
                    "description": "2018->2021 climate zone shift indicator"
                  },
                  "wh": {
                    "type": [
                      "integer",
                      "boolean",
                      "null"
                    ],
                    "description": "Warm-Humid climate designation indicator"
                  },
                  "multi": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Multiple zones when city spans counties"
                  },
                  "zones": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Statewide IECC zone list on state records"
                  },
                  "shifted": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "Shifted-county count on state records"
                  }
                }
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "County-level PNNL-33270 IECC climate zone object ({z18, z21, ba, co, sh, wh}) or zone code"
          },
          "res": {
            "$ref": "#/components/schemas/SectorCode"
          },
          "com": {
            "$ref": "#/components/schemas/SectorCode"
          },
          "sum": {
            "type": [
              "string",
              "null"
            ],
            "description": "Concise public-record narrative summary"
          },
          "ce": {
            "type": [
              "string",
              "null"
            ],
            "description": "Compliance enforcement summary"
          },
          "ct": {
            "type": [
              "string",
              "null"
            ],
            "description": "Field testing / verification summary"
          },
          "ctSrc": {
            "type": [
              "string",
              "null"
            ],
            "description": "Provenance of field testing note (e.g. 'state' when inherited from statewide rule)"
          },
          "con": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactItem"
            },
            "description": "Administering office contacts"
          },
          "ab": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdoptingBodyItem"
            },
            "description": "Adopting legislative or rulemaking bodies"
          },
          "la": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LegalAuthorityItem"
            },
            "description": "Legal authority and ordinance citations"
          },
          "links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResourceLinkItem"
            },
            "description": "Official code and agency resource links"
          },
          "spec": {
            "type": [
              "object",
              "null"
            ],
            "description": "Verified technical summary tags (e.g. cz, tags, ach, eri, duct, cfm, ashrae)"
          },
          "pol": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PolicyItem"
            },
            "description": "Adjacent energy policies (BPS, benchmarking, electrification, EV)"
          },
          "uc": {
            "type": [
              "string",
              "null"
            ],
            "description": "Code update cycle description"
          },
          "hist": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CodeHistoryItem"
            },
            "description": "Superseded prior code editions"
          },
          "pilot": {
            "type": [
              "integer",
              "boolean",
              "object",
              "null"
            ],
            "description": "Pilot Project setup overlay availability flag or summary"
          },
          "srcs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourceItem"
            },
            "description": "Verified primary and reference sources with URLs and verbatim quotes"
          },
          "pend": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PendingItem"
            },
            "description": "Pending code changes and rulemaking milestones (with stCat, dtType, and optional inh inherited flag)"
          },
          "gaps": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Open verification gaps or items to confirm with AHJ"
          }
        }
      },
      "ComplianceOverlay": {
        "type": "object",
        "properties": {
          "stateRule": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ComplianceOverlayRule"
              },
              {
                "type": "null"
              }
            ],
            "description": "Statewide REScheck/COMcheck/ERI compliance software rule"
          },
          "pilot": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ComplianceOverlayRule"
              },
              {
                "type": "null"
              }
            ],
            "description": "Provision-level Project setup overlay (22 pilot jurisdictions including Chicago, Seattle, Denver, Boulder, Austin, Phoenix, Boston)"
          }
        }
      },
      "JurisdictionDetailResponse": {
        "type": "object",
        "properties": {
          "apiVersion": {
            "type": "string"
          },
          "built": {
            "type": "string"
          },
          "sourceDatabaseSha256": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "example": "US-CO-denver"
          },
          "record": {
            "$ref": "#/components/schemas/JurisdictionRecord"
          },
          "complianceOverlay": {
            "$ref": "#/components/schemas/ComplianceOverlay"
          },
          "refrigerantSafety": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/RefrigerantSafety"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ZipCandidate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "confidenceTier": {
            "type": "string"
          },
          "provenanceTier": {
            "type": "string"
          },
          "record": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/JurisdictionRecord"
              },
              {
                "type": "null"
              }
            ]
          },
          "complianceOverlay": {
            "type": [
              "object",
              "null"
            ]
          },
          "refrigerantSafety": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/RefrigerantSafety"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ZipLookupResponse": {
        "type": "object",
        "properties": {
          "apiVersion": {
            "type": "string"
          },
          "built": {
            "type": "string"
          },
          "sourceDatabaseSha256": {
            "type": "string"
          },
          "zip": {
            "type": "string",
            "example": "80202"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "example": "CO"
          },
          "isSplitZip": {
            "type": "boolean"
          },
          "candidateCount": {
            "type": "integer"
          },
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ZipCandidate"
            }
          }
        }
      },
      "BatchRequest": {
        "type": "object",
        "properties": {
          "ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Up to 100 combined canonical jurisdiction IDs"
          },
          "zips": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "5-digit ZCTA ZIP codes (combined limit 100 with ids)"
          }
        }
      },
      "BatchResponse": {
        "type": "object",
        "properties": {
          "apiVersion": {
            "type": "string"
          },
          "built": {
            "type": "string"
          },
          "sourceDatabaseSha256": {
            "type": "string"
          },
          "requested": {
            "type": "object"
          },
          "results": {
            "type": "object",
            "properties": {
              "byId": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JurisdictionDetailResponse"
                }
              },
              "byZip": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/ZipLookupResponse"
                }
              }
            }
          }
        }
      },
      "StateListResponse": {
        "type": "object",
        "properties": {
          "apiVersion": {
            "type": "string"
          },
          "built": {
            "type": "string"
          },
          "sourceDatabaseSha256": {
            "type": "string"
          },
          "state": {
            "type": [
              "string",
              "null"
            ]
          },
          "tier": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JurisdictionRecord"
            }
          }
        }
      },
      "TransitionItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "n": {
            "type": "string"
          },
          "st": {
            "type": "string"
          },
          "isSt": {
            "type": "integer"
          },
          "sec": {
            "type": "string"
          },
          "stg": {
            "type": "string"
          },
          "stCat": {
            "type": "string"
          },
          "dt": {
            "type": [
              "string",
              "null"
            ]
          },
          "dtType": {
            "type": [
              "string",
              "null"
            ]
          },
          "tb": {
            "type": [
              "string",
              "null"
            ]
          },
          "d": {
            "type": "string"
          }
        }
      },
      "TransitionsResponse": {
        "type": "object",
        "properties": {
          "apiVersion": {
            "type": "string"
          },
          "built": {
            "type": "string"
          },
          "sourceDatabaseSha256": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransitionItem"
            }
          }
        }
      },
      "Error429": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "example": "Rate limit exceeded"
          },
          "retryAfterSeconds": {
            "type": "integer",
            "example": 60
          }
        }
      },
      "SourceItem": {
        "type": "object",
        "properties": {
          "t": {
            "type": "string",
            "description": "Source title"
          },
          "pub": {
            "type": [
              "string",
              "null"
            ],
            "description": "Publisher or agency"
          },
          "u": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Primary source URL"
          },
          "pri": {
            "type": "boolean",
            "description": "Whether primary statutory/municipal source"
          },
          "dt": {
            "type": [
              "string",
              "null"
            ],
            "description": "Access date (YYYY-MM-DD)"
          },
          "q": {
            "type": [
              "string",
              "null"
            ],
            "description": "Short verbatim excerpt"
          }
        }
      },
      "PendingItem": {
        "type": "object",
        "properties": {
          "sec": {
            "type": "string",
            "description": "Sector (res, com, both)"
          },
          "stg": {
            "type": "string",
            "description": "Stage (adopted_not_effective, rulemaking, legislation, under_review, litigation, other)"
          },
          "stCat": {
            "type": "string",
            "enum": [
              "adopted",
              "proposed",
              "monitoring",
              "no_change"
            ]
          },
          "dt": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO date YYYY-MM-DD when known"
          },
          "dtType": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "effective",
              "target",
              "hearing",
              "unknown",
              "none",
              null
            ]
          },
          "tb": {
            "type": [
              "string",
              "null"
            ],
            "description": "Target edition / standard label"
          },
          "d": {
            "type": "string",
            "description": "Summary description"
          },
          "inh": {
            "type": [
              "boolean",
              "integer"
            ],
            "description": "Inherited from state record"
          }
        }
      },
      "RefrigerantSectorRule": {
        "type": "object",
        "properties": {
          "adoption_scope": {
            "type": [
              "string",
              "null"
            ]
          },
          "mechanical_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "base_model": {
            "type": [
              "string",
              "null"
            ]
          },
          "base_edition": {
            "type": [
              "string",
              "null"
            ]
          },
          "ashrae_15": {
            "type": [
              "string",
              "null"
            ],
            "description": "Referenced ASHRAE 15 edition or status (e.g. '2022', 'not_referenced', 'set_locally')"
          },
          "ashrae_15_2": {
            "type": [
              "string",
              "null"
            ],
            "description": "Referenced ASHRAE 15.2 edition or status"
          },
          "ashrae_34": {
            "type": [
              "string",
              "null"
            ],
            "description": "Referenced ASHRAE 34 edition or status"
          },
          "scope_15_2_mf": {
            "type": [
              "string",
              "null"
            ],
            "description": "Multifamily R-2 applicability for ASHRAE 15.2"
          },
          "addenda": {
            "type": [
              "string",
              "null"
            ]
          },
          "local_deviation": {
            "type": [
              "string",
              "null"
            ]
          },
          "effective_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "pending_changes": {
            "type": [
              "string",
              "null"
            ]
          },
          "confidence": {
            "type": [
              "string",
              "null"
            ]
          },
          "basis_method": {
            "type": [
              "string",
              "null"
            ]
          },
          "as_of": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "RefrigerantEntity": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "commercial": {
            "$ref": "#/components/schemas/RefrigerantSectorRule"
          },
          "residential": {
            "$ref": "#/components/schemas/RefrigerantSectorRule"
          }
        }
      },
      "RefrigerantSafety": {
        "type": "object",
        "description": "Resolved ASHRAE 15 / 15.2 / 34 (A2L) refrigerant safety reference bundle for the jurisdiction and parent state.",
        "properties": {
          "id": {
            "type": "string"
          },
          "stateId": {
            "type": "string"
          },
          "abbr": {
            "type": "string"
          },
          "as_of": {
            "type": "string",
            "example": "2026-11-30"
          },
          "coverage": {
            "type": "string",
            "enum": [
              "verified_local_override",
              "verified_local_follows_state",
              "verified_state_baseline",
              "verified_set_locally",
              "set_locally_pending"
            ]
          },
          "coverageLabel": {
            "type": "string"
          },
          "local": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/RefrigerantEntity"
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/RefrigerantEntity"
              },
              {
                "type": "null"
              }
            ]
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "publisher": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "accessed": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        }
      },
      "LatLonLookupResponse": {
        "type": "object",
        "properties": {
          "apiVersion": {
            "type": "string"
          },
          "built": {
            "type": "string"
          },
          "sourceDatabaseSha256": {
            "type": "string"
          },
          "coordinates": {
            "type": "object",
            "properties": {
              "lat": {
                "type": "number",
                "example": 39.7392
              },
              "lon": {
                "type": "number",
                "example": -104.9903
              }
            }
          },
          "resolvedBy": {
            "type": "string",
            "example": "census_geographies"
          },
          "matchedGeoids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "id": {
            "type": "string",
            "example": "US-CO-denver"
          },
          "record": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/JurisdictionRecord"
              },
              {
                "type": "null"
              }
            ]
          },
          "complianceOverlay": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ComplianceOverlay"
              },
              {
                "type": "null"
              }
            ]
          },
          "refrigerantSafety": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/RefrigerantSafety"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ContactItem": {
        "type": "object",
        "description": "Official building department or administering agency contact.",
        "properties": {
          "n": {
            "type": "string",
            "description": "Agency or office name"
          },
          "r": {
            "type": [
              "string",
              "null"
            ],
            "description": "Role or responsibility"
          },
          "u": {
            "type": [
              "string",
              "null"
            ],
            "description": "Official URL"
          },
          "p": {
            "type": [
              "string",
              "null"
            ],
            "description": "Phone number when published"
          },
          "e": {
            "type": [
              "string",
              "null"
            ],
            "description": "Email address when published"
          }
        }
      },
      "AdoptingBodyItem": {
        "type": "object",
        "description": "Legislative, council, or rulemaking adopting authority.",
        "properties": {
          "n": {
            "type": "string",
            "description": "Body name"
          },
          "k": {
            "type": [
              "string",
              "null"
            ],
            "description": "Body kind (e.g. Local governing body, agency)"
          },
          "u": {
            "type": [
              "string",
              "null"
            ],
            "description": "Official URL"
          }
        }
      },
      "LegalAuthorityItem": {
        "type": "object",
        "description": "Statutory, ordinance, or administrative-code legal citation.",
        "properties": {
          "c": {
            "type": "string",
            "description": "Statutory or ordinance citation"
          },
          "d": {
            "type": [
              "string",
              "null"
            ],
            "description": "Plain-English summary of authority or adoption"
          },
          "u": {
            "type": [
              "string",
              "null"
            ],
            "description": "Primary legal text URL"
          }
        }
      },
      "ResourceLinkItem": {
        "type": "object",
        "description": "Official reference, adoption page, code text, or guidance link.",
        "properties": {
          "k": {
            "type": [
              "string",
              "null"
            ],
            "description": "Resource category (e.g. Adoption page, Code text, guide)"
          },
          "t": {
            "type": "string",
            "description": "Link title"
          },
          "u": {
            "type": "string",
            "description": "Official URL"
          }
        }
      },
      "PolicyItem": {
        "type": "object",
        "description": "Adjacent building energy policy (BPS, benchmarking, electrification, EV/solar ready).",
        "properties": {
          "cat": {
            "type": "string",
            "description": "Policy category (e.g. electrification, benchmarking, bps, ev)"
          },
          "name": {
            "type": "string",
            "description": "Policy or ordinance title"
          },
          "st": {
            "type": [
              "string",
              "null"
            ],
            "description": "Policy status (e.g. In force, Adopted, Proposed)"
          },
          "d": {
            "type": [
              "string",
              "null"
            ],
            "description": "Plain-English summary"
          }
        }
      },
      "CodeHistoryItem": {
        "type": "object",
        "description": "Prior adopted energy code edition superseded by the current code.",
        "properties": {
          "sec": {
            "type": "string",
            "description": "Sector code (r = residential, c = commercial)"
          },
          "l": {
            "type": "string",
            "description": "Edition label"
          },
          "ef": {
            "type": [
              "string",
              "null"
            ],
            "description": "Prior effective date (YYYY-MM-DD or empty)"
          },
          "sup": {
            "type": [
              "string",
              "null"
            ],
            "description": "Superseded date (YYYY-MM-DD or empty)"
          }
        }
      },
      "ComplianceSoftwareRule": {
        "type": "object",
        "properties": {
          "status": {
            "type": [
              "string",
              "null"
            ],
            "description": "Acceptance status (accepted, addendum, restricted, not_accepted)"
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Short human-readable acceptance label"
          },
          "dropdown": {
            "type": [
              "string",
              "null"
            ],
            "description": "Recommended REScheck-Web / COMcheck-Web dropdown setting"
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Jurisdiction-specific submittal or software caveat"
          }
        }
      },
      "ComplianceEriRule": {
        "type": "object",
        "properties": {
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "targets": {
            "type": [
              "string",
              "null"
            ],
            "description": "Maximum ERI score targets with and without on-site power production"
          },
          "backstop": {
            "type": [
              "string",
              "null"
            ],
            "description": "Thermal envelope backstop citation"
          },
          "pv_rule": {
            "type": [
              "string",
              "null"
            ],
            "description": "On-site solar / renewable credit rule"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ComplianceTestingRule": {
        "type": "object",
        "properties": {
          "ach50": {
            "type": [
              "string",
              "null"
            ]
          },
          "ducts": {
            "type": [
              "string",
              "null"
            ]
          },
          "vent": {
            "type": [
              "string",
              "null"
            ]
          },
          "sampling": {
            "type": [
              "string",
              "null"
            ]
          },
          "credentials": {
            "type": [
              "string",
              "null"
            ]
          },
          "com_air": {
            "type": [
              "string",
              "null"
            ]
          },
          "alt_note": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ComplianceOverlayRule": {
        "type": "object",
        "description": "Statewide or pilot provision-level Project setup compliance overlay.",
        "properties": {
          "pilot": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "checked": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "rescheck": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ComplianceSoftwareRule"
              },
              {
                "type": "null"
              }
            ]
          },
          "comcheck": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ComplianceSoftwareRule"
              },
              {
                "type": "null"
              }
            ]
          },
          "eri": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ComplianceEriRule"
              },
              {
                "type": "null"
              }
            ]
          },
          "testing": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ComplianceTestingRule"
              },
              {
                "type": "null"
              }
            ]
          },
          "deltas_res": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "deltas_com": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "height_scope_note": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    }
  },
  "paths": {
    "/api/v1/sample": {
      "get": {
        "operationId": "getSample",
        "security": [],
        "summary": "Fetch fixed single-record public sandbox fixture (US-CO-denver + dataset summary; no API key required)",
        "responses": {
          "200": {
            "description": "Public single-record sandbox fixture for US-CO-denver with dataset coverage counts",
            "headers": {
              "X-Source-Database-SHA256": {
                "schema": {
                  "type": "string"
                }
              },
              "X-License": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/JurisdictionDetailResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "sandbox": {
                          "type": "boolean",
                          "example": true
                        },
                        "note": {
                          "type": "string"
                        },
                        "dataset": {
                          "type": "object",
                          "properties": {
                            "totalJurisdictions": {
                              "type": "integer",
                              "example": 30484
                            },
                            "provenanceCounts": {
                              "type": "object",
                              "properties": {
                                "primary": {
                                  "type": "integer",
                                  "example": 3955
                                },
                                "state_list": {
                                  "type": "integer",
                                  "example": 20785
                                },
                                "unverified": {
                                  "type": "integer",
                                  "example": 5744
                                }
                              }
                            },
                            "climateZonesResolved": {
                              "type": "integer",
                              "example": 30408
                            },
                            "zipsMapped": {
                              "type": "integer",
                              "example": 33642
                            },
                            "distinctEventsCount": {
                              "type": "integer",
                              "example": 584
                            },
                            "pilotOverlaysCount": {
                              "type": "integer",
                              "example": 22
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (60 req/min default burst; 30 req/min on Year-1 Pilot; custom on Tier 3)",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "description": "Seconds until the current 60-second window resets"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error429"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/meta": {
      "get": {
        "operationId": "getMeta",
        "summary": "Get dataset release fingerprint & national coverage metrics",
        "responses": {
          "200": {
            "description": "Current database release metadata and SHA-256 fingerprint",
            "headers": {
              "X-Source-Database-SHA256": {
                "schema": {
                  "type": "string"
                }
              },
              "X-License": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetaResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid commercial Bearer API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error401"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (60 req/min default burst; 30 req/min on Year-1 Pilot; custom on Tier 3)",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "description": "Seconds until the current 60-second window resets"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error429"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jurisdictions": {
      "get": {
        "operationId": "queryJurisdictions",
        "summary": "Resolve 5-digit ZCTA ZIP codes, lat/lon coordinates via Census geographies, or list state jurisdictions by provenance tier",
        "parameters": [
          {
            "name": "zip",
            "in": "query",
            "required": false,
            "description": "5-digit ZCTA ZIP code (e.g., 80202). Returns isSplitZip and hydrated candidate records.",
            "schema": {
              "type": "string",
              "pattern": "^\\d{5}$"
            }
          },
          {
            "name": "lat",
            "in": "query",
            "required": false,
            "description": "WGS84 latitude (-90..90) for Census geographies coordinate resolution; must be paired with lon.",
            "schema": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            }
          },
          {
            "name": "lon",
            "in": "query",
            "required": false,
            "description": "WGS84 longitude (-180..180) for Census geographies coordinate resolution; must be paired with lat.",
            "schema": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "Two-letter state abbreviation when filtering state records without zip or lat/lon",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tier",
            "in": "query",
            "required": false,
            "description": "Filter by provenance tier (primary, state_list, unverified, or short code p, s, c)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size (1-250, default 50)",
            "schema": {
              "type": "integer",
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Pagination offset",
            "schema": {
              "type": "integer",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Hydrated ZIP lookup, lat/lon point-in-polygon resolution, or paginated state query result",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ZipLookupResponse"
                    },
                    {
                      "$ref": "#/components/schemas/LatLonLookupResponse"
                    },
                    {
                      "$ref": "#/components/schemas/StateListResponse"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid query parameter"
          },
          "401": {
            "description": "Missing or invalid Bearer API key"
          },
          "404": {
            "description": "State not found or coordinates outside mapped U.S. state boundaries"
          },
          "429": {
            "description": "Rate limit exceeded (60 req/min default burst; 30 req/min on Year-1 Pilot; custom on Tier 3)",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "description": "Seconds until the current 60-second window resets"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error429"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/batch": {
      "post": {
        "operationId": "batchLookup",
        "summary": "Batch lookup up to 100 combined jurisdiction IDs and/or 5-digit ZIP codes",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Hydrated byId and byZip maps",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid payload or limit > 100 exceeded"
          },
          "401": {
            "description": "Missing or invalid Bearer API key"
          },
          "429": {
            "description": "Rate limit exceeded (60 req/min default burst; 30 req/min on Year-1 Pilot; custom on Tier 3)",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "description": "Seconds until the current 60-second window resets"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error429"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jurisdictions/{id}": {
      "get": {
        "operationId": "getJurisdiction",
        "summary": "Fetch full primary-sourced jurisdiction record & software compliance overlay",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Canonical jurisdiction ID (e.g., US-CO-denver, US-FL, US-AZ-phoenix)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Hydrated jurisdiction record and software overlay",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Source-Database-SHA256": {
                "schema": {
                  "type": "string"
                }
              },
              "X-License": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JurisdictionDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid jurisdiction ID format"
          },
          "401": {
            "description": "Missing or invalid Bearer API key"
          },
          "404": {
            "description": "State or jurisdiction not found"
          },
          "429": {
            "description": "Rate limit exceeded (60 req/min default burst; 30 req/min on Year-1 Pilot; custom on Tier 3)",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "description": "Seconds until the current 60-second window resets"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error429"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/transitions": {
      "get": {
        "operationId": "listTransitions",
        "summary": "List tracked state & local 2026-2031 energy code rulemaking and adoption transitions",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "Two-letter state abbreviation (e.g., CO, AL, WA)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stage",
            "in": "query",
            "required": false,
            "description": "Transition stage (adopted_not_effective, rulemaking, legislation, under_review, litigation, other)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sector",
            "in": "query",
            "required": false,
            "description": "Sector filter (res, com, both)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Filtered list of code transitions",
            "headers": {
              "X-Source-Database-SHA256": {
                "schema": {
                  "type": "string"
                }
              },
              "X-License": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransitionsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer API key"
          },
          "429": {
            "description": "Rate limit exceeded (60 req/min default burst; 30 req/min on Year-1 Pilot; custom on Tier 3)",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "description": "Seconds until the current 60-second window resets"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error429"
                }
              }
            }
          }
        }
      }
    }
  }
}
