Quick Start Guide
This guide covers common operations users can perform using the API-V2 REST (Representational State Transfer) API.
For more information:
- Endpoint and parameter definitions: See the API-V2 OpenAPI specifications.
- Overall design and structure: Refer to the API-V2 User Guide.
Searching for a File or Set of Files
There are many parameters that can help define what you are searching for. Refer to the "content" OpenAPI spec for detailed lists with examples.
Examples
-
Search for files to then download (response is a simple HTML list, easily handled by tools like wget)
- Refer to /api/v2/content/archives
-
Search for information (metadata) about files (default response is JSON)
- Refer to /api/v2/content/details
Downloading Files
Important Notes:
- Note 1: All data downloads require either:
- That you are logged in to the website, if using in internet browser, or
- A Download Token, if using a
script or command line tool.
Substitute the download token for YOUR_TOKEN_HERE in the examples below.
- Note 2: curl by default downloads one file at a time. Refer to its documentation for all the options that it supports.
- Note 3: wget can also download multiple files and directory trees of files. Refer to its documentation for all the options it supports.
Examples
Download a specific filename
-
From browser:
Refer to /api/v2/content/archives/
-
Using curl:
curl --data-binary --header "X-Requested-With: XMLHttpRequest" --header "Authorization: Bearer YOUR_TOKEN_HERE" -o YOUR_OUTPUT_FILE_PATH_HERE --create-dirs -C - "https://ladsweb.modaps.eosdis.nasa.gov/api/v2/content/archives/FILENAME_TO_DOWNLOAD" -
Using wget:
wget -e robots=off -m -np -R .html,.tmp -nH --header "X-Requested-With: XMLHttpRequest" --header "Authorization: Bearer YOUR_TOKEN_HERE" --cut-dirs=3 "https://ladsweb.modaps.eosdis.nasa.gov/api/v2/content/archives/FILENAME_TO_DOWNLOAD" -P .
Download a file with a specific path
-
From browser:
Refer to /api/v2/content/archives/
-
Using curl:
curl --data-binary --header "X-Requested-With: XMLHttpRequest" --header "Authorization: Bearer YOUR_TOKEN_HERE" -o YOUR_OUTPUT_FILE_PATH_HERE --create-dirs -C - "https://ladsweb.modaps.eosdis.nasa.gov/api/v2/content/archives/PATH_TO_FILE" -
Using wget:
wget -e robots=off -m -np -R .html,.tmp -nH --header "X-Requested-With: XMLHttpRequest" --header "Authorization: Bearer YOUR_TOKEN_HERE" --cut-dirs=3 "https://ladsweb.modaps.eosdis.nasa.gov/api/v2/content/archives/PATH_TO_FILE" -P .
Search For and Download Files in One Step
Important Note:
- Note: All data downloads require either:
- That you are logged in to the website, if using in internet browser, or
- A Download Token, if using a
script or command line tool.
Substitute the download token for YOUR_TOKEN_HERE in the examples below.
Examples
Download a set of files that match query parameters
-
Using wget:
wget -e robots=off -m -np -R .html,.tmp -nH --header "X-Requested-With: XMLHttpRequest" --header "Authorization: Bearer YOUR_TOKEN_HERE" --cut-dirs=3 "https://ladsweb.modaps.eosdis.nasa.gov/api/v2/content/archives?YOUR_SEARCH_PARAMS_HERE" -P .
Finding Other Information
Examples
-
Get a list of platforms or instruments for which we currently distribute data
- Refer to /api/v2/missions/sensors
-
Get a list of products for which we currently distribute data
- Refer to /api/v2/measurements/products
-
Get production status of files for a given day
- Refer to /api/v2/measurements/availableFiles