How do I get historical data on a option chain

Hi,

I have the below code


```

import refinitiv.data as rd

from refinitiv.data.discovery import Chain

import pandas as pd

import os



commodity_chain = "0#/NG+"


ric_chain = Chain(name = commodity_chain)

ric_list = ric_chain.constituents

print(ric_list)


target_chain = "0#/NGF24+"


options_contract = Chain(target_chain).constituents


clean_contracts = [s[1:] for s in options_contract]



df1 = rd.get_data(universe= clean_contracts,

fields= ["TR.SETTLEMENTPRICE","TR.IMPLIEDVOLATILITY"],

parameters={"SDate":"2023-10-25"})





df1 = rd.get_history(universe= clean_contracts,

fields= ["TR.SETTLEMENTPRICE","TR.IMPLIEDVOLATILITY"],

interval='1d',

start="2023-10-25",

end="2023-10-31")


rd.close_session()

```


However I am getting the below error when I run the code, I am not sure why.



RDError: Error code -1 | Insufficient scope for key=/data/datagrid/beta1/, method=POST failed.

Required scope: {'trapi.data.get.data.read'}

Missing scopes: {'trapi.data.get.data.read'}

Best Answer

Answers