For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 1 1 1

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.

treprdp-apiwebsocketsrrtofields
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
38.1k 71 35 53

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, 
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
13k 32 12 18

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


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
9.7k 49 38 60

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.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea