REQUEST_DENIED when using the Google Places API

前端 未结 12 1372
庸人自扰
庸人自扰 2020-12-04 01:56

I\'m trying to make a request to the Google Places API, using the following url: https://maps.googleapis.com/maps/api/place/search/xml?location=37.77264,-122.409915&radi

12条回答
  •  无人及你
    2020-12-04 02:22

    My situation was that I had the API turned on, I generated the API key but I had also added some IP addresses to limit where the API requests were coming from. However, if you're developing locally, you shouldn't set any IP address because the IP address could be from your router (192.168.1.120) or from the ISP (238.382.33.298) or whatever so there's no good way to limit the API requests by IP address.

    When you are developing locally, set it to blank.

    When you are deploying to production or some other development server that has a constant IP address, set it to whatever the IP address of the server is.

提交回复
热议问题