The response from the use of the new Google API API key says: "The validity of the API key has been granted"

I recently created a Google developer account, connected my credit card information for billing, turned on the Places API and created a server key and connected my server ip address, but when I try to access the API in my code, I get the answer:

SimpleXMLElement Object
(
    [status] => REQUEST_DENIED
    [error_message] => The provided API key is expired.
)

The endpoint used to access the API is: https://maps.googleapis.com/maps/api/place/textsearch/xml?query= $ query & type = $ type & sensor = true & key = $ serverkey

Perhaps this error errormessage is a symptom of another problem? Maybe I'm using the wrong endpoint or the wrong type of API key? It seems strange that the new server key will expire ...

+4
source share
1 answer

It looks like you might need a browser key rather than a server key.

0
source

Source: https://habr.com/ru/post/1542561/


All Articles