Live data from Hacker News

How We reduced our Google Maps API cost

blog.cityflo.com

91–100 of 172 posts

Re: How We reduced our Google Maps API cost

#92

If you track the vehicles every day and collect the location data, you can easily augment the Open Source Routing Machine to give you traffic accounted estimates.[0] Combined with some Kalman filters you'd get almost perfect estimates when live. Of course, this is for a use case where you have similar routes every day, this allows you to really tune the Kalman filters. 0: https://github.com/Project-OSRM/osrm-backend/…

My understanding is that Google's does real time traffic reporting so well because it's constantly pinging the location of android devices. There have been several write ups on how to spoof it, but historical data is never going to be a match for a feed like that.

If you carry lots of android devices it will alter the traffic on Google Maps - https://www.youtube.com/watch?v=k5eL_al_m7Q

Re: How We reduced our Google Maps API cost

#93

This takes accuracy hit for sure, total time of route can be different than the total time of segments. Especially if the route is long.

Why? That would entirely depend on how Google implements this. Ideally the result would match up exactly. If not you can certainly approximate the error introduced by this method well enough. They already needed to have something in place anyways to account for the bus actually stopping at all the stops. The API doesn't know about this in their old approach.

Re: How We reduced our Google Maps API cost

#94

We moved to Stadia Maps with significant cost reduction, but Stadia matched our use case quite well, I can see others need to stick with Google Maps. https://www.eventsofa.de/campus/migrating-away-from-google-m... Shoutout to Stadia Maps CEO who was always very very helpful.

Thanks for the kind words, KingOfCoders!

I'm cofounder of Stadia Maps, and I'm happy to field any questions folks may have.

Re: How We reduced our Google Maps API cost

#95
post #3
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.

I think real time traffic awareness is exactly what the poster wanted, but yeah it seems like people who don’t need that would be better off using OSS where possible.

If they run a lot of buses they have some traffic awareness built in to the system. I dare say not as good as Google but a knowing that a bus that is already on a segment that another bus is due to enter is delayed surely allows you to adjust the predicted arrival time of both buses.

Re: How We reduced our Google Maps API cost

#96
post #65

Earlier quoted context omitted.

It sounds like you could use Google's live traffic info to augment your own predictions. You should be fine with just a few API calls. This would be pretty cheap - perhaps even within the free tier.

It would violate the ToS.

Google's ToS says you're not allowed to do any computation on your own?

I mean, I'm not disputing it, I just hadn't realized we were already there.

Re: How We reduced our Google Maps API cost

#97

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

Genuine question: wouldn't this be considered write fraud?

Last time I asked this question [0] on a different story [1], the responses I got were that it definitely is wire fraud, but this is so mind-blowing that I would like to ask again to confirm.

[0] https://news.ycombinator.com/item?id=22362682

[1] https://news.ycombinator.com/item?id=22354357

Re: How We reduced our Google Maps API cost

#98

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

Genuine question: wouldn't this be considered write fraud? Last time I asked this question [0] on a different story [1], the responses I got were that it definitely is wire fraud, but this is so mind-blowing that I would like to ask again to confirm. [0] https://news.ycombinator.com/item?id=22362682 [1] https://news.ycombinator.com/item?id=22354357

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

Re: How We reduced our Google Maps API cost

#99

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

I worked at a company where they did the same thing, for a different Google API. It didn't work out, and it still baffles me how anyone thought it could.

It usually works until it doesn’t.

Re: How We reduced our Google Maps API cost

#100

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

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.

nobody will notice the difference between 4:00 minutes and 4:30 minutes, is the difference of stopping on a red light or finding it in green.
Post reply on HN