I’m a big fan of Automatic. It’s a very cool widget that plugs into your car’s data port and will monitor your driving habits. It tracks your average MPG, alerts you if you accelerate too fast or brake too hard, and rolls all of its data into a simple weekly score – high your score the better you’re driving! It’s a super simple way to reinforce safe driving habits, and improve your fuel efficiency at the same time, very cool!
However, since the product is still so young, there’s no official REST API yet to access all of your own data. I tinker with QS and always want to have access to my data for all of the services I use. I’d love to be able to get my data out of the Automatic service, but since they don’t have an official API, I decided to figure out how the iOS app fetches data and see if I can piggy back on that to download and process my own data.
The result is the Unofficial Automatic PHP API:
// login to Automatic API
$automatic = new Automatic($username, $password);
// fetch trip data between the two input dates
$trips = $automatic->getTrips($start, $end);
The API so far lets you login and get your account and link information, get trip data, and get your weekly scores, information about your car, and even it’s parked location.
One thing to note, the username and password to use when logging into the API are not the same as what you use to login to the app. I’ve documented on the wiki how to find your API username and password.