If this project helped, consider supporting it:
Access National Aeronautics and Space Administration (NASA) Open APIs for Space and Earth Data.
The nasa package provides functions to access and download data from various NASA APIs, including:
All retrieved data is returned in cleaned, tidy data frames suitable for analysis or visualization.
Install from CRAN:
install.packages("noaa")
Install from the rOpenGov universe:
# Enable repository from ropengov
options(repos = c(
ropengov = 'https://ropengov.r-universe.dev',
CRAN = 'https://cloud.r-project.org'))
# Download and install noaa
install.packages("noaa")
Most functions in this package can be run using the default DEMO_KEY. However, because the DEMO_KEY is publicly shared and subject to rate limits, it is recommended to request your own API key from NASA by visiting https://api.nasa.gov/.
get_apod_metadata(start_date, end_date, api_key = "DEMO_KEY", folder_name = NULL)
get_mars_rover_photos_and_metadata(rover, earth_date, api_key = "DEMO_KEY", folder_name = NULL)
get_earthdata(keyword, n_results, start_date = NULL, end_date = NULL)
library(nasa)
apod_data <- get_apod_metadata(
start_date = "2024-04-01",
end_date = "2024-04-02",
api_key = "DEMO_KEY")
mars_data <- get_mars_rover_photos_and_metadata(
rover = "curiosity",
earth_date = "2020-02-01",
api_key = "DEMO_KEY")
earthdata_results <- get_earthdata(
keyword = "sea surface temperature",
n_results = 10)