Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Caliga's avatar

Geocoding API

Hello there!

My team and I are currently in the process of building a rather large laravel website for a client, expected to have pretty high traffic. During our signup process we have to determine our users location from as little data as possible, so that the content they receive is relevant to them (we need to be accurate to within a few miles, at the worst).

I've looked at several services, Google and Bing API's for example, and our fear is that their free limits may not suffice.

My question to you all is what service, free or paid (preferably fairly cheap, though not imperative), would you recommend the most?

For the sake of design, we would ideally like a minimal amount of fields (for example country, zip/postcode) to get this data, and it must always be accurate.

Any recommendations you could give me would be greatly appreciated, thank you!

0 likes
6 replies
imJohnBon's avatar

I would suggest looking into Google's client side geocoding:

https://developers.google.com/maps/articles/geocodestrat

As the documentation says:

"As geocoding limits are per user session, there is no risk that your application will reach a global limit as your userbase grows. Client-side geocoding will not face a quota limit unless you perform a batch of geocoding requests within a user session. Therefore, running client-side geocoding, you generally don't have to worry about your quota."

1 like
austenc's avatar

@mikebronner thanks for the link, do you know if it's possible to use 'client side geocoding' with that package?

mikebronner's avatar

You mean that Javascript should resolve the geocoding via AJAX calls, for example? I don't believe so, its a PHP-based solution. I don't recall seeing any JS libraries for it. There is a sister-package that is JS based, though: https://github.com/geocoder-php/geocoder-js I imagine they would work very well together.

1 like
brianHyfos's avatar

Hey, i cannot seem to make it work. Im getting a null response.

marcseidler1990's avatar

Hey there,

Yes, Google and Bing offer terribly expensive geocoding services. I was looking for a free alternative and found https://geocodeapi.io. It is an external REST-API and it offers a quite generous free plan.

1 like

Please or to participate in this conversation.