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 to add to Roman Abashin's answer (I can't comment, unfortunately): As per '?get_map()', the 'api_key =' argument doesn't work for Google maps. You'll need to use the 'register_google()' function, but as of 03/10/18, it's only in the development version of ggmap, which you can get like so:
devtools::install_github("dkahle/ggmap", ref = "tidyup")
Then you'll also need to enable billing on your Google account, though the first 100,000 maps you use each month should be free, see here: https://cloud.google.com/maps-platform/pricing/sheet/ for details.
(tips drawn from here: https://github.com/dkahle/ggmap/issues/51)