Alaska Satellite Facility
Delivering Remote Sensing Data Since 1991

Build an API command - three parts

API commands can be incorporated into scripts or used at the command line via the Mac terminal window, Command Prompt window on Windows, or on Linux systems.

      1. File-transfer program (cURL or WGET
      2. Base URL
      3. Keywords and values

Program   Base URL                                             Keywords and Values
curl      https://api.daac.asf.alaska.edu/services/search/param?platform=R1\&absoluteOrbit=25234\&output=CSV 
Windows Example
curl “https://api.daac.asf.alaska.edu/services/search/param?platform=R1&absoluteOrbit=25234&output=CSV” > myfilename.csv

Hint: Copying and pasting quotation marks causes errors for Windows users. Delete and re-type the quotes after pasting.


1) Choose a File Transfer Program and options

Both WGET and cURL are often installed on Linux systems. cURL is part of the Mac OS, and WGET can be installed. MS-Windows OS does not come with either installed, but both can be downloaded. cURL is easier to set up on a Windows machine.

Browser Option
Searches can be done in the browser. Paste just the URL and keywords into a browser to search, visualize, or get a metalink file for downloading data. Connect keywords with "&" when using the browser. A file is returned, or you can open results in Google Earth to visualize.

Send all search results to a file
WGET option '-O myfilename' or cURL 'https://....   > myfilename' will send all search results into a file. To download data from ASF, use the .metalink extension on your filename. The metalink output is default for ASF searches, but can be explicitly called with keyword output=METALINK.

Example - query results sent to a metalink file:
wget -O myfilename.metalink https://api.daac.asf.alaska.edu/services/search/param?intersectsWith=point%28-119.543+37.925%29\&platform=ALOS\&output=metalink
curl https://api.daac.asf.alaska.edu/services/search/param?granule_list=ALPSRP074606580,ALPSRP021910740,ALPSRP085800750 >myfilename.metalink

Hint: Copy/pastes of examples that span multiple lines introduce error for Mac/Linux users. Copy and paste one line at a time.

Windows Example
curl  “https://api.daac.asf.alaska.edu/services/search/param?granule_list=ALPSRP074606580,ALPSRP021910740,ALPSRP085800750” > myfilename.metalink

2) Use the Base URL

The ASF API URL is 
https://api.daac.asf.alaska.edu/services/search/param?

3) Choose Keywords

Keywords are used to find the desired data. Use as many or as few keywords as needed.

Sample Keywords
KeywordDescription and Values
asfframe

This is an ASF / JAXA frame reference. See also 'frame'.
Values: Any number, series of numbers, or number range from 1 to 900 for ERS, RADARSAT, JERS. 0-7200 for ALOS PALSAR.

outputFormat of the API search results returned. If not specified, default return is METALINK for ASF API.

Example: output=CSV

Values: CSV, JSON, KML,METALINK

platform

Remote sensing platform that acquired the data.
Example: platform=ALOS

Values: A3, AI, AS, E1, E2, J1, ERS-1, ERS-2, JERS-1, R1, UA, AIRSAR, ALOS, ERS-1, ERS-2, JERS-1, RADARSAT-1, SEASAT, Sentinel-1A, UAVSAR

Syntax hints:

  ·A"?" separates the URL from the keywords.
  ·The keywords are joined by  "\&" for command line in Mac/Linux or "&" in browser and Windows.
  ·The base URL and keywords may not have any spaces.
  ·Some keywords contain characters that must be encoded.
  ·Keywords are case sensitive.

Keyword Character Encoding:
URLs may not contain spaces, or parentheses. Some keywords, such as intersectsWith, have parentheses and spaces.  Those characters must be encoded as shown in the table below.

Character Encoding
URL SymbolReplace with ASCII
spaceremove spaces in URL or use '%20'. Use '+'  in keyword values
(%28
)%29

For a complete list of URL codes, please see URL Encoding Reference.

Example - encoding
intersectsWith=point(-119.543 37.925) --> intersectsWith=point%28-119.543+37.925%29

Keywords  may contain a single value or a range of values, depending on the requirements of the particular keyword. For example, "frame=300,310-350" contains both a single value and a range.  The geographic area to be searched can be defined using either the older polygon keyword, or the newer intersectswithIntersectswith has the advantage of allowing a line, a point, or a multi-area search in addition to a single polygon.

4) Put it All Together - Examples

Mac/Linux Examples

Search
curl https://api.daac.asf.alaska.edu/services/search/param?platform=r1\&asfframe=300\&output=CSV > myfilename.csv

Visualize 
wget -O myfilename.kml https://api.daac.asf.alaska.edu/services/search/param?granule_list=ALPSRP074606580,ALPSRP077086550\&output=KML

Visualize - in browser and Google Earth
https://api.daac.asf.alaska.edu/services/search/param?granule_list=ALPSRP074606580,ALPSRP077086550&output=KML Download
wget -c -O myfilename.metalink https://api.daac.asf.alaska.edu/services/search/param?granule_list=ALPSRP074606580,ALPSRP077086550\&output=METALINK

Windows examples

Search
curl  “https://api.daac.asf.alaska.edu/services/search/param?platform=r1&asfframe=300&output=CSV” > myfilename.csv 

Visualize
curl “https://api.daac.asf.alaska.edu/services/search/param?granule_list=ALPSRP074606580,ALPSRP077086550&output=KML” >myfilename.kml

Download
curl -L “https://api.daac.asf.alaska.edu/services/search/param?granule_list=ALPSRP074606580,ALPSRP077086550&output=METALINK” >myfilename.metalink
Get SAR Data

Get SAR Data

Select and download SAR data online using Vertex.

Use the ASF API for downloading SAR data via a command line.