How to retrieve a county when giving a mailing address? - google-maps

Is there a way to get a JSON response of a county name when I send an http request with a mailing address? Does Google maps have something like this?

Please see the Geocoding Service (for JavaScript) or just the Geocoding API for anything else (to get over a URL).

Related

Address validation via Google Maps API

I want to send an address via Google API and get a response if this is a valid or wrong address. If it's a wrong address the response will include the reason (e.g. wrong zip code, wrong state etc.)
Is it possible?
Thanks
Google Maps APIs are not intended for address validation. They do, however, provide a variety of other services including geolocation, directions, distance calculation, and much more. For a list of APIs as well as what they can do for you please check out the API Picker here:
https://developers.google.com/maps/documentation/api-picker
I hope this helps!

google maps API to get all the place information like phone number , opening hours

I am using google maps API to get all the place information like phone number , opening hours .. when I test with the placeid in the developers site I get all the details but when I send send my placeid I get just the address_components details.
developers :
https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4&key=AIzaSyBz2O-udgMv8PnaY-2tW118Uz1182ApEiw
My link:
https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJ2xEZitrOUUYR0a9wjkKF9_g&key=AIzaSyBz2O-udgMv8PnaY-2tW118Uz1182ApEiw
The place ID ChIJ2xEZitrOUUYR0a9wjkKF9_g from second request returns result of type route. Places API can return addresses as well, not only businesses.
You can easily check it with Geocoding API request:
https://maps.googleapis.com/maps/api/geocode/json?place_id=ChIJ2xEZitrOUUYR0a9wjkKF9_g&key=YOUR_API_KEY
or open it in Geocoder tool:
https://developers-dot-devsite-v2-prod.appspot.com/maps/documentation/utils/geocoder/#place_id%3DChIJ2xEZitrOUUYR0a9wjkKF9_g
The route is not a business, so it doesn't have phone, open hours, etc.
I found the problem it was with the place_id and not the request , as xomena saying the the request returns result of type route, but I tried what 2 requests you wrote and it returns the same data I got with my request because of the placeId.
thank you all anyway :)

Google Maps API incomplete address

Is there a way of submitting to Maps API the complete address of a place and retreiving it from the API?
I tried to POST to the Place API, but the address doesn't split in component. I have a valid canadian address "6825 Saint-Pierre O. Saint-Hyacinthe J2T 5G7", but the MAPS API returns only the "prefix" for the postal code. I need the complete postal code for shipping purpose.
Is there any way to do this?

Checking whether an address exists. Google Maps SDK iOS

Is there a way to check whether an address you pass into Google Maps to get direction with the URL scheme exists?
You could try making a geocode request, and then see if you get a response of OK (the address could be converted into a location, so it exists), or ZERO_RESULTS (the address doesn't exist). Presumably when you start the Google Maps app with a URL scheme, Google uses the same geocoder internally to look up the address.
https://developers.google.com/maps/documentation/geocoding/

Google maps geocoding API inconsistent

I have a server application that calls the google maps geocoding API at http://maps.googleapis.com/maps/api/geocode/json
I experience that when the server application invokes such an URL, the response is sometimes ZERO_RESULTS.
If I take the exact same URL and paste in a browser, I get a valid result back.
Any ideas to what differences can cause this? HTTP headers? Something else?
In the link you provided it is missing the address, components, latlng or place_id parameters, besides the Google Map API KEY.
You need at least one of the parameters and the Key to get a proper response.
e.g.
https://maps.googleapis.com/maps/api/geocode/json?place_id=ChIJ1xwGTLE1K4gRmzFDd_1HzPc&key=xxx
Just add your KEY and it should work.