What Google Maps API can I use to translate zip codes to longitude and latitude?
php if(isset($_POST['submit'])) { $zipcode=$_POST['location']; $url = "http://maps.googleapis.com/maps/api/geocode/json?address=".$zipcode."&sensor=false"; $details=file_get_contents($url); $result = json_decode($details,true); $lat=$result['results'][0]['geometry']['location']['lat']; $lng=$result['results'][0][' ...
ZIP code lookup The request format is: http://maps.googleapis.com/maps/api/geocode/json?address=ZIP_CODE&key=YOUR_API_KEY will, and in the response you get a lot of information, including for our purposes, that 92101 is the postal code for San Diego, California.
You want the Geocoding API http://code.google.com/apis/maps/documentation/geocoding/, pass the zip as the address parameter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With