DATA: How Foursquare knew before almost anyone how bad things were for Chipotle.

Chipotle announced its first loss as a public company Tuesday. But two weeks earlier, an unlikely source —the social media app Foursquare — had beat Chipotle to the punch, predicting in a blog post that the burrito maker’s sales would drop nearly 30 percent. Chipotle made it official Tuesday afternoon — reporting a drop of 29.7 percent.

The remarkably accurate prediction from a company consumers know for restaurant tips and the ability to check in at locations highlights the emerging power of the gobs of data our smartphones collect and the opportunity for savvy companies to convert that information into piles of cash.

“In biology the microscope changed the world. In physics and astronomy, the telescope,” said University of Illinois at Urbana-Champaign professor Lav Varshney. “These data sets give a very detailed view of human behavior. It’s a really powerful instrument in all kinds of settings.”

Foursquare has spent seven years collecting data and has 85 million places in its database. It describes its data trove as the “biggest foot traffic panel in the world.” Clients that buy Foursquare’s data to glean insights include retailers, real estate developers, Wall Street traders and consumer package-goods companies.

They’re monetizing people’s egos.