{
  "openapi": "3.0.1",
  "info": {
    "title": "FMCSA Carrier Safety - Inspections, Violations & Authority",
    "description": "US truck & bus carrier records (FMCSA open data, 4.5M carriers): registry details, inspection history, violations, SMS BASIC safety categories, operating authority, out-of-service orders and revocations - all keyed to the DOT number. Filter by DOT/MC, state or fleet size.",
    "version": "0.0",
    "x-build-id": "cnbyzcfKVkK6htKg6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~fmcsa-carrier-safety/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-fmcsa-carrier-safety",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/j0401~fmcsa-carrier-safety/runs": {
      "post": {
        "operationId": "runs-sync-j0401-fmcsa-carrier-safety",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/j0401~fmcsa-carrier-safety/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-fmcsa-carrier-safety",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "corpus": {
            "title": "Dataset",
            "enum": [
              "carrier",
              "inspections",
              "violations",
              "smsViolations",
              "authority",
              "oos",
              "revocations"
            ],
            "type": "string",
            "description": "carrier = the company census register (4.5M: name, address, fleet, operation, commodities, safety rating). inspections = roadside inspection history (8.3M). violations = the violations cited in each inspection (13.6M). smsViolations = the same violations with their SMS BASIC safety category and severity weights (6.9M). authority = operating authority + insurance (1.9M). oos = out-of-service orders (399k). revocations = authority revocations (1.5M).",
            "default": "carrier"
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "rows",
              "aggregate"
            ],
            "type": "string",
            "description": "rows = records matching your filters (default). aggregate = one count row per group (see groupBy).",
            "default": "rows"
          },
          "groupBy": {
            "title": "Group by",
            "enum": [
              "",
              "statusCode",
              "carrierOperation",
              "safetyRating",
              "state",
              "classification",
              "businessOrgDesc",
              "fleetSize",
              "hazmat",
              "reviewType",
              "country",
              "level",
              "interstate",
              "hazmatPlacardReq",
              "region",
              "partNo",
              "outOfService",
              "violCode",
              "basic",
              "section",
              "group",
              "commonStat",
              "contractStat",
              "brokerStat",
              "mxType",
              "status",
              "reason",
              "typeLicense",
              "orderType"
            ],
            "type": "string",
            "description": "Dimension to aggregate over (only used when mode=aggregate). Blank = the corpus's primary dimension. Must belong to the selected corpus: carrier -> statusCode / carrierOperation / safetyRating / state / classification / businessOrgDesc / fleetSize / hazmat / reviewType / country. inspections -> state / level / interstate / hazmatPlacardReq / region. violations -> partNo / outOfService / violCode. smsViolations -> basic / section / group / outOfService. authority -> commonStat / contractStat / brokerStat / mxType. oos -> status / reason. revocations -> typeLicense / orderType.",
            "default": ""
          },
          "dotNumber": {
            "title": "DOT number",
            "type": "string",
            "description": "USDOT number (the carrier's federal ID), e.g. '1215404'. This is the key that ties every dataset to the same carrier. NOT the same as the MC / docket number. Blank = any.",
            "default": ""
          },
          "mcNumber": {
            "title": "MC / docket number",
            "type": "string",
            "description": "The carrier's MC (or FF / MX) docket number, e.g. '1215404'. Matched against the census docket columns with or without the MC prefix. This is a DIFFERENT namespace from the DOT number - they can share digits and still be different carriers. Blank = any.",
            "default": ""
          },
          "name": {
            "title": "Company name",
            "type": "string",
            "description": "Legal or DBA name, substring match, e.g. 'SWIFT'. Blank = any.",
            "default": ""
          },
          "state": {
            "title": "State",
            "type": "string",
            "description": "Two-letter state. For carrier / authority this is the physical or business address state; for inspections it is the state that conducted the inspection. Blank = any.",
            "default": ""
          },
          "city": {
            "title": "City",
            "type": "string",
            "description": "Physical city, substring match (carrier dataset only). Blank = any.",
            "default": ""
          },
          "zip": {
            "title": "ZIP",
            "type": "string",
            "description": "Physical ZIP code, exact match (carrier dataset only). Blank = any.",
            "default": ""
          },
          "statusCode": {
            "title": "Operating scope",
            "enum": [
              "",
              "I",
              "A",
              "P"
            ],
            "type": "string",
            "description": "Carrier dataset: I = interstate, A = intrastate, P = pending. Blank = any.",
            "default": ""
          },
          "carrierOperation": {
            "title": "Carrier operation",
            "enum": [
              "",
              "A",
              "B",
              "C"
            ],
            "type": "string",
            "description": "Carrier dataset: A = a for-hire motor carrier (the main commercial class, 2.47M), B = a private carrier with both passenger and property operations, C = private carrier (1.84M). Blank = any.",
            "default": ""
          },
          "classification": {
            "title": "Business classification",
            "type": "string",
            "description": "Carrier dataset, substring match on the source's classification field: 'AUTHORIZED FOR HIRE', 'PRIVATE PROPERTY', 'PRIVATE PASSENGER, BUSINESS', 'EXEMPT FOR HIRE'. Values are semicolon-combined, so a substring match may match a combined value. Blank = any.",
            "default": ""
          },
          "cargo": {
            "title": "Commodity hauled",
            "enum": [
              "",
              "generalfreight",
              "householdgoods",
              "metalsheets",
              "motorvehicles",
              "drivetowaway",
              "logspoles",
              "buildingmaterials",
              "mobilehomes",
              "machinerylargeobjects",
              "produce",
              "liquidsgases",
              "intermodal",
              "passengers",
              "oilfield",
              "livestock",
              "grainfeedhay",
              "coalcoke",
              "meat",
              "garbage",
              "usmail",
              "chemicals",
              "drybulk",
              "refrigeratedfood",
              "beverages",
              "paperproducts",
              "utility",
              "farmsupplies",
              "construction",
              "waterwell",
              "other"
            ],
            "type": "string",
            "description": "Carrier dataset: filter to carriers that report hauling this commodity (the census carries 30 commodity flags). Blank = any.",
            "default": ""
          },
          "hazmatOnly": {
            "title": "Hazmat carriers only",
            "type": "boolean",
            "description": "Carrier dataset: only carriers that report carrying hazardous materials (284k of 4.5M).",
            "default": false
          },
          "safetyRating": {
            "title": "Safety rating",
            "enum": [
              "",
              "S",
              "C",
              "U"
            ],
            "type": "string",
            "description": "Carrier dataset: S = Satisfactory, C = Conditional, U = Unsatisfactory. Only about 5% of the register carries a rating (those FMCSA has rated). Blank = any.",
            "default": ""
          },
          "hasSafetyRating": {
            "title": "Rated carriers only",
            "type": "boolean",
            "description": "Carrier dataset: only carriers that have a recorded safety rating (~236k rows).",
            "default": false
          },
          "reviewed": {
            "title": "Reviewed carriers only",
            "type": "boolean",
            "description": "Carrier dataset: only carriers with an FMCSA review on record (review type / date).",
            "default": false
          },
          "hasEmail": {
            "title": "Has email only",
            "type": "boolean",
            "description": "Carrier dataset: only carriers with an email address on file (~2.97M).",
            "default": false
          },
          "minPowerUnits": {
            "title": "Minimum power units",
            "type": "integer",
            "description": "Carrier dataset: only carriers with at least this many power units (trucks/tractors) - the numeric fleet-size filter, e.g. 50 for mid-size fleets and up.",
            "default": 0
          },
          "minTruckUnits": {
            "title": "Minimum truck units",
            "type": "integer",
            "description": "Carrier dataset: only carriers with at least this many truck units.",
            "default": 0
          },
          "minBusUnits": {
            "title": "Minimum bus units",
            "type": "integer",
            "description": "Carrier dataset: only carriers with at least this many bus units.",
            "default": 0
          },
          "minDrivers": {
            "title": "Minimum drivers",
            "type": "integer",
            "description": "Carrier dataset: only carriers with at least this many drivers.",
            "default": 0
          },
          "level": {
            "title": "Inspection level",
            "enum": [
              "",
              "1",
              "2",
              "3",
              "4",
              "5",
              "6",
              "9"
            ],
            "type": "string",
            "description": "Inspections dataset: the inspection level. 1 = full (driver + vehicle, most thorough), 2 = walk-around, 3 = driver-only, 4 = special study, 5 = vehicle-only, 6 = radio, 9 = terminal. Blank = any.",
            "default": ""
          },
          "interstate": {
            "title": "Interstate inspections",
            "type": "boolean",
            "description": "Inspections dataset: true = interstate inspections only, false or unchecked = any.",
            "default": false
          },
          "oosOnly": {
            "title": "Out-of-service only",
            "type": "boolean",
            "description": "inspections / violations / smsViolations: only records with an out-of-service result (the serious findings that pull a driver or vehicle off the road).",
            "default": false
          },
          "hazmatOosOnly": {
            "title": "Hazmat out-of-service only",
            "type": "boolean",
            "description": "Inspections dataset: only inspections with a hazmat out-of-service finding.",
            "default": false
          },
          "reportNumber": {
            "title": "Report number",
            "type": "string",
            "description": "Inspections dataset: exact inspection report number. Blank = any.",
            "default": ""
          },
          "inspectionId": {
            "title": "Inspection ID",
            "type": "string",
            "description": "Violations dataset: exact internal inspection id, when you already have it. Blank = any.",
            "default": ""
          },
          "basic": {
            "title": "SMS BASIC category",
            "enum": [
              "",
              "Vehicle Maintenance",
              "Unsafe Driving",
              "Hours-of-Service Compliance",
              "Driver Fitness",
              "Hazardous Materials Compliance",
              "Controlled Substances/Alcohol"
            ],
            "type": "string",
            "description": "smsViolations dataset: the FMCSA safety-measurement category the violation counts toward. Vehicle Maintenance alone is 5.1M of the 6.9M. Blank = any.",
            "default": ""
          },
          "violCode": {
            "title": "Violation code",
            "type": "string",
            "description": "violations / smsViolations: the violation code or a prefix, e.g. '393.75' for tire violations or '392.4' for drug/alcohol. Blank = any.",
            "default": ""
          },
          "partNo": {
            "title": "Regulation part",
            "type": "string",
            "description": "Violations dataset: exact regulation part number - 393 = vehicle equipment, 392 = driving rules, 395 = hours of service, 391 = driver qualifications, 396 = inspection/repair, 390 = general. Blank = any.",
            "default": ""
          },
          "section": {
            "title": "SMS section",
            "type": "string",
            "description": "smsViolations dataset: section description substring, e.g. 'Driving', 'Vehicle'. Blank = any.",
            "default": ""
          },
          "docketNumber": {
            "title": "Docket number",
            "type": "string",
            "description": "authority / revocations: the operating authority docket number with or without its prefix, e.g. 'MC1215404' or '1215404'. Blank = any.",
            "default": ""
          },
          "authorityType": {
            "title": "Authority type",
            "enum": [
              "",
              "common",
              "contract",
              "broker"
            ],
            "type": "string",
            "description": "authority dataset: common = general for-hire authority, contract = contract carrier, broker = brokerage authority. Picking a type on its own returns carriers that ACTIVELY hold it (combine with authorityStatus to see inactive ones). Blank = any.",
            "default": ""
          },
          "authorityStatus": {
            "title": "Authority status",
            "enum": [
              "",
              "A",
              "I",
              "N"
            ],
            "type": "string",
            "description": "authority dataset (used with authorityType): A = active, I = inactive, N = none. Blank = any.",
            "default": ""
          },
          "activeOnly": {
            "title": "Active only",
            "type": "boolean",
            "description": "authority: only carriers with at least one active authority. oos: only out-of-service orders still in force (not rescinded).",
            "default": false
          },
          "hasBond": {
            "title": "Bond required",
            "type": "boolean",
            "description": "Authority dataset: only carriers whose authority carries a bond requirement,",
            "default": false
          },
          "hasCargo": {
            "title": "Cargo insurance required",
            "type": "boolean",
            "description": "Authority dataset: only carriers whose authority carries a cargo-insurance requirement.",
            "default": false
          },
          "reason": {
            "title": "Out-of-service reason",
            "type": "string",
            "description": "oos dataset: reason substring, e.g. 'Imminent Hazard', 'failure to pay', 'New Entrant'. Blank = any.",
            "default": ""
          },
          "status": {
            "title": "Out-of-service status",
            "enum": [
              "",
              "ACTIVE",
              "INACTIVE"
            ],
            "type": "string",
            "description": "oos dataset: ACTIVE = the order is still in force, INACTIVE = it has been lifted. Blank = any.",
            "default": ""
          },
          "typeLicense": {
            "title": "License type",
            "enum": [
              "",
              "COMMON",
              "CONTRACT",
              "BROKER"
            ],
            "type": "string",
            "description": "revocations dataset: which authority the revocation applies to. Blank = any.",
            "default": ""
          },
          "orderType": {
            "title": "Revocation type",
            "type": "string",
            "description": "revocations dataset: revocation type substring - 'VOLUNTARY', 'INVOLUNTARY', 'ADMINISTRATIVE'. Blank = any.",
            "default": ""
          },
          "year": {
            "title": "Year",
            "type": "string",
            "description": "Revocations dataset: the year the order was served, four digits (the source stores these dates as MM/DD/YYYY text, so a year is the exact date filter it supports). Blank = any.",
            "default": ""
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Start of the date window, YYYY-MM-DD (inclusive). Each dataset filters its own date field: inspections = the inspection date; oos = the order date; smsViolations = the inspection date; violations = the record change date (when the violation was last updated, which trails the inspection). Blank = no lower bound.",
            "default": ""
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "End of the date window, YYYY-MM-DD (exclusive). Blank = no upper bound.",
            "default": ""
          },
          "maxResults": {
            "title": "Max results",
            "type": "integer",
            "description": "How many records to deliver (or groups to return in aggregate mode). Default 50. Capped at 20000 per run; a broad query over a multi-million-row dataset is bounded here rather than paging the whole corpus.",
            "default": 50
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}