{
  "openapi": "3.1.0",
  "info": {
    "title": "Local Rate Index Public Benchmark, Quote Auditor & Statutory Fee API",
    "version": "1.1.0",
    "description": "Query verified US metropolitan and ZIP-level service rate quartiles (p25/p50/p75), audit written contractor quotes or commercial tow invoices, check statutory fee caps (LAPD OPG heavy-duty towing, TX TMARR mold remediation, Dallas structural foundation permits, ASTM E1527-21 Phase I ESA, ALTA/NSPS land surveying, TX TDLR property tax protest, NFPA 96 & FOG kitchen compliance), and inspect anonymized state-licensed operator rankings."
  },
  "servers": [
    {
      "url": "https://localrateindex.com"
    }
  ],
  "paths": {
    "/api/mcp": {
      "get": {
        "operationId": "checkLocalFairRateAndRules",
        "summary": "Check calibrated local service price quartiles, statutory caps, and licensed operator standings.",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": { "type": "string", "example": "TX" },
            "description": "2-letter US state code (TX or CA)."
          },
          {
            "name": "city_or_zip",
            "in": "query",
            "required": true,
            "schema": { "type": "string", "example": "75024" },
            "description": "5-digit ZIP code (e.g. 75024, 75248, 90744) or metro slug (dallas-fort-worth, los-angeles)."
          },
          {
            "name": "vertical",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "water-damage-remediation",
                "heavy-duty-towing",
                "foundation-repair",
                "land-surveying",
                "phase-1-esa",
                "property-tax-protest",
                "commercial-kitchen-hood-grease"
              ]
            },
            "description": "Canonical service vertical slug."
          }
        ],
        "responses": {
          "200": {
            "description": "Calibrated pricing quartiles, statutory rules, and anonymized top 5 licensed operators."
          },
          "404": {
            "description": "Jurisdiction or vertical not yet indexed."
          }
        }
      }
    },
    "/api/quote-audit": {
      "get": {
        "operationId": "auditWrittenContractorQuote",
        "summary": "Audit a written contractor proposal or tow invoice in USD against local quartiles and statutory fee caps.",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": { "type": "string", "example": "CA" }
          },
          {
            "name": "city_or_zip",
            "in": "query",
            "required": true,
            "schema": { "type": "string", "example": "90744" }
          },
          {
            "name": "vertical",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "water-damage-remediation",
                "heavy-duty-towing",
                "foundation-repair",
                "land-surveying",
                "phase-1-esa",
                "property-tax-protest",
                "commercial-kitchen-hood-grease"
              ]
            }
          },
          {
            "name": "quoted_amount_usd",
            "in": "query",
            "required": true,
            "schema": { "type": "number", "example": 1850 }
          }
        ],
        "responses": {
          "200": {
            "description": "Percentile rank, variance vs median, statutory cap alerts, and negotiation checklist."
          }
        }
      }
    }
  }
}
