I am building a property listing for real estate and in backend (but also in frontend) I need to display Google Maps with a Pin.
The maps should not be interactive but simply display the position of the flat. No special pin icons, no other interactions.
I am on my staging environment and in 1 months the API's call generated a cost of more than 400 dollars that unfortunately I am going to pay...
How can I reduce the costs of Google Maps? It's really the first time I am implementing these API's...
CodePudding user response:
Hey so I ran into exactly the same problem whilst building a website for a real estate not too long ago.
We had 100's of property listings all with an interactive map that could filter nearby schools/shops etc. this was all relying on the Maps JavaScript API as well as the Places API which both become quite expensive when you're starting to get 10k requests a week!
Here was the learnings of a mad couple of weeks:
The Maps Embed API is free to use and by the sounds of it fits your needs perfectly, no need to programatically generate the map too, it just works as an iframe which you can set lattitude & longitude (or any other query for that matter) in the URL parameters of the iframe.

Notes
- won't reduce costs for cases where every user interacts with the more expensive map
- should improve page performance and lighthouse scores
- might add some complexity around css sizing of the elements
- join our discord server listed at https://developers.google.com/maps/developer-community#discord to discuss this further and match strategies to your particular use case.
