Notice!

We have created V2 of the vehicles API which is now live.

On 1 February 2022 V1 (the API as it is today) will be disabled.

With V2, you will now need to have an active user account on this system as well as an API key which will be used for authentication for each API query.

Please take the necessary steps now to ensure that your system can still access the API:

1) Go to https://stolenvehicles.co.za/users/register and create a user account. You will receive an email with an activation link.

2) Activate your user account by clicking on the link in the email.

3) Now that your user account is active, go to https://stolenvehicles.co.za/users/my_profile and select "Yes" next to option "API Access Required".

4) The page will reload after 2 seconds and you will then see your API key.

Go to https://stolenvehicles.co.za/home/api_v2 to view the documentation on how to use V2 of the API with authentication.

API

We now offer an API for you to use in other applications to check whether a vehicle was stolen or not.

The API will the check the main database of entries added directly into this website, as well as the BOLO section, where we obtain information from social media.

No authentication required.

You just need to call the URL as shown in the examples below with the search term appended at the end. A minimum of 4 characters are required.

The search term must either be the: VIN Number OR Registration/License Plate Number OR Engine Number.

Please note that currently this API is free to use but this could change in the near future based on our discretion.

Base URL

https://stolenvehicles.co.za/api/vehicles/

Example

GET https://stolenvehicles.co.za/api/vehicles/CA529663

API Response
                                        
{
    "result": "Stolen",
    "type": "Motorcycle",
    "stolen_date": "2018-03-14",
    "vin_number": "WB10404JXWZC43519",
    "reg_number": "CA529663",
    "engine_number": "112EB299870",
    "make": "BMW",
    "model": "R1100GS",
    "year": "1994",
    "color": "Red",
    "province": "Gauteng",
    "last_known_location": "Magaliesburg",
    "description": "Adventure bike with aluminum top box",
    "case_number": "CAS46\/3\/2018",
    "police_station": "Randburg",
    "datadot_id": "",
    "source_system": "https://stolenvehicles.co.za",
    "link": "https://stolenvehicles.co.za\/vehicles\/view\/86"
}
                                        
                    

Code Examples

                            
$ch = curl_init();

curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
));
curl_setopt($ch, CURLOPT_URL, "https://stolenvehicles.co.za/api/vehicles/CA529663");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$result = curl_exec($ch);
$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

if (curl_error($ch)) {
    echo 'Error:' . curl_error($ch) . ".\nHTTP Status: " . $http_status;
}

curl_close($ch);

if ($http_status == 200) {
    //A JSON object will be returned if the vehicle details were found.
    //We then decode it and get an array.
    $vehicle_data = json_decode($result, true);
    
    //Check the result value...
    $result = $vehicle_data['result'];
    
    if($result == "Stolen") {
        //We can now extract all the fields, or specific fields from the array.
        $vin_number = $vehicle_data['vin_number'];
        $stolen_date = $vehicle_data['stolen_date'];

        //Save the data to a database or echo it out to screen.
        echo "This vehicle with VIN:$vin_number was stolen on $stolen_date.";
    } else {
        echo "No data found.";
    }
} elseif ($http_status == 401) {
    echo "Unauthorized access. - " . $result;
} elseif ($http_status == 404) {
        echo "Resource not found. - " . $result;
}
                            
                    
                            
var reg_number = "CA529663";

$.ajax({
    type: 'GET',
    url: 'https://stolenvehicles.co.za/api/vehicles/' + reg_number,
    dataType: 'jsonp',
    success: function (data) {
        console.log(data);

        if (data.result == "Stolen") {
            alert("Vehicle with registration number " + reg_number + " was stolen on " + data.stolen_date + ".");
        } else {
            alert("No data found...");
        }
    }
});