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.
Related
I want to use this get in order to get Lat/Long for an address.
Currently, it always returns REQUEST_DENIED. This API project is not authorized to use this API.
I have ensured that my key is enabled, and currently, it has no restrictions for testing purposes. This is the url, with the actual key replaced with 12345.
https://maps.googleapis.com/maps/api/geocode/xml?address=123%2C%20Harbor%2C%20Woods%20Circle%2C%20Safety%2C%20Harbor%2C%20FLCA%2C%2034695&key=12345
I have tried Disabling the Google Maps API, and then Enabling it again, but I still get the same error message.
I am thinking that maybe I don't have the right API enabled on this, as it should be working.
To use the Geocoding Web Service you need to enable it in the Google API Console
I just found it, I needed to enable the Geocoding API.
On some domains Google Maps returns instead of image this error message: The Google Maps Platform server rejected your request. You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account
Domains where it does not work:
http://en.aston-martin-club.com/test_mapa.php
http://en.ktm-club.cz/test_mapa.php
Domains where it works:
http://en.renault-club.cz/test_mapa.php
http://en.lada-club.eu/test_mapa.php
The image I display on web is from http://maps.googleapis.com/maps/api/staticmap URL. It is Google Maps Stati API https://developers.google.com/maps/documentation/maps-static/intro
Why on some domains it works and some not? If it wil not work for any domain, then I think I need to add "key=YOUR_API_KEY" parameter.
I spent many hours trying to find out the reason, but did not succeeded. Any help is very welcome.
In the past (and this is probably still the case), domains that were using the API before keys became required were "grandfathered" with keyless access (they will work without a key).
Keys are now required, so regardless whether the domains "work" without keys or not, it is best to add a valid key to the request.
The things that determine whether or not the domains are "grandfathered" to keyless access are:
When the domain was created
When the domain started using the Google Maps APIs
Google rejects all the requests for static images that does not include api key in URL.
I don't know Google's threshold, but en.aston-martin-club.com is blocked by Google obviously. You must include api key in URL at least.
We are developing and that needs the direction APIs to measure the distance between 2 addresses.
The only option I have is http as this part of the app doesn't have a map.
I am trying to understand the proper usage of the direction APIs, related Keys and quota.
First we were issuing the http call without a key.
maps.googleapis.com/maps/api/directions/json?origin=43.65077%2C-79.378425&destination=43.63881%2C-79.42745
Sometimes we get back the proper response, but many times I get OVER_QUERY_LIMIT
(even though we are hardly issuing any calls, it is impossible that we are triggering any limit)
Then after visiting this link:
https://developers.google.com/maps/documentation/directions/usage-limits, we enabled the API key and added the key to the call.
So the call now looks like this
http://maps.googleapis.com/maps/api/directions/json?origin=43.65077%2C-79.378425&destination=43.63881%2C-79.42745&key=AI***AQ
Every time, we issue the call, we get back REQUEST_DENIED
Ensure you have enabled the following APIs
Directions API
Distance Matrix API
Geocoding API
Geolocation API
Places API
In case its for Android, also enable the following
Maps SDK for Android
To resolve this issue use the https:// instead of http:// in your base url. I have been testing some items and got the same error message. Once I changed it to https:// I was able to make the call.
Hope this helps anyone else with this issue.
The error message I get with your request (including a valid key) is "Requests to this API must be over SSL. Load the API with https: instead of http:". You need to make the requests over https.
https://maps.googleapis.com/maps/api/directions/json?origin=43.65077%2C-79.378425&destination=43.63881%2C-79.42745&key=VALID_API_KEY
I am using the Google Maps API for my backend service written in Java.
I want to use a full address (1000 Generic Street, Generic Town, Texas) in the API; however, I am getting back null responses from the api call when using 1000+Generic+Street,+Generic+Town,+Texas in the ORIGIN space. What am I doing wrong?
Even when I use WACO,+TEXAS I get null responses.
Here is the API call:
https://maps.googleapis.com/maps/api/directions/json?origin=ORIGIN&destination=DESTINATION&key=0000
Here is an example:
https://maps.googleapis.com/maps/api/directions/json?origin=1800%20Manor%20Road,%20Austin,%20TX%2078722&destination=6501%20Memorial%20Drive,%20Houston,%20TX%2077007
If you have a valid key use it otherwise just remove &key=0000 until you get a valid key
More Info here
I use google maps static api to show maps on my website and use the following url:
http://maps.googleapis.com/maps/api/staticmap?center=usa&size=800x300&maptype=roadmap&sensor=false&markers=color:blue|label:S|usa
However, if enter a non-existing address, google will return a picture like this:
http://maps.googleapis.com/maps/api/staticmap?center=notexistingaddress&size=800x300&maptype=roadmap&sensor=false&markers=color:blue|label:S|notexistingaddress
I would like to know, how can I determine, if an address exists or not, using google maps static api. I cannot use javascript, because this code is executed on server.
After reading the docs, I think that the Google Maps Static API has nothing (exept the way I suggest like verify the return of the picture manually or only the keyword notexistingaddress) to verify if an address exists or not.
The best way to do validation is I think the Google Geocoding API, where you can outpout a Json / XML of a given address. The status code of ZERO_RESULTS which indicates that the geocode was successful but returned no results may interest you.