{
  "openapi": "3.0.1",
  "info": {
    "title": "FMCSA New Carriers and Authority Status Changes Feed",
    "description": "Newly registered US trucking companies and operating authority status changes (granted, revoked, suspended, reinstated) from official FMCSA open data, with filters and an only-new-since-last-run mode for daily lead feeds.",
    "version": "0.1",
    "x-build-id": "VeVI5hgIsIL3adDUu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/longlever~fmcsa-carriers-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-longlever-fmcsa-carriers-feed",
        "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/longlever~fmcsa-carriers-feed/runs": {
      "post": {
        "operationId": "runs-sync-longlever-fmcsa-carriers-feed",
        "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/longlever~fmcsa-carriers-feed/run-sync": {
      "post": {
        "operationId": "run-sync-longlever-fmcsa-carriers-feed",
        "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": {
          "mode": {
            "title": "What to return",
            "enum": [
              "new_carriers",
              "status_changes",
              "both"
            ],
            "type": "string",
            "description": "New carriers: companies newly added to the FMCSA Company Census File. Status changes: operating authority events (granted, revoked, suspended, reinstated and more) from FMCSA's Motus authority history. Both: one run, both feeds.",
            "default": "new_carriers"
          },
          "onlyNewSinceLastRun": {
            "title": "Only new since last run",
            "type": "boolean",
            "description": "Return only carriers and events this Actor has not returned before for the same filters (schedule it daily). The first run returns the last \"Look back days\". Turn off for a one-off pull of the whole look-back window, newest first.",
            "default": true
          },
          "lookbackDays": {
            "title": "Look back days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "First run, or every run when \"Only new since last run\" is off: how many days back to read, by date added (new carriers) or status change date (events).",
            "default": 7
          },
          "addedSince": {
            "title": "Date added on or after",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Optional hard start date (YYYY-MM-DD). Nothing dated earlier is returned, whatever the look-back."
          },
          "states": {
            "title": "States (physical address)",
            "type": "array",
            "description": "Two-letter state codes, for example TX, CA, FL. Empty means all states.",
            "items": {
              "type": "string"
            }
          },
          "minPowerUnits": {
            "title": "Minimum power units (fleet size)",
            "minimum": 0,
            "type": "integer",
            "description": "Trucks, tractors, buses and other power units the carrier reported."
          },
          "maxPowerUnits": {
            "title": "Maximum power units (fleet size)",
            "minimum": 0,
            "type": "integer",
            "description": "For example 5 to target owner-operators and small fleets."
          },
          "operationTypes": {
            "title": "Operation type",
            "type": "array",
            "description": "Empty means any.",
            "items": {
              "type": "string",
              "enum": [
                "interstate",
                "intrastate_hazmat",
                "intrastate_non_hazmat"
              ],
              "enumTitles": [
                "Interstate",
                "Intrastate, hazardous materials",
                "Intrastate, non-hazardous"
              ]
            }
          },
          "authorityStatuses": {
            "title": "Operating authority (MC/MX/FF docket)",
            "type": "array",
            "description": "Active: holds an active MC, MX or FF docket. Inactive: has a docket, none active. None: no docket (private or intrastate carriers). Empty means any. New-carrier feed only.",
            "items": {
              "type": "string",
              "enum": [
                "active",
                "inactive",
                "none"
              ],
              "enumTitles": [
                "Active authority",
                "Inactive authority",
                "No authority docket"
              ]
            }
          },
          "carrierStatuses": {
            "title": "USDOT record status",
            "type": "array",
            "description": "Status of the USDOT record in the Census File. Empty means any.",
            "items": {
              "type": "string",
              "enum": [
                "active",
                "inactive",
                "pending"
              ],
              "enumTitles": [
                "Active",
                "Inactive",
                "Pending"
              ]
            }
          },
          "entityTypes": {
            "title": "Entity type",
            "type": "array",
            "description": "Keep entities registered as any of these. Empty means any.",
            "items": {
              "type": "string",
              "enum": [
                "carrier",
                "broker",
                "freight_forwarder",
                "shipper",
                "registrant",
                "intermodal_equipment_provider",
                "cargo_tank"
              ],
              "enumTitles": [
                "Carrier",
                "Broker",
                "Freight forwarder",
                "Shipper",
                "Registrant",
                "Intermodal equipment provider",
                "Cargo tank facility"
              ]
            }
          },
          "hazmatOnly": {
            "title": "Hazmat carriers only",
            "type": "boolean",
            "description": "Keep only entities flagged as hazardous materials carriers or shippers.",
            "default": false
          },
          "requireEmail": {
            "title": "Must have an email address",
            "type": "boolean",
            "description": "Drop records with no email on file.",
            "default": false
          },
          "requirePhone": {
            "title": "Must have a phone number",
            "type": "boolean",
            "description": "Drop records with no phone or cell phone on file.",
            "default": false
          },
          "eventTypes": {
            "title": "Event types",
            "type": "array",
            "description": "Status-change feed only. Empty means all.",
            "items": {
              "type": "string",
              "enum": [
                "applied",
                "published",
                "granted",
                "suspended",
                "revoked",
                "inactivated",
                "reinstated",
                "revocation_discontinued",
                "reinstatement_withdrawn",
                "dismissed",
                "withdrawn",
                "out_of_service",
                "other"
              ],
              "enumTitles": [
                "Applied (initial status)",
                "Published to FMCSA Register",
                "Granted",
                "Suspended (insurance or BOC-3 lapse)",
                "Revoked",
                "Inactivated",
                "Reinstated",
                "Revocation discontinued",
                "Reinstatement withdrawn",
                "Dismissed or rejected",
                "Withdrawn",
                "Out of service",
                "Other administrative changes"
              ]
            }
          },
          "authorityCategories": {
            "title": "Authority type",
            "type": "array",
            "description": "Status-change feed only. Empty means all.",
            "items": {
              "type": "string",
              "enum": [
                "carrier_property",
                "carrier_household_goods",
                "carrier_passengers",
                "broker",
                "freight_forwarder"
              ],
              "enumTitles": [
                "Motor carrier of property",
                "Motor carrier of household goods",
                "Motor carrier of passengers",
                "Broker",
                "Freight forwarder"
              ]
            }
          },
          "includeCarrierDetails": {
            "title": "Add carrier details to status changes",
            "type": "boolean",
            "description": "Look up each event's carrier in the Census File for name, address, phone, email and fleet size. Always on when a carrier filter is set.",
            "default": true
          },
          "maxItems": {
            "title": "Max rows per feed per run",
            "minimum": 0,
            "type": "integer",
            "description": "0 means no limit. Applies to each feed separately in Both mode. In only-new mode, rows held back by this limit come in the next run.",
            "default": 0
          },
          "stateKey": {
            "title": "State key (only-new mode)",
            "type": "string",
            "description": "Optional name for the saved progress. By default it is derived from your filters, so changing a filter starts a fresh baseline."
          },
          "appToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Free token from data.transportation.gov that raises the API rate limit for large pulls. Not needed for daily runs."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}