Live data from Hacker News

How We reduced our Google Maps API cost

blog.cityflo.com

11–20 of 172 posts

Re: How We reduced our Google Maps API cost

#11

This seems to be violating the Maps API terms of service? https://cloud.google.com/maps-platform/terms (a) No Scraping. Customer will not export, extract, or otherwise scrape Google Maps Content for use outside the Services. For example, Customer will not: (i) pre-fetch, index, store, reshare, or rehost Google Maps Content outside the services; (ii) bulk download Google Maps tiles, Street View images, geocodes, direc…

Caching is allowed (for up to 30 days). Here are the specific terms for the API in the article: https://cloud.google.com/maps-platform/terms/maps-service-te...

"Customer can temporarily cache latitude (lat) and longitude (lng) values from the Directions API for up to 30 consecutive calendar days, after which Customer must delete the cached latitude and longitude values."

Re: How We reduced our Google Maps API cost

#13
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...

Re: How We reduced our Google Maps API cost

#14
post #12

So could increasing pricing under circumstances help to make your customers more creative, more efficient and more ecologically sustainable by making your costumers consume less of your computing power and bandwidth?

Does it matter whether google or the consumer of the google api caches data?

Re: How We reduced our Google Maps API cost

#15
post #2

For what it's worth, I found OpenStreetMaps and the Open Source Routing Machine to be sufficient for our purposes. If you don't want features like real-time traffic awareness, it's worth investigating the open source tooling. It can save a LOT of money.

PSA: Open Source Routing Machine (OSRM) was largely abandoned by its maintainers. Several of us are working to reboot it, so if you enjoy map data and/or graph theory and have C++ skills, this would be a great project to work on. https://github.com/Project-OSRM/osrm-backend/ (Reboot discussion at https://github.com/Project-OSRM/osrm-backend/issues/5209 )

That issue links to another open source routing engine for OSM (Valhalla) that is actively developed, what are the strengths of each?

Re: How We reduced our Google Maps API cost

#16
post #2

For what it's worth, I found OpenStreetMaps and the Open Source Routing Machine to be sufficient for our purposes. If you don't want features like real-time traffic awareness, it's worth investigating the open source tooling. It can save a LOT of money.

+1, I've made my own geocoding/geodecoding on openstreetmap data, it worked 10x faster than google and with our level of usage, server essentially pays for itself just for 20% of resources. With our level of usage, we would burn through free tier in several hours.

Re: How We reduced our Google Maps API cost

#17
post #14
post #12

So could increasing pricing under circumstances help to make your customers more creative, more efficient and more ecologically sustainable by making your costumers consume less of your computing power and bandwidth?

Does it matter whether google or the consumer of the google api caches data?

Placement of the cache definitely matters, even more so if you can take advantage of the more specific data freshness requirements.

Disclaimer: I work in Google. But I also worked a bit on effects of cache placement in my PhD.

Re: How We reduced our Google Maps API cost

#19

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...

Easier to use a random key, normal distribution.

Re: How We reduced our Google Maps API cost

#20

We also had an increased Maps bill after the new pricing model for each map load on a detail page for a specific real estate object. Our map is now disabled by default and can be loaded with a “show map” button on a static cached map image.

Seems like the more frugally people use it, the more they can up the price.
Post reply on HN