MAST API
Tools for programmatically querying the MAST Portal.
 All Classes Namespaces Properties Pages
Result Dataset Formats

json

Standard json format. This is the recommended result format for API users.

{
"status" : "EXECUTING/COMPLETE/ERROR",
"msg" : "message string",
"percent complete": percentComplete,
"paging": {'page': currPage, 'pageSize': pagesize, 'pagesFiltered': totPages, 'rows': rowsReturned, 'rowsFiltered': totRows, 'rowsTotal': totRows},
"fields": [
          {"name":"column1 name","type":"column1 datatype"},
          {"name":"column2 name","type":"column2 datatype"},
          ...
          ]
"data" : [
         {"column1 name": "row 1 col 1 value", "column2 name": "row 1 col 2 value",…},
         {"column1 name": "row 2 col 1 value", "column2 name": "row 2 col 2 value",…},
         ...
         ]
}

Note: The column names are the database column names and will not correspond precisely to the column headers visible in the Portal. The database column name to Portal column header correspondence can be viewed in the "show details" action pop-up in the Portal.

extjs

Specialized extjs json object.

{
"status" : "EXECUTING/COMPLETE/ERROR",
"msg" : "message string",
"percent complete": percentComplete,
"data" : {
          "name":"NewDataSet",
          "Tables": [
                     {"name":"Table",
                      "ExtendedProperties":{"Paging":{'page': currPage, 'pageSize': pagesize, 'pagesFiltered': totPages, 'rows': rowsReturned, 'rowsFiltered': totRows, 'rowsTotal': totRows}},
                      "Columns":[
                                 {"text": "column_name","dataIndex": "column_name","ExtendedProperties":{"vot.arraysize":"*","cc.openByDefault":true,…}},
                                 ...
                                ],
                      "Fields":[
                                {"name":"column1_name", "type": "datatype"},
                                {"name":" column2_name ", "type": "datatype"},
                                ...
                               ],
                      "Rows":[
                              ["col1 row1 val", col2 row1 val,…],
                              ["col1 row2 val", col2 row2 val,…],
                              ...
                             ]
                 }]
         }
}

Note: While this is the default format for requests that return dataset objects, it is more complicated than necessary, and contains extraneous information from the point of view of the API user. Additionally it often requires pre-processing before being parse-able by standard json parsers. The json result format is recommended for API use.

csv

Comma separated value string with the following format:

#The following lines beginning with # are comments. Readable columns names and datatypes are provided as informational comment lines in addition to the database column names.
#If you want to re-upload this table import it as a Generic Table with these header lines unmodified.
#Column One, Column Two, ...
#@col1 datatype, col2 datatype, ...
col1, col2, ...
col1 row1 val, col2 row1 val, ...
col1 row2 val, col2 row2 val, ...
... 

Note: "Column One, Column Two, …" refer to the column names that appear in the Portal, while "col1, col2, …" refer to the database column names which are slightly different ("col1, col2 …" are the column names that are returned in the json dataset type).

votable

VOTable format following the VOTable xml standard. Compatible with VOTable tools.

Example format:

<VOTABLE version="1.3" xsi:schemaLocation="http://www.ivoa.net/xml/VOTable/v1.3 http://www.ivoa.net/xml/VOTable/v1.3">
    <DESCRIPTION>NewDataSet</DESCRIPTION>
    <RESOURCE type="results">
        <TABLE>
            <FIELD name="name" arraysize="*" datatype="char" ID="data_id" ucd="meta.code.class" utype="dataproducttype">
                 <DESCRIPTION>Field Description</DESCRIPTION>
            </FIELD>
            <FIELD name="name" arraysize="*" datatype="char" ID="data_id" ucd="meta.code.class" utype="dataproducttype">
                 <DESCRIPTION>Field Description</DESCRIPTION>
            </FIELD>
            ...
             <DATA>
                 <TABLEDATA>
                       <TR>
                            <TD>row1 col1 val</TD>
                            <TD>row 1 col2 val</TD>
                            ...
                       <TR>
                       ...
                     </TABLEDATA>
             </DATA>
        </TABLE>
    </RESOURCE>
</VOTABLE>