2

I am trying to create a map file with ggmap but there is this persistent error of Forbidden (HTTP 403). I am using an API key, but that doesn't seem to work either.

Here is the code:

library(ggplot2) library(ggmap) set_key("...API-key...") dm <- get_map(location="Spain", zoom=6)

Then this is the message I receive:

Error in get_googlemap(center = location, zoom = zoom, maptype = maptype, : Forbidden (HTTP 403).

The code used to work at home, but now I'm living on campus. Could IP address affect this too?

SOLVED I had already got an API key. However, as has been pointed out by @Roman, I need a billing-enabled account to make it work. It didn't cost money, but you do need to give your credit card.

Marco Pastor Mayo
  • 803
  • 11
  • 25
  • 1
    There are numerous questions with the **same error code** here on SO. It means you have not registered a valid, billing-enabled Google Maps API key via `register_google()` in the newest version of `ggmap`. – Roman Oct 15 '18 at 05:24
  • Possible duplicate of [Is something wrong with the ggmap and mapview packages in R?](https://stackoverflow.com/questions/52743142/is-something-wrong-with-the-ggmap-and-mapview-packages-in-r) – Roman Oct 16 '18 at 14:03

0 Answers0