Foursquare, once criticized for not being able to figure out a business, may have finally struck gold deep in its data centers.

The location-based startup in New York already brings in a small amount of advertising revenue — about $2 million in 2012, which is doubling about every quarter, according to a source familiar with the company’s financials. However, there may exist a much more lucrative stream of revenue deep in the guts of the company’s servers: monetizing data about venues and locations that it has collected from millions of check-ins throughout its roughly four-year lifetime.

Indeed, Foursquare’s data has become more valuable following Google’s $1 billion acquisition of Waze, according to a source familiar with the deal. Similar to Foursquare, Waze has a large community of users that essentially builds a database of intersections and streets along with traffic data, while Foursquare focuses on locations like venues and restaurants. Waze also uses data available through Foursquare’s platform.

Foursquare has collected about 4 billion check-ins. Those check-ins, in addition to a massive network of apps — like Instagram and Uber — using Foursquare and sending data back to the company, have created one of the most robust databases of venues available on the web. Each venue carries with it an extensive profile, including points of information such as which times of day it’s popular, what impact the weather has on it, and the like. And pretty much every developer working on the Foursquare platform has access to that data.

“We’re getting a lot of data back that’s actually making our product better,” Holder Luedorf, head of business development at Foursquare, said. “We have a good amount of photos in our database attached to venues coming back from Instagram, for example.”

There are more than 50,000 developers tapping into Foursquare’s application programming interface (API), which gives them access to that data. The actual Foursquare application is running on the same API that other developers are tapping into, meaning whenever Foursquare creates a new feature, it is typically made available to developers. (Barring areas that Foursquare wants to “own,” that is — for example, Foursquare thinks it can do a better job serving up recommendations than third-party developers can, but has no interest in making a product that allows users to pay for something.)

And unlike Yelp, which relies on its users actually giving a star rating (out of five) in addition to a review, Foursquare is able to semantically infer the rating of a venue based on tips, frequency of check-ins, comments about the venue, and a myriad of other data points. All that data is available through its public-facing API. When scoping out venues, users will see a number value between 0 and 10, without any user actually giving the venue a numerical rating.

This is the output that comes from searching “coffee shops” near Union Square. It includes an enormous amount of information about the venues spit out in a format that basically any developer can use to very quickly determine important factors about a venue.

“We want to guide developers to use cases that are well-aligned with Foursquare’s interests,” Foursquare’s platform head Akshay Patil said. “Back in the Twitter days, people would build a client and turn those into start-ups. But after the whole Twitter client debacle, they’re like, Foursquare’s gonna want this — you aren’t gonna go to a VC and say, my business plan is to beat them at their own game.”

In addition to building a big profile of a venue, Foursquare is able to determine quite a bit about an individual’s habits and personalities by the places this person visits. For example, Foursquare is technically capable of knowing when you will need a haircut, based on your frequency of checking in at a barbershop, Patil said.

The platform serves two major purposes: driving awareness of Foursquare and, more importantly, driving more data back to the company to build better profiles of venues. Foursquare is already able to build profiles of individuals, and as a result, can serve up better recommendations.

“If someone pushes a photo from Instagram, that’s a good indicator that it’s a check-in we might not have picked up on,” Patil said.

Marry that with a robust user profile, and Foursquare is in a position to deliver some pretty sophisticated recommendations. Right now, the company focuses on serving up advertisements following a check-in as well as some other early ad products — such as a “time machine” applet it sold as part of an advertising deal. But there’s nothing really stopping it from taking the Google route and selling prime placement in search results for a coffee shop nearby.

“Search is ultimately one of the most monetized products on the web and in mobile,” Platform Business Development Head Mike Harkey said. “We’re really bullish on our search product long-term being a monetization vehicle. In the early days we’re focusing on making the Explore API available, but long-term it represents a significant monetization strategy.”

Foursquare is certainly ramping up its advertising business — this team is now larger than the business development team and is a core focus for the company. But as it essentially creates a sophisticated map and venue database that even rivals that of Google, it’s natural that the top companies would come calling for that data.

“We can obviously not comment on deals that aren’t done, but what I would say is there is a lot of very well-known companies that have expressed extreme interest in our data,” Luedorf said. “If the Instagrams and Wazes are of any interest, to them location is even more core — we’ve proven that our data is extremely valuable. We’ve not had a single partner that’s moved off our platform.”

When asked specifically on partnership deals, spokespeople from Yahoo and Foursquare said they did not comment on rumors.