Requires Authentication via 'x-api-key' header.
Returns an array of recorded census entries for a given USDOT number
* The census is not mandatory and as such not all carriers may have records.
curl --request GET \
--url /v3/history/census/:USDotNumber \
--header 'x-api-key: YourApiKey'
Source on Github
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://saferwebapi.com/v3/history/census/:USDotNumber");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: YourApiKey");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
Source on Github
var client = new RestClient("https://saferwebapi.com/v3/history/census/:USDotNumber");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "YourApiKey");
IRestResponse response = client.Execute(request);
Source on Github
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://saferwebapi.com/v3/history/census/:USDotNumber"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "YourApiKey")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Source on Github
HttpResponse response = Unirest.get("https://saferwebapi.com/v3/history/census/:USDotNumber")
.header("x-api-key", "YourApiKey")
.asString();
Source on Github
var axios = require("axios").default;
var options = {
method: 'GET',
url: 'https://saferwebapi.com/v3/history/census/:USDotNumber',
headers: {'x-api-key': 'YourApiKey'}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
Source on Github
#import
NSDictionary *headers = @{ @"x-api-key": @"YourApiKey" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://saferwebapi.com/v3/history/census/:USDotNumber"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
Source on Github
"https://saferwebapi.com/v3/history/census/:USDotNumber",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: YourApiKey"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Source on Github
import requests
url = "https://saferwebapi.com/v3/history/census/:USDotNumber"
headers = {"x-api-key": "YourApiKey"}
response = requests.request("GET", url, headers=headers)
print(response.text)
Source on Github
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://saferwebapi.com/v3/history/census/:USDotNumber")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["x-api-key"] = 'YourApiKey'
response = http.request(request)
puts response.read_body
Source on Github
import Foundation
let headers = ["x-api-key": "YourApiKey"]
let request = NSMutableURLRequest(url: NSURL(string: "https://saferwebapi.com/v3/history/census/:USDotNumber")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Source on Github
/v3/history/census/:USDotNumber
{
"census_records": [
{
"batch_date": "August, 2021",
"legal_name": "FEDERAL MOTOR CARRIER SAFETY ADMINISTRATION",
"dba_name": "FMCSA TECHNOLOGY DIVISION",
"hazmat_flag": false,
"passenger_carrier_flag": false,
"physical_address": {
"street": "1200 NEW JERSEY AVENUE SE",
"city": "WASHINGTON",
"state": "DC",
"zip": "20590",
"country": "US"
},
"mailing_address": {
"street": "1200 NEW JERSEY AVENUE SE",
"city": "WASHINGTON",
"state": "DC",
"zip": "20590",
"country": "US"
},
"contact_phone": "(202) 385-2363",
"contact_fax": null,
"contact_email": "MCKINNEYCR@SAIC.COM",
"mcs150": {
"date": "2021-04-21",
"mileage": "3000",
"year": "2020"
},
"record_creation_date": "1974-06-01",
"oic_date": "Invalid date",
"total_power_units": "4",
"total_drivers": "3"
},
{
"batch_date": "July, 2021",
"legal_name": "FEDERAL MOTOR CARRIER SAFETY ADMINISTRATION",
"dba_name": "FMCSA TECHNOLOGY DIVISION",
"hazmat_flag": false,
"passenger_carrier_flag": false,
"physical_address": {
"street": "1200 NEW JERSEY AVENUE SE",
"city": "WASHINGTON",
"state": "DC",
"zip": "20590",
"country": "US"
},
"mailing_address": {
"street": "1200 NEW JERSEY AVENUE SE",
"city": "WASHINGTON",
"state": "DC",
"zip": "20590",
"country": "US"
},
"contact_phone": "(202) 385-2363",
"contact_fax": null,
"contact_email": "MCKINNEYCR@SAIC.COM",
"mcs150": {
"date": "2021-04-21",
"mileage": "3000",
"year": "2020"
},
"record_creation_date": "1974-06-01",
"oic_date": "Invalid date",
"total_power_units": "4",
"total_drivers": "3"
},
{
"batch_date": "June, 2021",
"legal_name": "FEDERAL MOTOR CARRIER SAFETY ADMINISTRATION",
"dba_name": "FMCSA TECHNOLOGY DIVISION",
"hazmat_flag": false,
"passenger_carrier_flag": false,
"physical_address": {
"street": "1200 NEW JERSEY AVENUE SE",
"city": "WASHINGTON",
"state": "DC",
"zip": "20590",
"country": "US"
},
"mailing_address": {
"street": "1200 NEW JERSEY AVENUE SE",
"city": "WASHINGTON",
"state": "DC",
"zip": "20590",
"country": "US"
},
"contact_phone": "(202) 385-2363",
"contact_fax": null,
"contact_email": "MCKINNEYCR@SAIC.COM",
"mcs150": {
"date": "2021-04-21",
"mileage": "3000",
"year": "2020"
},
"record_creation_date": "1974-06-01",
"oic_date": "Invalid date",
"total_power_units": "4",
"total_drivers": "3"
},
{
"batch_date": "May, 2021",
"legal_name": "FEDERAL MOTOR CARRIER SAFETY ADMINISTRATION",
"dba_name": "FMCSA TECHNOLOGY DIVISION",
"hazmat_flag": false,
"passenger_carrier_flag": false,
"physical_address": {
"street": "1200 NEW JERSEY AVENUE SE",
"city": "WASHINGTON",
"state": "DC",
"zip": "20590",
"country": "US"
},
"mailing_address": {
"street": "1200 NEW JERSEY AVENUE SE",
"city": "WASHINGTON",
"state": "DC",
"zip": "20590",
"country": "US"
},
"contact_phone": "(202) 385-2363",
"contact_fax": null,
"contact_email": "MCKINNEYCR@SAIC.COM",
"mcs150": {
"date": "2021-04-21",
"mileage": "3000",
"year": "2020"
},
"record_creation_date": "1974-06-01",
"oic_date": "Invalid date",
"total_power_units": "4",
"total_drivers": "3"
},
{
"batch_date": "April, 2021",
"legal_name": "FEDERAL MOTOR CARRIER SAFETY ADMINISTRATION",
"dba_name": "FMCSA TECHNOLOGY DIVISION",
"hazmat_flag": false,
"passenger_carrier_flag": false,
"physical_address": {
"street": "1200 NEW JERSEY AVENUE SE",
"city": "WASHINGTON",
"state": "DC",
"zip": "20590",
"country": "US"
},
"mailing_address": {
"street": "1200 NEW JERSEY AVENUE SE",
"city": "WASHINGTON",
"state": "DC",
"zip": "20590",
"country": "US"
},
"contact_phone": "(202) 385-2363",
"contact_fax": null,
"contact_email": "MCKINNEYCR@SAIC.COM",
"mcs150": {
"date": "2021-04-21",
"mileage": "3000",
"year": "2020"
},
"record_creation_date": "1974-06-01",
"oic_date": "Invalid date",
"total_power_units": "4",
"total_drivers": "3"
},
{
"batch_date": "March, 2021",
"legal_name": "FEDERAL MOTOR CARRIER SAFETY ADMINISTRATION",
"dba_name": "FMCSA TECHNOLOGY DIVISION",
"hazmat_flag": false,
"passenger_carrier_flag": false,
"physical_address": {
"street": "1200 NEW JERSEY AVENUE SE",
"city": "WASHINGTON",
"state": "DC",
"zip": "20590",
"country": "US"
},
"mailing_address": {
"street": "1200 NEW JERSEY AVENUE SE",
"city": "WASHINGTON",
"state": "DC",
"zip": "20590",
"country": "US"
},
"contact_phone": "(202) 385-2363",
"contact_fax": null,
"contact_email": "MCKINNEYCR@SAIC.COM",
"mcs150": {
"date": "2019-12-16",
"mileage": "3000",
"year": "2019"
},
"record_creation_date": "1974-06-01",
"oic_date": "Invalid date",
"total_power_units": "4",
"total_drivers": "4"
},
{
"batch_date": "February, 2021",
"legal_name": "FEDERAL MOTOR CARRIER SAFETY ADMINISTRATION",
"dba_name": "FMCSA TECHNOLOGY DIVISION",
"hazmat_flag": false,
"passenger_carrier_flag": false,
"physical_address": {
"street": "1200 NEW JERSEY AVENUE SE",
"city": "WASHINGTON",
"state": "DC",
"zip": "20590",
"country": "US"
},
"mailing_address": {
"street": "1200 NEW JERSEY AVENUE SE",
"city": "WASHINGTON",
"state": "DC",
"zip": "20590",
"country": "US"
},
"contact_phone": "(202) 385-2363",
"contact_fax": null,
"contact_email": "MCKINNEYCR@SAIC.COM",
"mcs150": {
"date": "2019-12-16",
"mileage": "3000",
"year": "2019"
},
"record_creation_date": "1974-06-01",
"oic_date": "Invalid date",
"total_power_units": "4",
"total_drivers": "4"
},
{
"batch_date": "January, 2021",
"legal_name": "FEDERAL MOTOR CARRIER SAFETY ADMINISTRATION",
"dba_name": "FMCSA TECHNOLOGY DIVISION",
"hazmat_flag": false,
"passenger_carrier_flag": false,
"physical_address": {
"street": "1200 NEW JERSEY AVENUE SE",
"city": "WASHINGTON",
"state": "DC",
"zip": "20590",
"country": "US"
},
"mailing_address": {
"street": "1200 NEW JERSEY AVENUE SE",
"city": "WASHINGTON",
"state": "DC",
"zip": "20590",
"country": "US"
},
"contact_phone": "(202) 385-2363",
"contact_fax": null,
"contact_email": "MCKINNEYCR@SAIC.COM",
"mcs150": {
"date": "2019-12-16",
"mileage": "3000",
"year": "2019"
},
"record_creation_date": "1974-06-01",
"oic_date": "Invalid date",
"total_power_units": "4",
"total_drivers": "4"
}
]
}