I am trying to make a request to directions api from android. I have constructed my request url like below:
https://maps.googleapis.com/maps/api/directions/json?mode=driving&transit_routing_preference=less_driving&origin=12.84938,77.6554783&destination=151,+9th+Main+Road,+HSR+Layout+Sector+6,+Bengaluru,+Karnataka+560102&key=MYAPI_KEY
but on testing the endpoint, I get this error:
{
"error_message" : "This IP, site or mobile application is not authorized to use this API key. Request received from IP address 223.227.127.66, with empty referer",
"routes" : [],
"status" : "REQUEST_DENIED"
}
I have looked at other questions similar to this and there's a mention of server key and browser key
. How do I obtain a server key? Isn't it the same as the api key I receive on registering directions or maps api
?
Thanks for any help.