RDA External Application API Update

March 3, 2020
Posted by: Riley Conroy

Note: This page was originally sourced from our Blogger page: http://ncarrda.blogspot.com/2020/03/rda-external-application-api-update.html

RDA External Application API Update


The RDA has introduced an update to the RDA External Applications API. The REST API will now return JSON encoded responses to queries, which should improve interactivity and allow for more robust error handling.

In addition to the updated HTTPS responses, an updated version of the rdams-client.py script has been released. This new python client can be used as a command line tool (as in the past) or as an imported python module to interact with the response objects directly.

A Jupyter Notebook that outlines how to use the module programmatically can be found here:

https://github.com/NCAR/rda-apps-clients/blob/master/src/python/rdams_client_example.ipynb


The complete API documentation can be found here: REST API and JSON Responses documentation


To demonstrate just one use case,
If you were to do an HTTPS GET call of the following url:
GET https://rda.ucar.edu/json_apps/paramsummary/ds083.2

An Example Response

This response could then be programmatically parsed to find only variables that had a certain unit, or those that were in GRIB2 format.
{
   "status": "ok",
   "request_duration": "0.173482 seconds",
   "code": 200,
   "messages": [],
   "result": {
      "dsid": "083.2",
      "subsetting_available": true,
      "data": [
         {
            "native_format": "WMO_GRIB2",
            "param": "VIS",
            "GCMD_uuid": "9337898d-68dc-43d7-93a9-6afdb4ab1784",
            "units": "m",
            "param_description": "Visibility"
         },
         {
            "param_description": "Categorical snow (yes=1; no=0)",
            "native_format": "WMO_GRIB2",
            "param": "CSNOW"
         },
         {
            "native_format": "WMO_GRIB2",
            "param": "PEVPR",
            "standard_name": "potential_water_evaporation_flux",
            "GCMD_uuid": "b68ab978-6db6-49ee-84e2-5f37b461a998",
            "units": "W m^-2",
            "param_description": "Potential evaporation rate"
         },
         {
            "native_format": "WMO_GRIB2",
            "param": "T CDC",
            "GCMD_uuid": "acb52274-6c0d-4241-a979-3fa3efca6702",
            "units": "%",
            "param_description": "Total cloud cover"
         },

         ...

         {
            "native_format": "WMO_GRIB1",
            "param": "ABSV",
            "standard_name": "atmosphere_absolute_vorticity",
            "ISO_TopicCategoryCode": "climatologyMeteorologyAtmosphere",
            "units": "s^-1",
            "GCMD_uuid": "858a80ff-5aa4-4590-b2e2-e88a802a6ee4",
            "param_description": "Absolute vorticity"
         },
         {
            "native_format": "WMO_GRIB1",
            "param": "VVEL",
            "standard_name": "lagrangian_tendency_of_air_pressure",
            "ISO_TopicCategoryCode": "climatologyMeteorologyAtmosphere",
            "units": "Pa s^-1",
            "GCMD_uuid": "841a7ac7-5981-4e93-895f-1b57c3d892a0",
            "param_description": "Vertical velocity (pressure)"
         }
      ]
   },
   "request_end": "2020-03-03T10:52:38.637789",
   "request_start": "2020-03-03T10:52:38.464307"
}