You can look up FMCSA carrier data in Python by calling the official QCMobile API with a DOT number and a free web key, then reading fields such as legal name, operating status and safety rating from the JSON response. It is more stable than scraping the SAFER website and is the better first choice when you only need public carrier records.
What data does the FMCSA make public?
The FMCSA publishes carrier registration and safety information, including legal name, DOT and MC numbers, operating status, address, power units and drivers. You request a free web key from the FMCSA developer portal. Check the current field list in the official documentation, because names can change.
How do you call the API?
import os import requests
BASE = "https://mobile.fmcsa.dot.gov/qc/services/carriers" KEY = os . environ [ "FMCSA_WEBKEY" ]
def get_carrier ( dot_number : int ) -> dict | None : r = requests . get ( f "{BASE}/{dot_number}" , params = { "webKey" : KEY } , timeout = 20 ) if r .…