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
Just adding to @Roman's response, here's the code that worked for me:
if(!requireNamespace("devtools")) install.packages("devtools")
devtools::install_github("dkahle/ggmap", ref = "tidyup")
library(ggmap)
register_google(key = "your_API_key")
usa<- get_googlemap(location='united states', zoom=4,maptype = "hybrid")
For more information you could refer to the library page on github: here
Hopefully it helps!