Programmatic Access Guide for Data on daacdata.apps

Data from the NASA National Snow and Ice Data Center Distributed Active Archive Center (NSIDC DAAC) can be accessed directly from our HTTPS file system. We provide basic command line Wget and curl instructions for HTTPS file system downloads below.

For questions about programmatic access to NSIDC DAAC data, please contact NSIDC User Services: nsidc@nsidc.org

Regardless of how users access data from the NSIDC DAAC, an Earthdata Login account is required. Please visit the Earthdata Login registration page to register for an account before getting started. 

Wget Instructions for Mac and Linux

Step 1

Store your Earthdata Login credentials (username <uid> and password <password>) for authentication in a .netrc file in your home directory. 

Example commands showing how to set up a .netrc file for authentication:

echo 'machine urs.earthdata.nasa.gov login <uid> password <password>' >> ~/.netrc
chmod 0600 ~/.netrc

Replace <uid> and <password> with your Earthdata Login username and password (do not include brackets). Windows bash users should also replace the forward slash ( / ) with a backslash ( \ ) in the above commands. 

Step 1 may be skipped by specifying the following options in the Wget command in Step 2:
--http-user=<uid> --http-password=<password> 
or
--http-user=<uid> --ask-password

Step 2

Use a Wget command to download your data. 

Example Wget command to download a single file of CMC Meteorological Centre (CMC) Daily Snow Depth Analysis Data for the year 2020:

wget --load-cookies ~/.urs_cookies --save-cookies ~/.urs_cookies --keep-session-cookies --no-check-certificate --auth-no-challenge=on -r --reject "index.html*" -np -e robots=off https://daacdata.apps.nsidc.org/pub/DATASETS/nsidc0447_CMC_snow_depth_v01/Snow_Depth/Snow_Depth_Daily_Values/GeoTIFF/cmc_sdepth_dly_2020_v01.2.tif

Requested files will be downloaded to a directory named after the HTTPS host daacdata.apps.nsidc.org. Within this directory there will likely be other directories that follow the same directory structure that is on the HTTPS file system. You can modify how the files are stored by specifying the following Wget options:
-nd (or --no-directories)
-nH (or --no-host-directories)

The GNU Wget 1.20 Manual provides more details on Wget options.


Wget Instructions for Windows

The following instructions apply to Wget executed through Windows Command Prompt. For Windows bash, please see the above Mac and Linux instructions. 

Step 1

Create a text file ("mycookies.txt") to store the website cookies returned from the HTTPS server. Store this in the wget installation directory.

Step 2

Use a Wget command to download your data. In the following example, replace <uid> and <password> with your Earthdata Login username and password (do not include brackets).

Example Wget command to download a single file of Canadian Meterological Centre (CMC) Daily Snow Depth Analysis Data for the year 2020:

wget --http-user=<uid> --http-password=<password> --load-cookies mycookies.txt --save-cookies mycookies.txt --keep-session-cookies --no-check-certificate --auth-no-challenge -r --reject "index.html*" -np -e robots=off https://daacdata.apps.nsidc.org/pub/DATASETS/nsidc0447_CMC_snow_depth_v01/Snow_Depth/Snow_Depth_Daily_Values/GeoTIFF/cmc_sdepth_dly_2020_v01.2.tif

Requested files will be downloaded to a directory named after the HTTPS host . daacdata.apps.nsidc.org. Within this directory there will likely be other directories that follow the same directory structure that is on the HTTPS file system.You can modify how the files are stored by specifying the following Wget options:
-nd (or --no-directories)
-nH (or --no-host-directories)

The GNU Wget 1.20 Manual provides more details on Wget options.


curl Instructions

Step 1 

Follow the Step 1 Wget instructions for Mac and Linux above. All Windows users should replace the forward slash ( / ) with a backslash ( \ ) in the same commands.

Step 2

Use a curl command to download your data. 

Example curl command to download a single file for the Canadian Meteorological Centre (CMC) Daily Snow Depth Analysis Data for the year 2020:

curl -b ~/.urs_cookies -c ~/.urs_cookies -L -n -O https://daacdata.apps.nsidc.org/pub/DATASETS/nsidc0447_CMC_snow_depth_v01/Snow_Depth/Snow_Depth_Daily_Values/GeoTIFF/cmc_sdepth_dly_2018_v01.2.tif

The -O option in the curl command downloads the file to the current working directory on your computer. 


Last updated: March 2022