Twitter on Monday announced that it has partnered with Foursquare, a startup focused on local business recommendations, to allow users to include their location in Tweets. Rather than a simple geographic location—e.g. “New York”—Foursquare’s data, which gathers information on venues from billions of user-generated check-ins, is more specific and contextual, e.g. “Time-Life Building.”

Beyond the product implications for Twitter, this deal highlights an aspect of Foursquare that the company is eager to tout: Namely, that Foursquare is sitting on a mountain of data that is valuable enough for a social media giant like Twitter TWTR to pay for it.

“The Foursquare platform is a pretty fast-growing SaaS business compared to the other new SaaS businesses we’re invested in,” says Ben Horowitz, a partner at Andreessen Horowitz and board member of Foursquare, using the acronym for software as a service. “To build [Foursquare’s data business] from nothing would be exceptionally difficult.”

Questions have swirled for years about the fate of Foursquare, a beloved New York startup that many believe fell victim to the hype cycle. With $121.4 million in venture backing (and $41 million in debt) but waning popularity with users, the company has spent the last chapter of its life fighting the impression that it is struggling. Last fall, the company made its biggest bet yet: It split its namesake app into two. Swarm, a new app, is for checking in and sharing your location with friends. The existing Foursquare app is now solely for recommending restaurants and other venues based on your preferences and location.

Foursquare is now working to tell the story of the data it has gleaned from seven billion check-ins at 65 million places. (It also has 70 million user-generated tips and 90 million “tastes.”) More than 85,000 developers have built products using Foursquare’s data. As of last year, most of those developers do not pay to access the data, but income from those that do pay is poised to make up a third of Foursquare’s revenue this year. The majority of the company’s revenue comes from advertising products. Dennis Crowley, Foursquare’s chief executive, said the company has “more than doubled” its revenue each year for the last three years.

The social media data business is a tricky one; many hopeful startups have excitedly gathered data from Tweets and status updates and Likes but struggled to figure out a compelling business use for it. Foursquare is different, Horowitz tells Fortune, because its data contains context and insights around a user’s preferences. “You can’t collect a bunch of data and sell it to people and have that be a business,” he says. “What you can do that can be valuable as a business is collect a lot of data and through some kind of very smart thinking and software, gain valuable insights out of the data.”

Foursquare’s data partners include prominent social networks such as Google’s Waze, Yahoo’s Flickr, Twitter’s Vine, and Pinterest, and mobile systems like Cortana, Microsoft’s answer to Siri. Waze is particularly notable because the company is owned by Google GOOG , which collects its own location data through Google Maps. Waze chose Foursquare because of its ability to provide strong recommendations. Still, Foursquare has competition. Last year, Instagram switched from using Foursquare’s location data to using Facebook’s equivalent.

Despite challenges, Crowley has remained focused on his vision of personalized local search and recommendations. That’s what makes the Foursquare story so compelling. Crowley has done things that might look crazy—turning down sizable acquisition offers and putting off life milestones (as articulated by a feature story in Fast Company)—to build his vision. He’s even built the same company twice. (The first iteration, Dodgeball, sold to Google and was eventually shut down.)

Horowitz believes Foursquare can be a startup unicorn, the term for a private company valued at more than $1 billion. “They’re not a billion-dollar company yet. But I think they’ve got a lot of ways to get there,” he tells Fortune. (For a look at today’s unicorns, see Fortune‘s Unicorn List.)

Crowley views success as getting his product into the hands of hundreds of millions of users, he says, admitting that that’s a huge challenge. The company has 55 million registered users. It won’t disclose how many of those are active, except to say that last year’s app split send one third of active users to Swarm and one third to Foursquare, with one third using both. Crowley notes that Foursquare can be a success without that many users. “Local search monetizes so well, we can be a successful company with a fraction of the users that Twitter and Facebook has,” he says.

His vision includes Foursquare-powered recommendations and location data in many different use cases. “The future of mobile experiences is this proactive element—teaching people stuff about the world without them having to ask,” Crowley says. “I think we’re ahead of that trend and we’re going to end to powering it for a lot of these players.”

This story has been updated to note that most of the 85,000 developers accessing Foursquare’s data do not pay for the service.