MAST Web Services

HTTP GET Requests
    - Script Examples
    - Mission Searches
    - Simple Cone Search
    - Simple Image Access Protocol
    - Simple Spectral Access Protocol
RSS News Feed
Soap Services

HTTP GET Requests

MAST data holdings can be searched not only using HTML search forms and applications such as Aladin, Datascope, Specview, etc., but also using HTTP GET requests. The GET request allows the search parameters to be included in the URL. As such, they can be called from within programs to automate data searches. The results can be returned in a variety of formats including HTML, VOTable XML format, excel spreadsheet, and comma-separated values which can simplify ingesting results into user-written programs. In addition, submitting GET requests can bypass restrictions currently placed on the web search forms (e.g., restrictions on the max_records value). Unfortunately, there has been little documentation on how the GET requests are formulated. This document will summarize the services currently available from MAST and give examples showing how they can be used.

Remember, when creating URLs, special characters must be encoded. URLs may only use alphanumerics [0-9a-zA-Z], the characters "$-_.+!*'()," and special reserved characters. The characters "<" and ">" must be specified as "%3C" and "%3E" respectively. For example, to specify a parameter such as RA > 120, the GET request parameter would be RA=%3E120. Blanks can be specified using the "+" character. Nulls can be specified as \null.


Script Examples

Scripts for retrieving MAST search results can be written in many programming languages. Basically you just need to download and extract information from a web page. A few simple examples are shown below. We welcome more examples from users.


Mission Searches

In general, mission searches are specified in the form:

http://archive.stsci.edu/[data set]/search.php?action=Search&params

where [data set] is the MAST-defined acronym for a particular set of data (listed below), and params is the list of search parameters as defined below. This does not apply to Kepler however so the correct values for [data set] are shown in parentheses below. Note that "action=Search" is a required parameter for all mission search requests. For the pointings search however, action may equal either "Search+Pointings" or "Search+Exposures".

The current list of data sets, links to mission-specific search fields, and search general parameters are shown in the following list:


In general, any parameter listed on the HTML search form can be specified in a GET request. If you are parsing the results, it would be easier and probably faster, to request the search results in CSV or VOTable format using the "outputformat" parameter.

Mission search examples:

Notes:
  1. Be sure to include "action=Search" (with capital S) in the mission searches, but not for SCS or SIAP requests.
  2. Parameter order is not important.
  3. For HST searches, sci_aec is set to "S" by default. This will return Science (S) but not Calibration (C) data. If both are desired, add the param sci_aec=%.
  4. Use a comma separated list for selected columns with the selectedColumnsCsv parameter, and specify all column names in lower case. Don't use selectedColumnsList as seen from the search form.
  5. Parameters such as resolver=don'tresolve should probably be encoded to be resolve=don%27tresolve. It seems to work without it though. (See PHP command called urlencode).
  6. There is currently a 300 second execution time limit on archive.stsci.edu which can cause large search requests to abort. Contact MAST if you run into this problem.
  7. Specifying an output format to download results as a file (e.g., outputformat=CSV_File) may avoid browser memory limitations that could cause a large request to fail. This however may require user-interaction.

Simple Cone Search (SCS)

MAST missions can also be searched using the Simple Cone Search protocol (SCS). The base url is the same as for MAST mission searches (i.e., http://archive.stsci.edu/[data_set]/search.php) without the "action=Search" parameter. The search radius parameter "SR" must be included in the URL for the cgi script to recognize a simple cone search is being requested. Besides the search radius in decimal degrees, RA and DEC parameters are also required to perform a cone search. The results are returned in VOTable format. The SCS protocol can be used with any MAST mission and the general MAST parameters can be included as well. Examples:

Simple Image Access Protocol (SIAP)

Many MAST missions and High Level Science Products (HLSPs) can also be searched using the Simple Image Access protocol (SIAP). The base URL is http://archive.stsci.edu/siap/search.php
followed by the SIAP parameters. One exception is the HST Press Release images SIAP service which has a base url:
http://archive.stsci.edu/stpr/vo_search.php
Like the Simple Cone search, the base url is similiar to that for mission searches however only missions with image data are searchable. By default, up to 2000 entries will be returned but specifying max_records=nnn can override the default. Adding the parameter "representative=y" will return only "representative" images as defined for the MAST scrapbook tool. Note some missions and particularly HLSPs, cover small areas of the sky. Currently the list of instruments, and High Level Science Products (HLSPs) that can be queried using the SIAP include: SIAP Examples:

Simple Spectral Access Protocol (SSAP)

MAST spectral missions can now be searched using the VO Simple Spectral Access Protocol (SSAP). It is similiar to the SIAP standard in that it returns a VOTable-format file with links to actual spectral data sets.

The current list of missions with SSAP services include:

The SSAP standard has evolved over the last couple of years, and today there are services that follow 2 slightly different standards:

Since we expect the earlier version to eventually go away, the examples below only describe version 1.0 services.

SSAP Examples:


RSS News Feed

Another MAST web service is our RSS news service. This is a list of our most recent news items which can be requested in HTML or RSS XML-format:

SOAP Services

We have one SOAP-based web service which is accessed via the ADS. The web service allows users to enter a data set name and find where it is archived. The service can be accessed from the web form at:
http://ads.harvard.edu/ws/DataVerifier, or, using the latest ADEC naming conventions:
http://vo.ads.harvard.edu/dv/DataVerifier.cgi