I have been facing this issue in the get_map() function (ggmap library) in R.
My code was running without the need to specify an API key
You need to use register_google(key = "...") in every new session of R. Using api_key = inside the get_map() call does not work.
updated: 2018-12-24 for ggmap 2.7.904 and current Google Cloud API
require(devtools)
devtools::install_github("dkahle/ggmap", ref = "tidyup")
Link for more info on how to get an API key
Direct Link to Google Cloud Platform Console
Direct Link to Google Maps API Pricing Information
APIs you need: Maps Static and Geocoding
Enable billing in the general settings.
library(ggmap)
register_google(key = "...") # copied directly from Google Console via 'copy' button
ggmap(get_googlemap())
ggmap(get_map("Hannover, Germany"))
If you get an error here (e.g., Forbidden 403) you most probably have not activated your key for the right APIs. Tutorial to troubleshoot geocoding
ggmap(get_map(location=c(16.3738,48.2082), zoom=13, scale=2))