Lester L.
Lester L.

Reputation: 969

How to use Google Places API for Web Service in android?

https://maps.googleapis.com/maps/api/place/nearbysearch/json?rankby=distance&location=LATITUDE,LONGITUDE&rankBy=50000&types=grocery_or_supermarket&sensor=true&name=NAMESEARCH&key=SERVER_KEY

how to use this link to return json format for the results, I already have an Server Key but it keep saying that "This IP, site or mobile application is not authorized to use this API key."

Upvotes: 3

Views: 2853

Answers (3)

kevz
kevz

Reputation: 2737

  1. I want you to delete the current server_key.
  2. Create a new Server_Key.
  3. It takes 10 mintues to activate the server_key, otherwise you will get error_message "The provided API key is expired".

Now hit the url voila it works!!!

Upvotes: 1

user2054910
user2054910

Reputation:

The official way to integrate Google Places API is through the Android implementation. You could use the PlacePicker which takes care the most but if you have a need that it doesn't fill, then you could integrate just the Place Autocomplete to your own UI.

Having said this if you would insist using the service url directly in an Android app, then you would need to configure a Browser Key in the Google Developer Console.

Upvotes: 5

Blackbelt
Blackbelt

Reputation: 157467

You shouldn't. Android has its own way to query places through the GooglePlayApiClient (read more here). You still want to use the web service you need a server key. From the documenation

Note: The Google Places API Web Service does not work with an Android or iOS API key.

you can get the key here. Please, note that key has a limitation of 15k text searches per day. If you need more you will have to apply for a premium plane

Upvotes: 3

Related Questions