Live data from Hacker News

How We reduced our Google Maps API cost

blog.cityflo.com

131–140 of 172 posts

Re: How We reduced our Google Maps API cost

#132
How does this take traffic into account? It is clever and I enjoyed the read, but it is essentially doing some of the work GMaps is doing for you yourself, losing some accuracy in the process. That's probably a great trade-off in this case but not always.

Re: How We reduced our Google Maps API cost

#133
post #98

Earlier quoted context omitted.

It's violation of terms of service, and possibly a violation of contract, but it's clearly a civil matter, not a criminal one.

What contract? You don't sign a contract when you create a Google account (which is basically what you need to create an API key with access to the free tier)

Elaborating on above, not all contracts are signed. Not all contracts are even written - some are verbal or implied.

Re: How We reduced our Google Maps API cost

#135

Earlier quoted context omitted.

It's not clever, it's just much more simpler. Using linear interpolation for the time between 2 stops will have low accuracy because for the particular situation time might not be linear with position and distance. Also traffic incidents might happen. Going with a pool of free keys will be much more dependable, even if somehow more complicated to manage and easier to break.

It's probably against their ToS and Google could detect it and ban all of those accounts, or the servers' IPs. You can then keep fooling them by creating new accounts or changing IPs (assuming your usage doesn't have clear patterns they could look at). But such events would be clearly disruptive for the business. Works for a POC, but if your business has actual customers, it's a terrible solution.

Linear interpolation gets you 9X% of the way there for cheap, though. You can then come up with strategies for attacking the last 10% at somewhat higher cost instead of committing the entire stack to the high-cost strategy.

For example, if you ascertain that a bus is more than 2 minutes late, switch to polling that bus more often until it makes it to its next stop. And then switch back to linear interpolation once it gets to that stop. But you'll pay a little bit more for the added accuracy.

Morale of the story: if you want to get high-resolution real-time data, you (and your customers) have to pay for it, as that shit ain't easy.

Re: How We reduced our Google Maps API cost

#136
post #117

Earlier quoted context omitted.

Those phones all had Google Maps app open. That Google is harvesting device locations while you have a Google app open showing your GPS location should not be a surprise. What would be a surprise is if Google forced on your GPS to gather your location in other contexts.

It is not a surprise, it is already happening. You can turn it off, but AFAIK if you don't it collects this information even if the Google maps application is not open.

From my personal experience, I have an Iphone and it asks me about once a week about Google Maps using my location in the background and if that is okay. I always tell it no. I didn't know I could turn it off directly in the app, thank you for the information.

Re: How We reduced our Google Maps API cost

#137

I did the same years ago. We were providing realtime suburb data for a fleet of trains. Each train received a GPS coordinate once per minute, we took this and displayed the suburb. So 1440 updates per day per train. For the fleet it was going to be over $100 a day in API costs. We were going to not display suburb data because of cost. In the end I found a creative commons placename database (geonames.org). For placen…

Have you used PostGIS at all? It seems like a good choice for this kind of lookup.

https://postgis.net/

Re: How We reduced our Google Maps API cost

#138

How does this take traffic into account? It is clever and I enjoyed the read, but it is essentially doing some of the work GMaps is doing for you yourself, losing some accuracy in the process. That's probably a great trade-off in this case but not always.

As mentioned in the article, they still get estimates from the Directions API, which takes traffic into account. However, instead of getting the ETA for each bus they get it for the path, apply some clever interpolation and refresh the base data from the API once a while

Re: How We reduced our Google Maps API cost

#139

Well, that's more clever than a company I did due diligence for. Their strategy was to have a pool of API keys attached to new accounts that would take advantage of the Google Maps API free tier, and monitor its usage. As the free tier usage would run out, the system would roll over to a new API key automatically. Wrote that one up in big red marker in my report...

You have a moral right to misuse their services, because Googlo betrayed people and increased their prices by 1000% for Map API. Google is a fraud company and deserved this.

The whole chain of replies by this user in this thread sounds like the obnoxious vegan stereotype of the tech world.

How do you know someone is not using google products out of some moral grandstanding principle? Dont worry, they will let you know, even if it is just some thread that is only tangentially related to the topic (and their username will likely tell you as well).

Re: How We reduced our Google Maps API cost

#140
post #85

It is a proof of that Google API is overpriced. Google apparently sells something, that can be computed as well.

I wonder how Google prices this api? The actual cost must be difficult to determine because if the source data. Perhaps they have some margin formula for “buying” data from their internal sources. It seems to me that they are value pricing and since they are close to a monopoly on this service they are testing the price elasticity.

The data for traffic is usually needed in real time, not just dumping historical data in one call and sitting on it. With that in mind, the most obvious pricing policy seems to be to either charge per API call or to have subscription tiers where you have a cap on maximum number of API calls per hour or per day or whatever other time interval they choose.
Post reply on HN