Quickstart

The following section provides a quickstart guide to try out the PDS Search API.

Warning

Since our servers are not fully populated with all PDS data sets, the examples presented in this user guide may return empty results or 404 (Not Found) errors. If there is a data set you would like added, please contact the PDS Help Desk for assistance.

Note

curl command line tool is used to request the API in this documentation. curl is available in many operating systems by default. If not, you can get curl from https://curl.se/ or using a package management tool specific to your operating system (brew, apt, …).

Search With curl

  1. Open a Terminal window (or your favorite command-line application).

  2. Get 5 products’ metadata from the API in JSON format:

 curl -L --get 'https://pds.nasa.gov/api/search/1/products?limit=5' \
     --header 'Accept: application/json'
  1. Get 5 products’ metadata from the API in XML format:

 curl -L --get 'https://pds.nasa.gov/api/search/1/products?limit=5' \
     --header 'Accept: application/xml'
  1. To view this in a more readable way, you can pipe the output to a file, or pretty print (on Mac/Unix):

# Output JSON to a File
curl ... > my_first_query.json

# Pretty print JSON
curl ... | json_pp > my_first_query.json

# Output XML to a File
curl ... > my_first_query.xml

More details on how to use the API can be found in the endpoints .

Search with Python

Alternatively, it is possible to use other tools such as Postman and programming languages such as Python to call the PDS Search API.

To use the PDS API Python Client, you can read this other Quickstart