How to use the WAMO API

The WAMO tool helps to investigate individual observations. The Flask API can be called from any URL tool such as 'curl' or Python's 'requests' library. You can query the tool with one of three types:

  1. A "trksub" and "stn", e.g.,
    5T0D452 703
  2. An "obsid", e.g.,
    L4eBVG000000CfiO010000A9a
  3. An "obs80" string, e.g.,
         HspSXY1*KC2023 09 23.97588 00 06 40.35 -00 39 29.6          21.6 VZ     Z28
    (Note the leading spaces).

You can query the API with two input formats, with any combination of the three types above:

  1. A list of observations to query. e.g.,
    ['5T0D452 703', 'L4eBVG000000CfiO010000A9a']
    This returns a JSON object.
  2. A dictionary,
    {'return_type': 'string', 'obs': ['5T0D452 703', 'L4eBVG000000CfiO010000A9a']}
    This returns a string as in the original WAMO tool.

Examples

curl -X GET -H "Accept: application/json" https://data.minorplanetcenter.net/api/wamo -H "Content-type: application/json" -d '["5T0D452 703", "L4eBVG000000CfiO010000A9a"]'
Or in Python:
import requests

url = "https://data.minorplanetcenter.net/api/wamo"
obs_list = ['P11JuVG F51']
result = requests.get(url, json=obs_list)
observations = result.json()

# The Flask endpoint can also provide the original WAMO string
result = requests.get(url, json={'return_type': 'string', 'obs': obs_list})
observations = result.text