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.,
  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.


curl -X GET -H "Accept: application/json" -H "Content-type: application/json" -d '["5T0D452 703", "L4eBVG000000CfiO010000A9a"]'
Or in Python:
import requests

url = ""
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