{
  "openapi": "3.0.1",
  "info": {
    "title": "Truck Crash & Out-of-Service Inspection Leads (FMCSA Daily)",
    "description": "Trucking companies that just had a DOT-reportable crash or an out-of-service roadside inspection, from FMCSA's daily files. One row per carrier: phone, email, officers, fleet size, crash counts, OOS rate and exact violations (brakes, HOS, tires, medical). No API key.",
    "version": "0.1",
    "x-build-id": "KUv9raw79s7GjrBAM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/intenal_builds~fmcsa-truck-crash-inspection-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-intenal_builds-fmcsa-truck-crash-inspection-leads",
        "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/intenal_builds~fmcsa-truck-crash-inspection-leads/runs": {
      "post": {
        "operationId": "runs-sync-intenal_builds-fmcsa-truck-crash-inspection-leads",
        "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/intenal_builds~fmcsa-truck-crash-inspection-leads/run-sync": {
      "post": {
        "operationId": "run-sync-intenal_builds-fmcsa-truck-crash-inspection-leads",
        "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": {
          "eventTypes": {
            "title": "Trigger events",
            "type": "array",
            "description": "Which safety events qualify a carrier. crash = DOT-reportable crash; oos_inspection = roadside inspection with an out-of-service order; violation_inspection = any inspection with at least one violation (includes OOS).",
            "items": {
              "type": "string",
              "enum": [
                "crash",
                "oos_inspection",
                "violation_inspection"
              ],
              "enumTitles": [
                "Crash (DOT-reportable)",
                "Out-of-service inspection",
                "Any inspection with violations"
              ]
            },
            "default": [
              "crash",
              "oos_inspection"
            ]
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Look at events from the last N days (ending today or at End date). Inspections post within about 3 days; crash reports can take 1 to 3 weeks to reach FMCSA, so use 30+ for crash-only runs.",
            "default": 14
          },
          "startDate": {
            "title": "Start date (optional)",
            "type": "string",
            "description": "YYYY-MM-DD. Overrides Days back."
          },
          "endDate": {
            "title": "End date (optional)",
            "type": "string",
            "description": "YYYY-MM-DD. Defaults to today."
          },
          "eventStates": {
            "title": "Event states",
            "type": "array",
            "description": "Two-letter codes of the state where the crash or inspection happened, e.g. TX, CA. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "carrierStates": {
            "title": "Carrier home states",
            "type": "array",
            "description": "Two-letter codes of the carrier's physical address (from the FMCSA census). Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "crashSeverity": {
            "title": "Crash severity",
            "enum": [
              "any",
              "tow_away_injury_or_fatal",
              "injury_or_fatal",
              "fatal"
            ],
            "type": "string",
            "description": "Minimum severity for a crash to count as a trigger.",
            "default": "any"
          },
          "oosCategories": {
            "title": "Out-of-service categories",
            "type": "array",
            "description": "Only count inspections with an out-of-service order in these categories (driver = HOS, medical card, licensing; vehicle = brakes, tires, lights; hazmat). Empty = any.",
            "items": {
              "type": "string",
              "enum": [
                "driver",
                "vehicle",
                "hazmat"
              ],
              "enumTitles": [
                "Driver OOS",
                "Vehicle OOS",
                "Hazmat OOS"
              ]
            }
          },
          "violationKeywords": {
            "title": "Violation keywords",
            "type": "array",
            "description": "Keep only carriers with at least one violation whose code or description contains any of these, e.g. brake, HOS, tire, medical, 395.8, ELD. Crash-only carriers are dropped when this is set.",
            "items": {
              "type": "string"
            }
          },
          "dotNumbers": {
            "title": "USDOT numbers (watch list)",
            "type": "array",
            "description": "Only these carriers. Useful for brokers and insurers monitoring a book of carriers. Empty = all carriers.",
            "items": {
              "type": "string"
            }
          },
          "minEvents": {
            "title": "Min qualifying events",
            "minimum": 1,
            "type": "integer",
            "description": "Carrier must have at least this many qualifying crashes plus inspections in the window (repeat offenders).",
            "default": 1
          },
          "minPowerUnits": {
            "title": "Min power units",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum fleet size (power units on the carrier's MCS-150)."
          },
          "maxPowerUnits": {
            "title": "Max power units",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum fleet size, e.g. 50 to skip mega-carriers."
          },
          "requireContact": {
            "title": "Only with phone or email",
            "type": "boolean",
            "description": "Skip carriers with no phone, cell phone or email on file.",
            "default": false
          },
          "includeViolations": {
            "title": "Include violation details",
            "type": "boolean",
            "description": "Add violation codes, descriptions, categories and OOS counts from the carrier's recent inspections.",
            "default": true
          },
          "includeEventDetails": {
            "title": "Include event lists",
            "type": "boolean",
            "description": "Add per-crash and per-inspection lists (date, state, city, severity, inspection level, OOS counts).",
            "default": true
          },
          "maxEventsPerCarrier": {
            "title": "Max events listed per carrier",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Cap on crashes/inspections listed (and inspections read for violations) per carrier. Counts always use every event in the window.",
            "default": 10
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after this many carriers (you pay per carrier).",
            "default": 100
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}