Search code examples
javascriptgoogle-geolocation

Google GeolocationAPI Requested entity was not found


So Im trying to use the Google GeolocationAPI. It sends the quest successfully and also authenticates successfully with my api key but it returns me this

    {
        "error": {
            "code": 404,
            "message": "Requested entity was not found.",
            "errors": [
                {
                    "message": "Requested entity was not found.",
                    "domain": "global",
                    "reason": "notFound"
                }
            ],
            "status": "NOT_FOUND"
        }
    }

The url Im requesting to is https://www.googleapis.com/geolocation/v1/geolocate?key=MY_KEY with post as described in the documentation.

Thanks in advance


Solution

  • I recommend you to check out the documentation:

    As you can read:

    Before you start developing with the Geolocation API, review the authentication requirements (you need an API key) and the API usage and billing information (you need to enable billing on your project).

    I was getting the exact same error until my billing information was validated. How I realized it, was using the geocoding API, which does return a better error.