Authentication
The QCMobile API uses awebKey query parameter for authentication. Keys are issued at no cost through the FMCSA portal at mobile.fmcsa.dot.gov.
FMCSA_WEB_KEY and injected into every request by the API worker. It is never logged or exposed in error messages.
Caution: The FMCSA QCMobile API has no SLA and is rate-limited. Do not use it for synchronous user-facing requests. All production calls go through the daily cron pipeline, which spaces requests at 200ms intervals.
Endpoints Used
GET /carriers/:dot — Carrier Authority & Insurance
Retrieves the carrier’s operating authority, insurance on file, and contact information.
| FMCSA Field | Internal Mapping | Description |
|---|---|---|
dotNumber | dotNumber | USDOT number |
legalName | legalName | Legal entity name |
dbaName | dbaName | DBA name, if any |
carrierOperation | operationType | A (interstate), B (intrastate hazmat), C (intrastate non-hazmat) |
authorityStatus | authorityStatus | A (active), I (inactive), N (not authorized) |
bipdInsuranceOnFile | insuranceOnFile | Y / N — BI/PD insurance currently on file |
bipdInsuranceRequired | insuranceRequired | Required insurance amount (dollars) |
phyCity, phyState | address.city/state | Physical location |
totalDrivers | totalDrivers | Number of drivers on file |
totalPowerUnits | totalPowerUnits | Number of power units on file |
GET /carriers/:dot/basics — CSA BASIC Scores
Retrieves the carrier’s Compliance, Safety, Accountability (CSA) BASIC percentile scores and investigation history.
| BASIC Name | Internal Key | Intervention Threshold |
|---|---|---|
| Unsafe Driving | UNSAFE_DRIVING | 65th percentile |
| Hours-of-Service | HOS_COMPLIANCE | 65th percentile |
| Driver Fitness | DRIVER_FITNESS | 80th percentile |
| Controlled Substances/Alcohol | CONTROLLED_SUBSTANCES | 80th percentile |
| Vehicle Maintenance | VEHICLE_MAINT | 80th percentile |
| Hazardous Materials | HAZMAT | 60th percentile |
| Crash Indicator | CRASH_INDICATOR | 65th percentile |
fetchBasics() function (in apps/api/src/lib/fmcsa.ts) maps the raw FMCSA basics array — which is keyed by numeric BASIC category codes — to the named keys above, and attaches whether each score has crossed the intervention threshold.
GET /carriers/:dot/oos — Out-of-Service Rates
Retrieves the carrier’s out-of-service rates for vehicles, drivers, and hazmat, compared to national averages.
fetchOosRates() function extracts and normalizes the three OOS rate categories:
Client Implementation
The FMCSA client lives inapps/api/src/lib/fmcsa.ts and exports three functions:
- Build the QCMobile URL with the DOT number and webKey.
- Fetch with a 10-second timeout.
- On HTTP 404, return
null(carrier not found in FMCSA — may be a new or deactivated carrier). - On HTTP 429 or 503, throw
FmcsaRateLimitError(see Retry Strategy below). - On any other non-2xx status, throw
FmcsaFetchErrorwith the status code and URL. - Parse and validate the response with Zod before returning.
Rate Limits and Retry Strategy
The QCMobile API does not publish a formal rate limit, but sustained traffic above approximately 5 requests per second triggers HTTP 429 responses. The cron pipeline enforces a 200ms delay between requests — meaning a portfolio of 150 carriers takes roughly 90 seconds to fully scan (150 carriers × 3 endpoints × 200ms). The retry strategy for transient errors:| Error | Action |
|---|---|
| HTTP 429 | Exponential backoff: 1s → 2s → 4s, then skip carrier and log warning |
| HTTP 503 | Same as 429 |
| Network timeout | Retry once immediately, then skip carrier |
| HTTP 404 | No retry — carrier not in FMCSA, mark as not_found |
| HTTP 400 | No retry — invalid DOT number, log error |
staleCarriers field in the /v1/fmcsa-history/stats response surfaces carriers with gaps in their snapshot history.
Note: The FMCSA QCMobile API returns data as of the previous business day. FMCSA updates their database nightly, so a Monday morning cron run reflects Friday’s data. This lag is expected and is noted in the carrier alert UI.