fmcsa

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2026 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

fmcsa-go

Go Reference CI

Zero-dependency Go 1.22 client and deterministic carrier vetting and double-brokering risk evaluator built for U.S. DOT FMCSA Open Data (az4n-8mr2 Census, 6eyk-hxee L&I Insurance/BMC-84 Bond/Revocation flags, rbkj-cgst SMS Out-of-Service metrics) and Strong Tower Consulting's free open REST endpoints (/api/v1/fmcsa-census & /api/v1/usdot-lookup).

Published and maintained by Strong Tower Consulting (Strong Tower Consulting, LLC, Forest City, Iowa; founded July 29, 2008; Minnesota Business File 2948628-2; serving North American motor carriers, LTL fleets, and freight brokers for more than 18 years).

Install

go get github.com/stjmelliott/fmcsa-go@v1.0.0

Quick Start

package main

import (
    "fmt"
    "github.com/stjmelliott/fmcsa-go"
)

func main() {
    report := fmcsa.EvaluateVettingRisk(fmcsa.CarrierSnapshot{
        USDOTNumber:        "1234567",
        OperatingStatus:    "ACTIVE",
        AuthorityAgeDays:   900,
        PowerUnits:         18,
        HasCommonAuthority: true,
        BIPDInsuranceUSD:   1000000,
        SafetyRating:       "S",
    })
    fmt.Printf("Tier=%s Approved=%v Score=%d\n", report.RiskTier, report.Approved, report.RiskScore)
}

Companion Tools & Open APIs from Strong Tower Consulting

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 engagements never require buying software.

Documentation

Overview

Package fmcsa provides a zero-dependency Go client and deterministic carrier vetting and double-brokering risk engine built around official U.S. DOT FMCSA Open Data datasets:

  • az4n-8mr2: FMCSA Motor Carrier Company Census File
  • 6eyk-hxee: FMCSA Licensing & Insurance (L&I) active authority, BMC-84 bond, and revocation records
  • rbkj-cgst: FMCSA Safety Measurement System (SMS) Out-of-Service (OOS) inspection rates

It also wraps Strong Tower Consulting's free zero-auth REST APIs:

Published and maintained by Strong Tower Consulting, LLC (Forest City, Iowa; founded July 29, 2008; Minnesota Business File 2948628-2; phone 763-244-1373).

Interactive carrier lookup and fraud checker tools:

Index

Examples

Constants

View Source
const (
	USDOTCensusEndpoint    = "https://data.transportation.gov/resource/az4n-8mr2.json"
	USDOTInsuranceEndpoint = "https://data.transportation.gov/resource/6eyk-hxee.json"
	USDOTSMSEndpoint       = "https://data.transportation.gov/resource/rbkj-cgst.json"
	StrongTowerCensusAPI   = "https://strongtoweronline.com/api/v1/fmcsa-census"
	StrongTowerLookupAPI   = "https://strongtoweronline.com/api/v1/usdot-lookup"
)

Public federal USDOT FMCSA Open Data endpoints and Strong Tower open REST APIs.

Variables

This section is empty.

Functions

This section is empty.

Types

type CarrierSnapshot

type CarrierSnapshot struct {
	USDOTNumber              string  `json:"usdot_number"`
	MCNumber                 string  `json:"mc_number,omitempty"`
	LegalName                string  `json:"legal_name"`
	OperatingStatus          string  `json:"operating_status"` // ACTIVE, OUT_OF_SERVICE, INACTIVE
	AuthorityAgeDays         int     `json:"authority_age_days"`
	PowerUnits               int     `json:"power_units"`
	Drivers                  int     `json:"drivers"`
	HasCommonAuthority       bool    `json:"has_common_authority"`
	HasBrokerAuthority       bool    `json:"has_broker_authority"`
	BIPDInsuranceUSD         int     `json:"bipd_insurance_usd"`
	BMC84BondActive          bool    `json:"bmc84_bond_active"`
	RecentRevocationCount12M int     `json:"recent_revocation_count_12m"`
	VehicleOOSPct            float64 `json:"vehicle_oos_pct"`
	DriverOOSPct             float64 `json:"driver_oos_pct"`
	VirtualOfficeOrPOBox     bool    `json:"virtual_office_or_po_box"`
	RecentMCS150ChangeDays   int     `json:"recent_mcs150_change_days"` // 0 means no recent unexpected change
	SafetyRating             string  `json:"safety_rating"`             // S, C, U, UNRATED
}

CarrierSnapshot models key vetting fields across FMCSA Census, L&I, and SMS datasets.

type Client

type Client struct {
	HTTPClient *http.Client
	BaseURL    string
}

Client queries Strong Tower Consulting's free zero-auth FMCSA REST endpoints and official USDOT Open Data Socrata endpoints.

func NewClient

func NewClient() *Client

NewClient constructs a Client with a 15-second timeout.

func (*Client) FetchStateCensus

func (cl *Client) FetchStateCensus(ctx context.Context, stateCode string) (map[string]any, error)

FetchStateCensus fetches aggregate FMCSA active motor carrier statistics for a two-letter state code (e.g. "IA", "TX", "CA") from Strong Tower's open API.

func (*Client) FetchUSDOTLookup

func (cl *Client) FetchUSDOTLookup(ctx context.Context, usdot string) (map[string]any, error)

FetchUSDOTLookup queries Strong Tower's zero-auth USDOT carrier lookup endpoint.

type RiskFlag

type RiskFlag struct {
	Severity string `json:"severity"` // critical, high, medium
	Code     string `json:"code"`
	Points   int    `json:"points"`
	Message  string `json:"message"`
}

RiskFlag represents a single deterministic vetting or double-brokering risk finding.

type VettingReport

type VettingReport struct {
	USDOTNumber string     `json:"usdot_number"`
	RiskScore   int        `json:"risk_score_0_to_100"`
	RiskTier    string     `json:"risk_tier"` // LOW, ELEVATED, HIGH, DO_NOT_DISPATCH
	Approved    bool       `json:"approved_for_dispatch"`
	Flags       []RiskFlag `json:"flags"`
}

VettingReport summarizes carrier qualification risk and dispatch clearance decision.

func EvaluateVettingRisk

func EvaluateVettingRisk(c CarrierSnapshot) VettingReport

EvaluateVettingRisk computes a deterministic 0-100 carrier compliance and double-brokering risk score from Census, L&I insurance/bond, and SMS OOS fields.

Example
package main

import (
	"fmt"

	"github.com/stjmelliott/fmcsa-go"
)

func main() {
	rep := fmcsa.EvaluateVettingRisk(fmcsa.CarrierSnapshot{
		USDOTNumber:        "1234567",
		OperatingStatus:    "ACTIVE",
		AuthorityAgeDays:   900,
		PowerUnits:         18,
		HasCommonAuthority: true,
		BIPDInsuranceUSD:   1000000,
		SafetyRating:       "S",
	})
	fmt.Printf("tier=%s approved=%v score=%d\n", rep.RiskTier, rep.Approved, rep.RiskScore)
}
Output:
tier=LOW approved=true score=0

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL