MarketPrice response Fields metadata

MarketPrice response contains the "Fields" tag for all requested fields. But it doesn't have field metadata. Is there any separate request we need to make to get field metatadata. We need to know whether the field is date or datetime or number etc to parse it correctly.

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    You can use a dictionary request to get field definitions.

    def send_dict_request(ws):
        dict_json = {
            'ID': 3,
            'Domain': 'Dictionary',
            'Key':{
                'Name': 'RWFFld',
                'Filter': 3
                }
            }
        ws.send(json.dumps(dict_json))
        print("SENT:")
        print(json.dumps(dict_json, sort_keys=True, indent=2, separators=(',', ':')))

    The response contains a series of element lists. For example:

            {
              "Elements":{
                "FID":{
                  "Data":3,
                  "Type":"Int"
                },
                "LENGTH":16,
                "NAME":"DSPLY_NAME",
                "RIPPLETO":{
                  "Data":0,
                  "Type":"Int"
                },
                "RWFLEN":16,
                "RWFTYPE":19,
                "TYPE":{
                  "Data":5,
                  "Type":"Int"
                }
              }
            },

    "RWFTYPE" specifies the type of field. You can find the meaning of RWFTYPE from rsslDataTypeEnum.h. For example, the RWFTYPE of DSPLY_NAME is 19 which is RSSL_DT_RMTES_STRING.

    RSSL_DT_RMTES_STRING        = 19, 

Answers

  • Hi @krishna muppavarapu the fields are defined in the data dictionary file. You can see the RDMFieldDictionary file here: https://github.com/Refinitiv/Elektron-SDK/tree/master/Java/etc


  • Hi @krishna muppavarapu,


    As far as I know, there is no schema / metadata provided for the WebSocket service. Since json only supports basic types, you can certainly use a parsing library to assist in determining the type of field, i.e. string, number (float, integer), boolean. Date and Time fields come in as strings. Within the Fields object you would only find Date fields, not datetime. Time fields will be available in other fields.

    Depending on which programming language, I would encourage you to use an existing json library that will parse the native json fields appropriately for you.