https://maps.googleapis.com/maps/api/geocode/json?address= & key = You need to transfer the Google service API key to the above URL, after which you will get the result in json format:
{ "results" : [ { "address_components" : [ { "long_name" : "Mumbai", "short_name" : "Mumbai", "types" : [ "locality", "political" ] }, { "long_name" : "Maharashtra", "short_name" : "MH", "types" : [ "administrative_area_level_1", "political" ] }, { "long_name" : "India", "short_name" : "IN", "types" : [ "country", "political" ] }, { "long_name" : "400093", "short_name" : "400093", "types" : [ "postal_code" ] } ], "formatted_address" : "Udyog Sarathi, Mahakali Caves Road, Marol Industrial Area, Andheri East, Mumbai, Maharashtra 400093, India", "geometry" : { "location" : { "lat" : 19.1254233, "lng" : 72.8665118 }, "location_type" : "GEOMETRIC_CENTER", "viewport" : { "northeast" : { "lat" : 19.1267722802915, "lng" : 72.86786078029151 }, "southwest" : { "lat" : 19.1240743197085, "lng" : 72.8651628197085 } } }, "place_id" : "ChIJ02N9eyPI5zsRMEB_9ivO_B0", "types" : [ "establishment", "point_of_interest" ] } ], "status" : "OK" }
The geometry contains the location in lat lon format.
user2828296
source share