Prerequisites
- An Earthdata account is required to access GES DISC Data
- Create and retrieve your Earthdata Login token.
Procedure
wget
“wget” is a free tool originally created for the GNU operating system that allows users to download data files via HTTP through a Windows or macOS/Linux command line. It can be installed by following the wget documentation on their website, which also contains further instructions on wget’s various features. Wget is best for users in a Windows or macOS/Linux environment who wish to access GES DISC files through simple command-line interaction. Below, we demonstrate various methods of GES DISC data access using this tool:
- Ensure you set up your Earthdata account.
- Install wget if necessary. A version of wget 1.18 compiled with gnuTLS 3.3.3 or OpenSSL 1.0.2 or LibreSSL 2.0.2 or later is recommended.
- Create your Earthdata Login token.
- Download your data using wget:
- To download one file:
wget --header "Authorization: Bearer <token>" "<url>"
- To download one file:
- Replace
<token>with your Earthdata Login token.
- To download multiple data files at once, create a plain-text
<url.txt>file with each line containing a GES DISC data file URL, or subsetted URLs, by using Earthdata Enterprise Subsetting Services or manually. Note that directory wildcards (e.g.,/*) on file servers are no longer supported, and each URL to be queried must be specified in the<url.txt>file. Then, enter the following command:
wget --header "Authorization: Bearer <token>" -i "<url.txt>"- Replace
<token>with your Earthdata Login token.
curl
“curl” is a free tool primarily designed for web-based applications that allows users to download data files via HTTP through a Windows or macOS/Linux command line. It can be installed by following the curl documentation on their website, which also contains further instructions on curl’s various features. curl is best for users in a Windows or macOS/Linux environment who wish to access GES DISC files through simple command-line interaction. Below, we demonstrate various methods of GES DISC data access using this tool:
- Ensure you set up your Earthdata account.
- Install curl if necessary. A version of curl 7.45 compiled with gnuTLS 3.3.3 or OpenSSL 1.0.2 or LibreSSL 2.0.2 or later is recommended.
- Create your Earthdata Login token.
- Download your data using curl:
To download one file:
curl -H "Authorization: Bearer <token>" -L --url "<url>"- Replace
<token>with your Earthdata Login token. <url>is the link from which you are downloading data.
- Replace
- To download multiple data files at once, create a plain-text
"<url.txt>"file with each line containing a GES DISC data file URL, or subsetted URLs, by using Earthdata Enterprise Subsetting Services or manually. Note that directory wildcards (e.g.,/*) on file servers are no longer supported, and each URL to be queried must be specified in the<url.txt>file.. Then, enter the following command:
On macOS/Linux:
cat <url.txt> | tr -d '\r' | xargs -n 1 curl -LJO -H "Authorization: Bearer <token>"
- Replace
<token>with your Earthdata Login token. - Replace
<url.txt>with your text file containing URLs.
On Windows (Command Line):
for /f "usebackq delims=" %i in (<url.txt>) do curl -LJO -H "Authorization: Bearer <token>" %i
- Replace
<token>with your Earthdata Login token. - Replace
<url.txt>with your text file containing URLs.
On Windows (PowerShell):
Get-Content -Path "<url.txt" | ForEach-Object {curl.exe -LJO -H "Authorization: Bearer <token>" $_}
- Replace
<token>with your Earthdata Login token. - Replace
<url.txt>with your text file containing URLs.