{
  "openapi": "3.1.0",
  "info": {
    "title": "Strong Tower Consulting Open Freight Data & Calculator REST API",
    "version": "1.1.0",
    "summary": "Public zero-authentication REST API for U.S. EIA diesel fuel surcharge math, U.S. DOT FMCSA state motor carrier census aggregates, ANSI ASC X12 freight EDI 204/990/214/210/997/322 validation, LTL density and NMFC Docket 2025-1 class calculation, deterministic freight operations calculators, and canonical Strong Tower Consulting entity discovery.",
    "description": "Free, zero-authentication JSON REST API and open knowledge surface published by Strong Tower Consulting, LLC (Forest City, Iowa; founded July 29, 2008; Minnesota Business File 2948628-2). All 6 live /api/v1/* endpoints support CORS (Access-Control-Allow-Origin: *) and CC-BY-4.0 attribution. Exspeedite is a Strong Tower company; Strong Tower Consulting, LLC and Exspeedite LLC are affiliated under common ownership and part of the same company, and consulting never requires a software purchase.",
    "termsOfService": "https://strongtoweronline.com/legal/terms",
    "contact": {
      "name": "Strong Tower Consulting, LLC",
      "url": "https://strongtoweronline.com/contact",
      "email": "support@strongtoweronline.com"
    },
    "license": {
      "name": "Creative Commons Attribution 4.0 International (CC-BY-4.0)",
      "identifier": "CC-BY-4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    },
    "x-organization": {
      "legal_name": "Strong Tower Consulting, LLC",
      "canonical_url": "https://strongtoweronline.com/",
      "headquarters": "Forest City, Iowa",
      "founded": "2008-07-29",
      "minnesota_business_file": "2948628-2",
      "founder": "Scott Elliott",
      "phone": "763-244-1373"
    }
  },
  "externalDocs": {
    "description": "Interactive API Developer Hub & Live Request Tester",
    "url": "https://strongtoweronline.com/api"
  },
  "servers": [
    {
      "url": "https://strongtoweronline.com",
      "description": "Production Cloudflare Pages Edge API"
    }
  ],
  "tags": [
    {
      "name": "Live Freight API v1",
      "description": "Zero-auth edge JSON endpoints served by Cloudflare Pages Functions with CORS enabled."
    },
    {
      "name": "Entity & Agent Discovery",
      "description": "Static JSON-LD, entity profiles, and browser tool catalogs for search engines and AI agents."
    },
    {
      "name": "Open Federal Freight Datasets",
      "description": "Static federal U.S. EIA and U.S. DOT FMCSA aggregate JSON datasets published under CC-BY-4.0."
    }
  ],
  "paths": {
    "/api/v1/entity": {
      "get": {
        "operationId": "getCanonicalEntity",
        "tags": ["Live Freight API v1"],
        "summary": "Get canonical Strong Tower Consulting entity facts and 4-way brand disambiguation",
        "description": "Returns verified identity data for Strong Tower Consulting, LLC (Forest City, Iowa; founded July 29, 2008; Minnesota Business File 2948628-2), verified sameAs URLs, affiliated software disclosure for Exspeedite LLC, and factual 4-way disambiguation separating it from strongtower.consulting (Bothell, WA, 2014), strongtowerconsulting.com, and strongtowerai.com.",
        "parameters": [
          {
            "name": "section",
            "in": "query",
            "required": false,
            "description": "Optional section filter to return only a subset of the canonical entity payload.",
            "schema": {
              "type": "string",
              "enum": ["entity", "disambiguation", "same_as", "affiliated", "discovery"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Canonical entity and 4-way brand disambiguation JSON payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntityResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid section query parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/diesel-fsc": {
      "get": {
        "operationId": "getDieselBenchmarksAndFsc",
        "tags": ["Live Freight API v1"],
        "summary": "Query U.S. EIA regional diesel benchmarks and compute deterministic fuel surcharge (FSC)",
        "description": "Reads the bundled federal U.S. EIA Retail On-Highway Diesel benchmark dataset (11 U.S. and PADD geographies) and computes exact fuel surcharge per mile using max(0, (diesel - base) / mpg) and total_fsc = fsc_per_mile * miles.",
        "parameters": [
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "Optional region or PADD filter (e.g., US, PADD1, PADD1A, PADD1B, PADD1C, PADD2, PADD3, PADD4, PADD5, California, Midwest). Omit to return all 11 regions with U.S. average FSC summary.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "national": { "summary": "U.S. National Average", "value": "US" },
              "midwest": { "summary": "Midwest (PADD2)", "value": "PADD2" },
              "california": { "summary": "California", "value": "California" }
            }
          },
          {
            "name": "base",
            "in": "query",
            "required": false,
            "description": "Base diesel peg price in USD per gallon (0 to 20).",
            "schema": {
              "type": "number",
              "default": 1.2,
              "minimum": 0,
              "maximum": 20
            }
          },
          {
            "name": "mpg",
            "in": "query",
            "required": false,
            "description": "Contractual fleet fuel economy divisor in miles per gallon (> 0 to 50).",
            "schema": {
              "type": "number",
              "default": 6.5,
              "exclusiveMinimum": 0,
              "maximum": 50
            }
          },
          {
            "name": "miles",
            "in": "query",
            "required": false,
            "description": "Billable linehaul distance in miles (0 to 1,000,000).",
            "schema": {
              "type": "number",
              "default": 1000,
              "minimum": 0,
              "maximum": 1000000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Federal EIA regional diesel records paired with deterministic FSC calculations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DieselFscResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid numeric parameter or unmatched region string.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fmcsa-census": {
      "get": {
        "operationId": "getFmcsaStateCensus",
        "tags": ["Live Freight API v1"],
        "summary": "Query U.S. DOT FMCSA active motor carrier census aggregates by state",
        "description": "Returns national summary totals, state-level aggregate counts across all 50 U.S. states and Washington, D.C. from USDOT FMCSA Open Data (dataset az4n-8mr2), and national FMCSA safety rating distribution. Contains strictly aggregate counts with zero individual carrier rows.",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "Optional 2-letter U.S. state or DC postal code (e.g., IA, MN, TX, CA, IL, DC).",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z]{2}$"
            },
            "example": "IA"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Descending ranking metric applied across the 51 U.S. jurisdictions.",
            "schema": {
              "type": "string",
              "enum": ["interstate", "usdot", "hazmat"],
              "default": "interstate"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of ranked state rows returned when state is omitted (1 to 51).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 51,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "FMCSA national totals, ranked state aggregate rows, and safety rating distribution.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FmcsaCensusResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid state format, sort value, or limit range.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Valid 2-letter code not present in the 50-state plus DC dataset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/freight-math": {
      "get": {
        "operationId": "calculateFreightMath",
        "tags": ["Live Freight API v1"],
        "summary": "Run deterministic freight operations calculations or retrieve schema help",
        "description": "Executes deterministic trucking and freight brokerage math for deadhead percentage, cost per mile (CPM), operating ratio (OR), dock detention billing, and brokerage margin/commission splits. Omit calc to receive the complete schema help payload with example URLs.",
        "parameters": [
          {
            "name": "calc",
            "in": "query",
            "required": false,
            "description": "Calculation mode. Omit to return full schema help.",
            "schema": {
              "type": "string",
              "enum": ["deadhead", "cpm", "operating-ratio", "detention", "broker-margin"]
            }
          },
          {
            "name": "loaded",
            "in": "query",
            "required": false,
            "description": "[deadhead] Loaded billable miles (default 780).",
            "schema": { "type": "number", "default": 780, "minimum": 0 }
          },
          {
            "name": "empty",
            "in": "query",
            "required": false,
            "description": "[deadhead] Empty deadhead reposition miles (default 120).",
            "schema": { "type": "number", "default": 120, "minimum": 0 }
          },
          {
            "name": "fixed_monthly",
            "in": "query",
            "required": false,
            "description": "[cpm] Fixed monthly truck and overhead cost in USD (default 4800).",
            "schema": { "type": "number", "default": 4800, "minimum": 0 }
          },
          {
            "name": "variable_cpm",
            "in": "query",
            "required": false,
            "description": "[cpm] Variable cost per mile in USD (default 1.28).",
            "schema": { "type": "number", "default": 1.28, "minimum": 0 }
          },
          {
            "name": "monthly_miles",
            "in": "query",
            "required": false,
            "description": "[cpm] Monthly operating miles (default 9500).",
            "schema": { "type": "number", "default": 9500, "exclusiveMinimum": 0 }
          },
          {
            "name": "operating_expenses",
            "in": "query",
            "required": false,
            "description": "[operating-ratio] Total operating expenses in USD (default 184000).",
            "schema": { "type": "number", "default": 184000, "minimum": 0 }
          },
          {
            "name": "operating_revenue",
            "in": "query",
            "required": false,
            "description": "[operating-ratio] Total operating revenue in USD (default 200000).",
            "schema": { "type": "number", "default": 200000, "exclusiveMinimum": 0 }
          },
          {
            "name": "hours_at_dock",
            "in": "query",
            "required": false,
            "description": "[detention] Total elapsed hours at dock (default 4.5).",
            "schema": { "type": "number", "default": 4.5, "minimum": 0 }
          },
          {
            "name": "free_hours",
            "in": "query",
            "required": false,
            "description": "[detention] Contractual free hours before detention starts (default 2.0).",
            "schema": { "type": "number", "default": 2.0, "minimum": 0 }
          },
          {
            "name": "hourly_rate",
            "in": "query",
            "required": false,
            "description": "[detention] Hourly detention billing rate in USD (default 75).",
            "schema": { "type": "number", "default": 75, "minimum": 0 }
          },
          {
            "name": "customer_rate",
            "in": "query",
            "required": false,
            "description": "[broker-margin] Customer bill rate in USD (default 2450).",
            "schema": { "type": "number", "default": 2450, "exclusiveMinimum": 0 }
          },
          {
            "name": "carrier_pay",
            "in": "query",
            "required": false,
            "description": "[broker-margin] Carrier buy rate in USD (default 2050).",
            "schema": { "type": "number", "default": 2050, "minimum": 0 }
          },
          {
            "name": "rep_commission_pct",
            "in": "query",
            "required": false,
            "description": "[broker-margin] Rep commission percentage on positive gross margin (default 15).",
            "schema": { "type": "number", "default": 15, "minimum": 0, "maximum": 100 }
          }
        ],
        "responses": {
          "200": {
            "description": "Deterministic calculation result or full schema help when calc is omitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreightMathResponse"
                }
              }
            }
          },
          "400": {
            "description": "Unsupported calc value or invalid numeric parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/edi-validate": {
      "get": {
        "operationId": "validateSampleFreightEdi",
        "tags": ["Live Freight API v1"],
        "summary": "Validate a built-in realistic synthetic ANSI ASC X12 freight EDI sample (204, 990, 214, 210, 997, 322, or broken)",
        "description": "Runs Strong Tower Consulting's zero-dependency ANSI ASC X12 freight EDI validation engine against an embedded synthetic freight EDI payload. Checks the fixed 106-character ISA header, GS/ST/SE/GE/IEA envelope and control-number parity, ST..SE segment counts, and transaction-specific semantic rules for 204, 990, 214, 210, 997, and 322.",
        "parameters": [
          {
            "name": "sample",
            "in": "query",
            "required": false,
            "description": "Built-in synthetic EDI sample to validate (default '204'). Use 'broken' to test SE01 segment-count mismatch detection.",
            "schema": {
              "type": "string",
              "enum": ["204", "990", "214", "210", "997", "322", "broken"],
              "default": "204"
            },
            "examples": {
              "loadTender204": { "summary": "Valid EDI 204 Load Tender", "value": "204" },
              "broken204": { "summary": "Broken EDI 204 (SE01 segment count mismatch)", "value": "broken" },
              "freightInvoice210": { "summary": "Valid EDI 210 Motor Carrier Invoice", "value": "210" },
              "intermodal322": { "summary": "Valid EDI 322 Terminal Ramp Activity", "value": "322" }
            }
          },
          {
            "name": "strict",
            "in": "query",
            "required": false,
            "description": "When true, treats warnings as validation failures (default false).",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Structured ANSI X12 validation audit report including envelope metadata, transaction details, errors, warnings, and raw sample_edi.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EdiValidateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Unsupported sample key or invalid strict flag.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "validateCustomFreightEdi",
        "tags": ["Live Freight API v1"],
        "summary": "Validate a custom ANSI ASC X12 freight EDI payload (204, 990, 214, 210, 997, 322)",
        "description": "Accepts either raw text/plain ANSI ASC X12 EDI or application/json {\"edi\": \"...\"} (maximum 256 KB / 262,144 bytes). Returns HTTP 200 with valid: true or false and full envelope/semantic diagnostics, or HTTP 400 if the payload is empty, malformed JSON, or exceeds 256 KB.",
        "parameters": [
          {
            "name": "strict",
            "in": "query",
            "required": false,
            "description": "When true, treats warnings as validation failures (default false).",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Raw ANSI ASC X12 EDI payload (text/plain) or JSON wrapper {\"edi\": \"...\"}. Capped at 262,144 bytes (256 KB).",
          "content": {
            "text/plain": {
              "schema": {
                "type": "string",
                "maxLength": 262144
              },
              "example": "ISA*00*          *00*          *ZZ*NORTHSTARSHP   *02*MIDWESTCARR    *261205*0830*U*00401*000000997*0*P*:~\nGS*FA*NORTHSTARSHP*MIDWESTCARR*20261205*0830*99701*X*004010~\nST*997*0001~\nAK1*SM*20401~\nAK2*204*0001~\nAK5*A~\nAK9*A*1*1*1~\nSE*6*0001~\nGE*1*99701~\nIEA*1*000000997~"
            },
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["edi"],
                "properties": {
                  "edi": {
                    "type": "string",
                    "description": "Raw ANSI ASC X12 freight EDI interchange string."
                  },
                  "strict": {
                    "type": "boolean",
                    "default": false,
                    "description": "Optional strict mode treating warnings as validation failures."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation audit JSON for the submitted X12 payload (valid: true or false).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EdiValidateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Empty payload, invalid JSON wrapper, missing 'edi' string, or payload exceeding 256 KB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/ltl-density": {
      "get": {
        "operationId": "calculateLtlDensityAndNmfcClass",
        "tags": ["Live Freight API v1"],
        "summary": "Calculate LTL cubic feet, PCF density, linear feet, 18-tier vs. July 2025 NMFC Docket 2025-1 13-tier class, and +2 in. W&I overhang re-class risk",
        "description": "Computes exact LTL shipment weight, actual and effective cubic feet (applying the 96-inch vertical cube rule when stackable=false), PCF density, estimated linear feet across a 96-inch trailer width, Linear Foot Rule trigger (>= 12 ft), standard 18-tier NMFC density class (Class 50 to Class 500), July 2025 NMFC Docket 2025-1 13-subprovision density class (Class 50 to Class 400), docket class shift, and +2 in. W&I laser-dimensioner overhang re-class risk.",
        "parameters": [
          {
            "name": "l",
            "in": "query",
            "required": false,
            "description": "Handling unit length in inches (> 0 to 636, default 48).",
            "schema": { "type": "number", "default": 48, "exclusiveMinimum": 0, "maximum": 636 }
          },
          {
            "name": "w",
            "in": "query",
            "required": false,
            "description": "Handling unit width in inches (> 0 to 144, default 40).",
            "schema": { "type": "number", "default": 40, "exclusiveMinimum": 0, "maximum": 144 }
          },
          {
            "name": "h",
            "in": "query",
            "required": false,
            "description": "Handling unit height in inches (> 0 to 144, default 60).",
            "schema": { "type": "number", "default": 60, "exclusiveMinimum": 0, "maximum": 144 }
          },
          {
            "name": "weight",
            "in": "query",
            "required": false,
            "description": "Weight per handling unit in pounds (> 0 to 50000, default 1200).",
            "schema": { "type": "number", "default": 1200, "exclusiveMinimum": 0, "maximum": 50000 }
          },
          {
            "name": "qty",
            "in": "query",
            "required": false,
            "description": "Number of handling units (integer 1 to 500, default 2).",
            "schema": { "type": "integer", "default": 2, "minimum": 1, "maximum": 500 }
          },
          {
            "name": "stackable",
            "in": "query",
            "required": false,
            "description": "Whether units are stackable (true or false, default true). When false, effective cubic feet applies the 96-inch vertical cube rule.",
            "schema": { "type": "boolean", "default": true }
          },
          {
            "name": "tare",
            "in": "query",
            "required": false,
            "description": "Optional additional pallet tare weight per unit in pounds (0 to 500, default 0).",
            "schema": { "type": "number", "default": 0, "minimum": 0, "maximum": 500 }
          }
        ],
        "responses": {
          "200": {
            "description": "Deterministic LTL density, linear-foot, 18-tier vs. Docket 2025-1 13-tier NMFC class, and W&I +2 in. overhang re-class audit JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LtlDensityResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid numeric, integer, or boolean query parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/strong-tower-entity.jsonld": {
      "get": {
        "operationId": "getStrongTowerEntityJsonLd",
        "tags": ["Entity & Agent Discovery"],
        "summary": "Fetch canonical Schema.org JSON-LD entity graph",
        "description": "Static Schema.org JSON-LD graph defining Strong Tower Consulting, LLC, founder Scott Elliott, verified sameAs identifiers, service catalog, and disambiguation.",
        "responses": {
          "200": {
            "description": "Schema.org JSON-LD entity graph.",
            "content": {
              "application/ld+json": {
                "schema": { "type": "object" }
              }
            }
          }
        }
      }
    },
    "/entity-profile.json": {
      "get": {
        "operationId": "getEntityProfileJson",
        "tags": ["Entity & Agent Discovery"],
        "summary": "Fetch extended machine-readable entity profile and practice catalog",
        "description": "Static JSON entity profile listing Strong Tower Consulting, LLC identifiers, 24 consulting practice pages, calculators, datasets, and research guides.",
        "responses": {
          "200": {
            "description": "Extended organization entity profile JSON.",
            "content": {
              "application/json": {
                "schema": { "type": "object" }
              }
            }
          }
        }
      }
    },
    "/agent-tools.json": {
      "get": {
        "operationId": "getAgentToolsManifest",
        "tags": ["Entity & Agent Discovery"],
        "summary": "Fetch WebMCP browser calculators and diagnostic tools manifest",
        "description": "Static JSON catalog of free browser-local freight calculators, scorecards, and WebMCP tool schemas published by Strong Tower Consulting, LLC.",
        "responses": {
          "200": {
            "description": "Public agent tools and WebMCP browser calculator manifest.",
            "content": {
              "application/json": {
                "schema": { "type": "object" }
              }
            }
          }
        }
      }
    },
    "/datasets/eia-on-highway-diesel-benchmarks-2026-11-30.json": {
      "get": {
        "operationId": "getRawEiaDieselDataset",
        "tags": ["Open Federal Freight Datasets"],
        "summary": "Download raw U.S. EIA Retail On-Highway Diesel Regional Benchmarks (JSON)",
        "description": "Static CC-BY-4.0 JSON compilation of official U.S. EIA weekly retail on-highway diesel prices across 11 U.S. and PADD regions for week ending 2026-11-30.",
        "responses": {
          "200": {
            "description": "U.S. EIA regional diesel benchmark JSON dataset.",
            "content": {
              "application/json": {
                "schema": { "type": "object" }
              }
            }
          }
        }
      }
    },
    "/datasets/fmcsa-active-carriers-by-state-aggregate.json": {
      "get": {
        "operationId": "getRawFmcsaCensusDataset",
        "tags": ["Open Federal Freight Datasets"],
        "summary": "Download raw U.S. DOT FMCSA Active Motor Carrier Census Aggregate by State (JSON)",
        "description": "Static CC-BY-4.0 JSON compilation of USDOT FMCSA active carrier aggregate statistics across all 50 U.S. states and Washington, D.C. plus national safety rating distributions.",
        "responses": {
          "200": {
            "description": "U.S. DOT FMCSA state carrier aggregate JSON dataset.",
            "content": {
              "application/json": {
                "schema": { "type": "object" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Publisher": {
        "type": "object",
        "required": ["name", "url", "phone", "license"],
        "properties": {
          "name": { "type": "string", "const": "Strong Tower Consulting, LLC" },
          "url": { "type": "string", "format": "uri", "const": "https://strongtoweronline.com/" },
          "phone": { "type": "string", "const": "763-244-1373" },
          "license": { "type": "string", "const": "CC-BY-4.0" }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": ["ok", "error", "publisher"],
        "properties": {
          "ok": { "type": "boolean", "const": false },
          "error": { "type": "string" },
          "publisher": { "$ref": "#/components/schemas/Publisher" }
        },
        "additionalProperties": true
      },
      "EntityResponse": {
        "type": "object",
        "required": ["ok", "endpoint", "publisher"],
        "properties": {
          "ok": { "type": "boolean", "const": true },
          "endpoint": { "type": "string", "const": "/api/v1/entity" },
          "section": { "type": "string" },
          "entity": { "type": "object" },
          "affiliated_company": { "type": "object" },
          "disambiguation": { "type": "object" },
          "discovery": { "type": "object" },
          "publisher": { "$ref": "#/components/schemas/Publisher" }
        }
      },
      "DieselFscResponse": {
        "type": "object",
        "required": ["ok", "endpoint", "week_ending", "query", "fsc_calculation", "record_count", "records", "publisher"],
        "properties": {
          "ok": { "type": "boolean", "const": true },
          "endpoint": { "type": "string", "const": "/api/v1/diesel-fsc" },
          "dataset": { "type": "string" },
          "source": { "type": "string" },
          "source_url": { "type": "string", "format": "uri" },
          "compiled_at_utc": { "type": "string", "format": "date-time" },
          "week_ending": { "type": "string", "format": "date" },
          "unit": { "type": "string" },
          "query": {
            "type": "object",
            "properties": {
              "region": { "type": ["string", "null"] },
              "fsc_benchmark_region": { "type": ["string", "null"] },
              "base_usd_per_gal": { "type": "number" },
              "mpg": { "type": "number" },
              "miles": { "type": "number" }
            }
          },
          "fsc_calculation": {
            "type": ["object", "null"],
            "properties": {
              "region": { "type": "string" },
              "week_ending": { "type": "string" },
              "diesel_usd_per_gal": { "type": "number" },
              "base_usd_per_gal": { "type": "number" },
              "mpg": { "type": "number" },
              "miles": { "type": "number" },
              "formula": { "type": "string" },
              "fsc_per_mile": { "type": "number" },
              "total_fsc": { "type": "number" }
            }
          },
          "record_count": { "type": "integer" },
          "records": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "region": { "type": "string" },
                "week_ending": { "type": "string" },
                "diesel_usd_per_gal": { "type": "number" },
                "prior_week_usd_per_gal": { "type": "number" },
                "two_weeks_prior_usd_per_gal": { "type": "number" },
                "change_1wk_usd": { "type": "number" },
                "change_1yr_usd": { "type": "number" },
                "change_2yr_usd": { "type": "number" },
                "fsc_per_mile": { "type": "number" },
                "total_fsc": { "type": "number" }
              }
            }
          },
          "publisher": { "$ref": "#/components/schemas/Publisher" }
        }
      },
      "FmcsaCensusResponse": {
        "type": "object",
        "required": ["ok", "endpoint", "query", "summary_totals", "returned_count", "states", "safety_rating_distribution_interstate", "publisher"],
        "properties": {
          "ok": { "type": "boolean", "const": true },
          "endpoint": { "type": "string", "const": "/api/v1/fmcsa-census" },
          "dataset": { "type": "string" },
          "source": { "type": "string" },
          "source_url": { "type": "string", "format": "uri" },
          "api_endpoint": { "type": "string", "format": "uri" },
          "compiled_at_utc": { "type": "string", "format": "date-time" },
          "methodology_note": { "type": "string" },
          "query": {
            "type": "object",
            "properties": {
              "state": { "type": ["string", "null"] },
              "sort": { "type": "string", "enum": ["interstate", "usdot", "hazmat"] },
              "sort_field": { "type": "string" },
              "limit": { "type": "integer" }
            }
          },
          "summary_totals": {
            "type": "object",
            "properties": {
              "us_50_states_dc_active_usdot_entities": { "type": "integer" },
              "us_50_states_dc_active_interstate_carriers": { "type": "integer" },
              "us_50_states_dc_active_hazmat_entities": { "type": "integer" },
              "all_us_active_interstate_carriers_incl_territories": { "type": "integer" }
            }
          },
          "total_states_in_dataset": { "type": "integer" },
          "returned_count": { "type": "integer" },
          "states": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "rank": { "type": "integer" },
                "rank_metric": { "type": "string" },
                "state_code": { "type": "string" },
                "state_name": { "type": "string" },
                "active_usdot_entities": { "type": "integer" },
                "active_interstate_carriers": { "type": "integer" },
                "active_hazmat_entities": { "type": "integer" },
                "interstate_share_pct": { "type": "number" },
                "snapshot_date_utc": { "type": "string" }
              }
            }
          },
          "safety_rating_distribution_interstate": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "safety_rating_code": { "type": "string" },
                "safety_rating_label": { "type": "string" },
                "active_us_interstate_carriers": { "type": "integer" },
                "share_of_active_interstate_pct": { "type": "number" },
                "snapshot_date_utc": { "type": "string" }
              }
            }
          },
          "publisher": { "$ref": "#/components/schemas/Publisher" }
        }
      },
      "FreightMathResponse": {
        "type": "object",
        "required": ["ok", "endpoint", "publisher"],
        "properties": {
          "ok": { "type": "boolean", "const": true },
          "endpoint": { "type": "string", "const": "/api/v1/freight-math" },
          "mode": { "type": "string" },
          "calc": { "type": "string", "enum": ["deadhead", "cpm", "operating-ratio", "detention", "broker-margin"] },
          "inputs": { "type": "object" },
          "result": { "type": "object" },
          "formulas": { "type": "object" },
          "supported_calculations": {
            "type": "array",
            "items": { "type": "string" }
          },
          "calculations": { "type": "object" },
          "publisher": { "$ref": "#/components/schemas/Publisher" }
        }
      },
      "EdiIssue": {
        "type": "object",
        "required": ["severity", "code", "message"],
        "properties": {
          "severity": { "type": "string", "enum": ["error", "warning"] },
          "code": { "type": "string" },
          "message": { "type": "string" },
          "segmentIndex": { "type": ["integer", "null"] },
          "segmentId": { "type": ["string", "null"] },
          "transactionSet": { "type": ["string", "null"] },
          "controlNumber": { "type": ["string", "null"] }
        }
      },
      "EdiValidateResponse": {
        "type": "object",
        "required": ["ok", "endpoint", "valid", "transaction_set", "segment_count", "envelope", "errors", "warnings", "publisher"],
        "properties": {
          "ok": { "type": "boolean", "const": true },
          "endpoint": { "type": "string", "const": "/api/v1/edi-validate" },
          "mode": { "type": "string", "enum": ["sample", "custom"] },
          "sample": { "type": "string" },
          "valid": { "type": "boolean" },
          "strict": { "type": "boolean" },
          "transaction_set": { "type": ["string", "null"] },
          "transaction_name": { "type": ["string", "null"] },
          "transaction_sets": {
            "type": "array",
            "items": { "type": "string" }
          },
          "segment_count": { "type": "integer" },
          "error_count": { "type": "integer" },
          "warning_count": { "type": "integer" },
          "envelope": {
            "type": "object",
            "properties": {
              "delimiters": { "type": "object" },
              "isa": { "type": ["object", "null"] },
              "gs": { "type": ["object", "null"] },
              "st": { "type": ["object", "null"] },
              "interchange_count": { "type": "integer" },
              "transaction_count": { "type": "integer" },
              "interchanges": { "type": "array", "items": { "type": "object" } }
            }
          },
          "transactions": {
            "type": "array",
            "items": { "type": "object" }
          },
          "errors": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/EdiIssue" }
          },
          "warnings": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/EdiIssue" }
          },
          "sample_edi": { "type": "string" },
          "available_samples": {
            "type": "array",
            "items": { "type": "string" }
          },
          "payload_bytes": { "type": "integer" },
          "supported_transaction_sets": {
            "type": "array",
            "items": { "type": "string" }
          },
          "publisher": { "$ref": "#/components/schemas/Publisher" }
        }
      },
      "LtlDensityResponse": {
        "type": "object",
        "required": [
          "ok",
          "endpoint",
          "inputs",
          "total_weight_lbs",
          "actual_cubic_ft",
          "effective_cubic_ft",
          "density_pcf",
          "estimated_linear_ft",
          "lfr_triggered",
          "standard_nmfc_class_18tier",
          "docket_2025_1_class_13tier",
          "docket_class_shift",
          "wi_overhang_2in_density_pcf",
          "wi_overhang_reclass_risk",
          "publisher"
        ],
        "properties": {
          "ok": { "type": "boolean", "const": true },
          "endpoint": { "type": "string", "const": "/api/v1/ltl-density" },
          "inputs": {
            "type": "object",
            "properties": {
              "l_in": { "type": "number" },
              "w_in": { "type": "number" },
              "h_in": { "type": "number" },
              "effective_h_in": { "type": "number" },
              "weight_per_unit_lbs": { "type": "number" },
              "tare_per_unit_lbs": { "type": "number" },
              "qty": { "type": "integer" },
              "stackable": { "type": "boolean" }
            }
          },
          "total_weight_lbs": { "type": "number" },
          "net_weight_lbs": { "type": "number" },
          "added_tare_lbs": { "type": "number" },
          "actual_cubic_ft": { "type": "number" },
          "effective_cubic_ft": { "type": "number" },
          "actual_density_pcf": { "type": "number" },
          "density_pcf": { "type": "number" },
          "floor_spots": { "type": "integer" },
          "estimated_linear_ft": { "type": "number" },
          "lfr_triggered": { "type": "boolean" },
          "cubic_capacity_rule_triggered": { "type": "boolean" },
          "standard_nmfc_class_18tier": { "type": "number" },
          "standard_nmfc_bracket": { "type": "string" },
          "docket_2025_1_class_13tier": { "type": "number" },
          "docket_2025_1_subprovision": { "type": "string" },
          "docket_class_shift": { "type": "number" },
          "docket_class_shift_direction": { "type": "string", "enum": ["increase", "decrease", "unchanged"] },
          "wi_overhang_2in_density_pcf": { "type": "number" },
          "wi_overhang_reclass_risk": {
            "type": "object",
            "required": ["at_risk", "triggered_18tier", "triggered_docket_2025_1", "overhang_inches_added", "reclassed_18tier", "reclassed_docket_2025_1_13tier", "summary"],
            "properties": {
              "at_risk": { "type": "boolean" },
              "triggered_18tier": { "type": "boolean" },
              "triggered_docket_2025_1": { "type": "boolean" },
              "overhang_inches_added": { "type": "integer" },
              "reclassed_18tier": { "type": "number" },
              "reclassed_docket_2025_1_13tier": { "type": "number" },
              "summary": { "type": "string" }
            }
          },
          "formulas": { "type": "object" },
          "publisher": { "$ref": "#/components/schemas/Publisher" }
        }
      }
    }
  }
}
