Getting Stadia Maps API for ggmap Rpackage
The ggmap R package is a powerful tool for creating stunning map visualizations in R, making mapping tasks more accessible and efficient. To enable Stadia Maps services in R, an API key is required. A free API key for non-commercial use can be obtained without requiring a credit card for sign-up.
Obtain API key
Sign up for Stadia Maps at https://client.stadiamaps.com/signup/
Navigate to the client dashboard at https://client.stadiamaps.com/dashboard/
Click on Create a Property → insert Property Name → click on Create
Under Authentication Configuration, select Add API key
Set API key for R session
- Copy the provided API key and execute the following code in the console
ggmap::register_stadiamaps(key = "YOUR-API-KEY", write = FALSE)When setting the API key: - Using write = FALSE to configure the key for the current R session only. The API key needs to be provided again when restarting R. - Using write = TRUE to set the API key permanently across R sessions.
- If the API key is shared inadvertently, access https://client.stadiamaps.com/ → delete the existing API key → generate a new one
Further information
- Authentication by Stadia Maps Documentation
- ggmap Documentation