API Documentation
Complete reference for TheCarrierInfo API endpoints and usage
Authentication
All API endpoints require authentication using API keys generated from your dashboard.
Note: You must generate an API key from your dashboard to use the API.
How it works:
- Login to your dashboard
- Generate a new API key from the API Keys section
- Include the API key as a query parameter in your requests
- The API validates your key and tracks usage automatically
API Key Usage:
- Query Parameter:
?key=YOUR_API_KEY - Header:
X-API-Key: YOUR_API_KEY
cURL Example:
curl "https://api.thecarrierinfo.com/api/search/legal_name?q=HAMILTON&key=YOUR_API_KEY"
JavaScript Example:
fetch('https://api.thecarrierinfo.com/api/search/legal_name?q=HAMILTON&key=YOUR_API_KEY')
.then(res => res.json())
.then(data => console.log(data));Search API
Powerful search functionality across all column names with pagination and API usage statistics.
Endpoint:
GET /api/search/:column?q=query&key=YOUR_API_KEYParameters:
:column- Column name to search in (optional)q- Search query (required)page- Page number (default: 1)limit- Results per page (default: 20, max: 20)key- Your API key (required)
Valid Column Names:
Mc, usdot, legal_name, dba_name, phone, email, city, state, zip_codeResponse Format:
{
"success": true,
"data": [
{
"Mc": 3,
"legal_name": "HAMILTON REESE AND ASSOCIATES",
"dba_name": "HAMILTON REESE AND ASSOCIATES",
"phone": "(313) 712-9500",
"email": "[email protected]",
"city": "DETROIT",
"state": "MI",
...
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 3,
"total_pages": 1
},
"usage": {
"monthly_requests": 1,
"monthly_limit": 10000,
"remaining": 9999
}
}MC Endpoints
Direct access to MC (Motor Carrier) information from our comprehensive database.
Search by MC ID
Search for MC information using the database ID.
GET /mc/:id?key=YOUR_API_KEY/mc/12345?key=abc123def456Search by MC Number
Search using the actual MC number.
GET /mc/number/:mc?key=YOUR_API_KEY/mc/number/1234567?key=abc123Rate Limiting
To ensure fair usage, we implement rate limiting on all endpoints.
General API
10,000
requests per 15 minutes
Search Operations
1,000
requests per 15 minutes
Rate Limit Headers:
X-RateLimit-Limit: 10000 X-RateLimit-Remaining: 9950 X-RateLimit-Reset: 1640995200
Error Handling
All API responses follow a consistent error format.
Error Response Format:
{
"success": false,
"error": "Error message description"
}HTTP Status Codes:
| Status | Description | Common Causes |
|---|---|---|
200 | Success | Request completed successfully |
400 | Bad Request | Missing parameters or invalid format |
401 | Unauthorized | Invalid or missing API key |
404 | Not Found | Requested resource not found |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Server-side error |
USDOT Endpoints
Access USDOT (U.S. Department of Transportation) information for carriers.
Endpoint:
GET /api/usdot/:usdot?key=YOUR_API_KEYExample Request:
curl "https://api.thecarrierinfo.com/api/usdot/2952744?key=YOUR_API_KEY"
Company Endpoints
Comprehensive company information including history, inspections, accidents, and more.
Company Details
GET /api/company/:id?key=YOUR_API_KEYCompany History
GET /api/company/:id/history?key=YOUR_API_KEYInspections
GET /api/company/:id/inspections?key=YOUR_API_KEYAccidents
GET /api/company/:id/accidents?key=YOUR_API_KEYViolations
GET /api/company/:id/violations?key=YOUR_API_KEYFinancial
GET /api/company/:id/financial?key=YOUR_API_KEYHealth Check
Check the status and health of the API service.
GET /api/healthExample Response:
{
"success": true,
"status": "healthy",
"timestamp": "2024-01-20T10:30:00Z",
"version": "1.0.0"
}Need Help?
Contact our technical team for personalized assistance.