Today Sam Liang, former lead architect for Google’s locations platform, is launching an API to give mobile app developers a way to more precisely track a users location. The release is the next step towards creating next-generation search — ambient search.

Last year Liang’s company, Alohar Mobile, owned by Alibaba, launched an app called Place Us that tracks the location of friends and family in real time. The app’s location tracking runs in the background and goes beyond basic ISP and GPS data by taking into account user location, motion, Wi-Fi data, environment temperature, brightness, and air pressure to calculate exact location.

“We built that in order to eat our own dog food; to understand how the technology works and how well it can help other people,” says Liang. Now the plan is to bring the location tracking API behind Place Us to all apps.

The API isn’t just about location, it’s also about gathering contextual data about consumers. As Liang learned through Place Us, people follow a specific path everyday. Perhaps your path includes going to the gym, going to work, and hitting the grocery store before going home for the day; or maybe that’s only what it looks like on Tuesdays and Thursdays. Maybe your routine includes less frequent events, like a monthly book club. Apps can use this data accrued over time to know everything about you.

This behavior mapping helps Alohar’s API narrow down specific locations. If you’re at a shopping mall where there is both a Starbucks and a Costco, Alohar may be able to tell which store you’re in based on the fact that you regularly get coffee around 3 p.m. That assumption can be verified by the movement of your phone. If Alohar’s API sees that you’re standing still inside a store, chances are you’re in line waiting for coffee at Starbucks, not looking for spareribs at Costco. Additional data helps refine results further, and the more time you spend with Alohar’s technology running in the background on your phone, the more it learns about you and can better predict what you’re doing.

While mobile surveillance may feel too Orwellian for some, this level of tracking can benefit consumers. For one, your routine can act as an identity authentication tool. For instance, if someone steals your phone and deviates from your usual schedule, your phone might lock up or require a more intense form of authentication to unlock it. Apps that have data about your routine may also predictively serve you offers, deals, or a suggestion for something you might want based on your past behavior based on where you are, the time of day, and the weather.

For developers, this kind of technology is key to a building more personalized user experience, efficiently.

“It helps when someone like Alohar does the heavy lifting for getting data from the sensors that mobile devices offer,” says Aaron Rudenstine, cofounder of Citymaps, a map app for discovering what’s around you. Citymaps is using Alohar’s API to make its app better at suggesting potential venues, events, and nearby deals.

Alohar’s API taps into a very hot user experience trend: personalization. There is currently a race to deliver the most personalized user experience. Many companies are trying to figure our how to surface the right information at the right time, essentially automating every aspect of your life. Liang says this is the next iteration of search. Instead of searching for information via a text box on Google, apps will be able to anticipate your search before you even open your browser.

Two notable efforts to serve relevant content at the right time are being headed up by Google and Yahoo. Google’s project Now serves users information based on search queries and information from email exchanges. Yahoo’s approach is similar, using email as the main source of data to determine user needs.

For the moment, the most popularly cited use for this tool is coordinating an upcoming flight. Since airlines now send tickets to your inbox, Yahoo and Google can pull that information up, suggest that you call a cab ahead of your flight, and let you know what terminal your flight is coming into. Google also just launched Google Now on Tap, which lets Android M users instantly search for something no matter where they are in the phone.

Liang says this is a very different approach from what his company is doing. Alohar’s API doesn’t read your email and instead relies more heavily on utilizing the many sensors on mobile phones to gather data.

“Google’s search box is a manual process. Our dream is that — because your phone follows you all the time — can your phone anticipate when you will be hungry and look for restaurants for you automatically? We’re not there yet, but our dream is to provide this automatic search in the background,” says Liang.

As we move towards an increasingly connected world, Liang’s vision doesn’t seem far off. To get there, developers are going to need to collect even more data on consumers than they already do, not just from Alohar’s API, but from a variety of sources.

The new API is available for both Android and iOS starting today.