{
  "openapi": "3.0.1",
  "info": {
    "title": "FMCSA Carrier Safety API — DOT Lookup, BASIC Scores, Insurance",
    "description": "Look up any motor carrier's DOT/MC safety profile — BASIC scores, authority, insurance, and OOS status — via FMCSA's official QCMobile API. No scraping.",
    "version": "0.1",
    "x-build-id": "lwooVgaVe1DnTPVsj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mooseandraven~fmcsa-carrier-safety-suite/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mooseandraven-fmcsa-carrier-safety-suite",
        "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/mooseandraven~fmcsa-carrier-safety-suite/runs": {
      "post": {
        "operationId": "runs-sync-mooseandraven-fmcsa-carrier-safety-suite",
        "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/mooseandraven~fmcsa-carrier-safety-suite/run-sync": {
      "post": {
        "operationId": "run-sync-mooseandraven-fmcsa-carrier-safety-suite",
        "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": {
          "fmcsaWebKey": {
            "title": "FMCSA QCMobile API webKey (only needed for carrier lookups)",
            "type": "string",
            "description": "Your own free FMCSA QCMobile API webKey (register a developer account via Login.gov at mobile.fmcsa.dot.gov). Only required if dotNumbers, carrierNames, or docketNumbers is set — the new-authority feed below is a separate, keyless public API and works with no key at all. This actor calls the official QCMobile REST API only — it does not scrape SAFER, the SMS website, or li-public.fmcsa.dot.gov. Your key's usage is yours alone; this actor never pools multiple customers behind one key."
          },
          "dotNumbers": {
            "title": "USDOT numbers to look up",
            "type": "array",
            "description": "USDOT numbers to vet, one lookup per number.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "carrierNames": {
            "title": "Carrier names to search",
            "type": "array",
            "description": "Legal/DBA names to search (fuzzy match, may return multiple carriers per name — capped at the API's first-50-results limit per name).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "docketNumbers": {
            "title": "MC docket numbers to look up",
            "type": "array",
            "description": "Motor carrier docket numbers to look up. Format confirmed live: plain numeric string (e.g. \"329366\"), NOT prefixed with \"MC-\" — a prefixed value is a different string to the API and will silently return zero results, not an error.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeBasics": {
            "title": "Include BASIC safety percentiles",
            "type": "boolean",
            "description": "Fetch the 5 publicly-reported BASIC percentile scores (Unsafe Driving, Hours-of-Service/Fatigued Driving, Driver Fitness, Controlled Substances/Alcohol, Vehicle Maintenance) for each carrier. Hazmat and Crash Indicator BASICs are not publicly disclosed by FMCSA and are not available via this API.",
            "default": true
          },
          "includeAuthority": {
            "title": "Include operating authority status",
            "type": "boolean",
            "description": "Fetch operating authority details for each carrier.",
            "default": true
          },
          "includeCargoCarried": {
            "title": "Include cargo authority details",
            "type": "boolean",
            "description": "Fetch the types of cargo each carrier is authorized to haul.",
            "default": false
          },
          "includeOperationClassification": {
            "title": "Include operation classification",
            "type": "boolean",
            "description": "Fetch each carrier's operation classification (e.g. interstate/intrastate, for-hire/private).",
            "default": false
          },
          "includeOos": {
            "title": "Include out-of-service orders",
            "type": "boolean",
            "description": "Fetch any out-of-service orders on file for each carrier — the authoritative OOS signal (the base carrier snapshot has no boolean out-of-service field; OOS status is order-based).",
            "default": true
          },
          "monitorMode": {
            "title": "Change-monitoring mode",
            "type": "boolean",
            "description": "When on, the actor compares this run's snapshot for each carrier against the last run's (via Apify key-value store) and emits an additional change-flag record for anything that shifted: allowed-to-operate status, out-of-service order count, safety rating, BIPD/bond/cargo insurance lapse state, or a BASIC percentile crossing a reporting threshold. Designed for scheduled runs monitoring a fixed carrier list. Charges one monitor-run PPE event in addition to per-carrier events.",
            "default": false
          },
          "maxRecordsPerRun": {
            "title": "Max carriers per run (safety guard)",
            "minimum": 0,
            "type": "integer",
            "description": "Safety cap on total carriers looked up in one run (shared with the new-authority feed, if enabled). Set to 0 for no cap.",
            "default": 500
          },
          "enableNewAuthorityFeed": {
            "title": "Enable new-authority feed",
            "type": "boolean",
            "description": "Fetch newly-registered motor carriers from FMCSA's official Company Census File (data.transportation.gov Socrata API — no key required, distinct from the QCMobile carrier-lookup API above). Does not require dotNumbers/carrierNames/docketNumbers to be set, or fmcsaWebKey. On by default so a run with no input configured still produces real, keyless results.",
            "default": true
          },
          "newAuthorityLookbackDays": {
            "title": "New-authority lookback window (days)",
            "minimum": 1,
            "type": "integer",
            "description": "How many days back to look for newly-registered carriers when monitorMode is off, or on the very first monitorMode run. Later monitorMode runs use the last run's checkpoint instead.",
            "default": 7
          },
          "newAuthorityStateFilter": {
            "title": "New-authority state filter",
            "type": "string",
            "description": "Optional 2-letter US state code to restrict the new-authority feed to carriers physically located in that state."
          },
          "censusAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional Socrata app token (free, from data.transportation.gov) for the new-authority feed, raising the anonymous-tier throttling ceiling if you hit it. Not required for normal use."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}