Google has paved the way for all sorts of interesting personal apps based on location, and today it launched a new application programming interface for Latitude, its service for letting people share their location.

The API is constructed so that people can explicitly decide to share where they currently are or a history of their whereabouts, so that third-party developers can build applications based on that data.

The search giant says this opens the door to all kinds of applications — from ones that turn your heater or air conditioner on or off as you’re heading home to ones that send traffic alerts. One other suggestion Google offered was an app that could alert users to fraudulent credit card use if purchases are made far away from where they are.

Other location-based apps like Foursquare and Gowalla have had APIs for some time, but what makes Latitude’s particularly powerful is that Google decided early on to persistently track location. It didn’t go the “check-in” route, where users temporarily share where they are at specific points in time. Because of that, the data Latitude has to offer is expansive.

Plus, the API shares the current location of the user, not the location of their most recent check-in, which could be from several hours or days before. Google touted the API’s privacy protections, saying that developers have to explain exactly what kind of data they need from users, and that consumers have to explicitly agree to share it.

“If done right, I think it could ultimately be as transformative as when Facebook opened up the social graph,” wrote Josh Kopelman, a First Round Capital managing director. “Previously, whenever an application or website wanted to know where you were, it had to ask you for permission to obtain your location from your phone. Each and every time. With Google Latitude’s new API they are changing the game. Rather than have dozens of applications that each ask for your location,¬†Google’s Latitude application will keep track of your location — and put it in the cloud.”