C-Max Hybrid
Vehicle Data API

The vehicle data API provides a RESTful web service and a simulation of realtime OpenXC vehicle data streaming accompanied by a multi-view vehicle video stream.

Quickstart to data consumption

Option 1. Get historical vehicle data

Here's an example GET request of driving at night for a range of time with engine_speed, odometer and fuel_consumed_since_restart as csv:

http://vehicledatacloud-pl475c6m.dotcloud.com/?sourceID=5&startTime=1376012687.0299489&endTime=1376013305.805495&names=engine_speed,odometer,fuel_consumed_since_restart&format=delimited&apikey=[mykey]

will return thousands of rows of OpenXC data:

{"timestamp": 1375905861.236558, "name": "tire_pressure_rear_right_status", "value": "normal"}
{"timestamp": 1375905861.2366481, "name": "odometer", "value": 30607.294922000002}
{"timestamp": 1375905861.236727, "name": "steering_wheel_angle", "value": 100.55759399999999}
{"timestamp": 1375905861.2368, "name": "tire_pressure_front_left_status", "value": "normal"}
{"timestamp": 1375905861.241955, "name": "torque_at_transmission", "value": 0}
Full historical vehicle data docs.
Option 2. Stream a trace file with socket.io

Add the socket.io client to your page

     <script type="text/javascript" src="http://playbacktool-pl475c6m.dotcloud.com/socket.io/socket.io.js"></script>
        <script>
            var socket = io.connect("http://playbacktool-pl475c6m.dotcloud.com",{
                                    port: 80}
            );

            socket.on('connect', function(){
                socket.emit('init', '[apikey]'); //We'll provide your API key
            });
            
            socket.on('ready', function(dataSource){ 
            /* dataSource is the name of one of the five drives:
               bb_c-max_day_1_part_1
               bb_c-max_day_1_part_2
               bb_c-max_day_2_night
               bb_c-max_day_2_part_1
               bb_c-max_day_2_part_2
            */
            }

            socket.on('output', function(data){ 
                //This where the OpenXC data streams in as data.records. 
                // Here's an example usage with jquery
                var content = "";
                $.each(data.records, function(i, obj){
                    dataPoints[obj.name] = obj.value;         
                });
                
                lastDataTimestamp = data.records[0].timestamp;
                content = "<div>timestamp: <b>" + lastDataTimestamp + "</b>";
                
                for (var item in dataPoints) {
                    if(dataPoints.hasOwnProperty(item)){
                        content += "<div>" + item + ": <b>" + dataPoints[item] + "</b></div>";
                    }
                };
                
                $("div#label").html(content); //For our example we're adding the stream to div#label
            }

            socket.on('message', function(msg){ //general messages from the stream
                    console.log('Message: ', msg); 
            });

            socket.on('status', function(s){ // Messages of any change in the state of the connection
                    console.log('Status: ', s);
                    status = s;
            });


            /* 
               start the stream. This is the data epoch timestamp, 
               and has nothing to do with the seek time in the video. 
               If the timestamp is left out, it will just play from the current timestamp. 
               If a value is out of bounds or just formatted wrong (like not a number), 
               it will go to the beginning of the stream for that dataSource 
            */
            socket.emit('play', <optional epoch timestamp>) 
            
            socket.emit('pause'); //pause the data stream

            /* 
               NOTE: play, pause, and setDataSource are not required and can be set
               from the video playback tool 
            */

        </script>

You can also use the streaming tool to control a feed with the video playback tools.

How the OpenXC data was captured

A small hardware module was plugged in to a 2013 Ford C-Max Hybrid's OBD-II port and then out to a Macbook. OpenXC firmware and a Ford provided, vehicle specific binary was installed on the hardware module to create a vehicle interface. The vehicle interface translated messages coming from the C-Max's internal network in to the OpenXC format and captured as trace files on the Macbook. There is approximately 5 to 6 hours of vehicle data with various styles of driving in metro, urban, and rural environments.

The data looks like this:

{"timestamp": 1375905861.236558, "name": "tire_pressure_rear_right_status", "value": "normal"}
{"timestamp": 1375905861.2366481, "name": "odometer", "value": 30607.294922000001}
{"timestamp": 1375905861.236727, "name": "steering_wheel_angle", "value": 100.55759399999999}
{"timestamp": 1375905861.2368, "name": "tire_pressure_front_left_status", "value": "normal"}
{"timestamp": 1375905861.241955, "name": "torque_at_transmission", "value": 0}
{"timestamp": 1375905861.2634389, "name": "fuel_consumed_since_restart", "value": 0.77858099999999997}
{"timestamp": 1375905861.270546, "name": "steering_wheel_angle", "value": 100.55759399999999}
{"timestamp": 1375905861.2720621, "name": "odometer", "value": 30607.294922000001}
{"timestamp": 1375905861.3123419, "name": "accelerator_pedal_position", "value": 0}
{"timestamp": 1375905861.3124759, "name": "engine_speed", "value": 1160}