question

Upvotes
Accepted
77 5 12 17

Returned fields in datagrid api different from python api and also not consistent

Hi I am confused about how GetData fields are returned from the datagrid api

I have made the following request:

POST https://api.refinitiv.com/data/datagrid/beta1/

BODY:

{
  "universe": [
    "AAPL.O"
  ],
  "fields": [
    "TR.IssueMarketCap(Scale=6,ShType=FFL)",
    "TR.FreeFloatPct()/100/*FreefloatWeight*/",
    "TR.IssueSharesOutstanding(Scale=3)/*shares outstanding*/",
    "TR.CLOSEPRICE(Adjusted=0)/*close*/"
  ],
  "parameters": {
    "Curn": "USD",
    "SDate": "2020-10-27",
    "EDate": "2020-12-01"
  }
}


See also the resulting screenshot: Screenshot 2023-11-23 114750.png

the returned headers for field:

"TR.IssueSharesOutstanding(Scale=3)/*shares outstanding*/",

are

"TR.IssueSharesOutstanding"

also IssueMarketCap and IssueSharesOutstanding are simplified in a similar manner

While on the other hand field returns for:

"TR.FreeFloatPct()/100/*FreefloatWeight*/"

are as they have been supplied.

How can I make sure that the headers return the fields as previously supplied to them?

#technology#productrefinitiv-data-platformfields
icon clock
10 |1500

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

Upvote
Accepted
13.8k 28 5 10

Hi @laurens ,

Can you try this

{
  "universe": [
    "AAPL.O"
  ],
  "fields": [
    "TR.IssueMarketCap(Scale=6,ShType=FFL)",
    "Setlabel(TR.FreeFloatPct()/100,FreefloatWeight)",
    "Setlabel(TR.IssueSharesOutstanding(Scale=3),SharesOutstanding)",
    "Setlabel(TR.CLOSEPRICE(Adjusted=0),close)"
  ],
  "parameters": {
    "Curn": "USD",
    "SDate": "2020-10-27",
    "EDate": "2020-10-28"
  }
}

The result is as below

1701238489601.png

Hope this helps and please let me know in case you have any further questions


1701238489601.png (82.2 KiB)
icon clock
10 |1500

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

thanks a lot. I was a little bit confused how to apply the setlabel annotation. Now it is perfectly clear!
Upvote
5.3k 21 2 4

Hi @laurens,


DataGrid does support parameters similar to the ones you are showing in your question, but "TR.FreeFloatPct()/100” is not using a parameter, instead it is deriving a new fields with division. As datagrid considers this as a new calculated field it won’t show in return the same base data item field in response but will show the request as sent.

You can apply a custom label function to get desired label, e.g .: Setlabel(TR.FreeFloatPct/100,"FreeFloatPct")

icon clock
10 |1500

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

Thanks a lot, this makes it already a lot easier, can you please rewrite the body of the json request so that I can understand where to apply the SetLabel command as this is not entirely clear to me.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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