Need help with ggmap and google API in Rstudio

I am working in R studio. I have created a project in google cloud, activated an API, and enabled the Maps Static API restriction. There is an orange triangle on the Google Cloud Console that says "configure consent screen," but my only option is to fill out APP info when I click on that. I am not creating an app. I am trying to load a map and add some plots. I do not know why the key is invalid or if this is a google, ggmap, or self-issue.
Any help would be appreciated.

Here are the steps I took in R: I registered the API with ggmap,

register_google(key = "[key code]", write = TRUE)

but when I enter this code:

chicagomap<- ggmap(get_googlemap(center = c(lon = 41.8781, lat = 87.6298),
                             zoom = 10, maptype = 'roadmap',
                              color = 'color'))

I get this error:

Error in get_googlemap(center = c(lon = 41.8781, lat = 87.6298), zoom = 10, : HTTP 400 Bad Request The Google Maps Platform server rejected your request. The provided API key is invalid.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.