简体   繁体   中英

how can I make API KEY for Google Places api?

Here I have one problem that I can't access google places api service in android to find out nearby places.

i have read many tutorials but none of that clearly mention how to make a browser key or android key?

here i have tried all these.

1) make a browser key and pass in this query https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&types=food&name=harbour&sensor=false&key=YourAPIKey

2) made an android key and pass that key in same query but result is always same and show error as "access denied"

can anyone answer me how can I make this api key and which one(browser key or android key)?

I have been having this exact same problem and I too followed the guides of many, but none helped. I did end up finding a correct solution though and I was able to get my app working. I asked the question via stackoverflow here: How do I get a Google Places API key for my Android App

And the answer received ( Courtesy of user1632209 , Thank you again!) was:

Please Follow below steps

-Visit the Google APIs Console at https://code.google.com/apis/console and log in with your Google account.

-A default project called API Project is created for you when you first log in to the APIs Console. You can use the project, or create a new one by clicking the API Project button at the top of the window and selecting Create. Maps API for Business customers must use the API project created for them as part of their Places for Business purchase.

-Click the Services link in the left-hand navigation panel.

-Click the status switch (the on/off button) next to the Places API entry. The switch slides to ON.

-Click API Access in the left-hand navigation panel.

-Click Create new Server key. Enter one or more server IP addresses if you wish to restrict the servers that can send API requests.

-Click Create. Your API key appears under the heading Key for server apps (with IP locking).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM