0

I know this question was asked before, but I haven't found an answer for it. I am trying to show a map of a city in ggmap function. It seems that since 2018, we have to register using google API code as described here: https://cran.r-project.org/web/packages/ggmap/readme/README.html

or

https://rdrr.io/cran/ggmap/man/register_google.html

I tried following these examples and used the following code:

library(ggmap)
register_google(key = "xxxxxxxx-RXRy215NIV1yyyyyyyyyyyyyyyyy")
geocode("mannheim")

The result I get is this:

Source : https://maps.googleapis.com/maps/api/geocode/json?address=mannheim&key=xxxx
Warning: Geocoding "mannheim" failed with error:
This API project is not authorized to use this API.

# A tibble: 1 x 2
    lon   lat
  <dbl> <dbl>
1    NA    NA

Any idea as how I can fix this issue? I recently generated the API through google account and it should be valid.

Roozbeh_you
  • 723
  • 1
  • 12

1 Answers1

1

You have to enable that API: geocoding service.

https://www.loopeando.com/google-maps-platform-rejected-your-request-an-internal-error-was-found-for-this-api/

crestor
  • 739
  • 5
  • 17
  • 1
    https://stackoverflow.com/questions/32994634/this-api-project-is-not-authorized-to-use-this-api-please-ensure-that-this-api – crestor Apr 18 '21 at 22:15