Apologies, this is a basic question. I've been through the various tutorials/trial and error on accessing the API with no joy. I believe I may be close but it's not quite working. Any help/guidance much appreciated. Thank you. Rob
Background
I'm using LSEG workspace.
My Data API proxy is showing as Ready. Version 3.6.6. Localhost is 9001 (rather than 9000 which seems to be mentioned a lot).
I am using Python 3.10 with VSC and Jupyter.
What I've done
I have imported refinitiv.data successfully:
import refinitiv.data as rd
I have a version after having used an app_key:
rd.open_session()print(rd.__version__)
1.6.2
The app_key output is as follows which I think is in order but not totally sure.
# Initialize the session
rd.open_session( app_key='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' )
<refinitiv.data.session.Definition object at 0x107b82c4250 {name='workspace'}>
The problem/error/issue
However, when I try to run something very basic it takes a while (c.45s then errors). So e.g.
df = rd.get_data(
universe = ['GB10YT=RR'],
fields = ['CF_CLOSE'])
display(df)
{
"name": "RDError",
"message": "Error code -1 | Cannot prepare connection OMMStreamConnection
\t\tname : ThreadOMMSTREAMING_PRICING_0.4
\t\tstate : StreamCxnState.Disposed
\t\tsubprotocol : tr_json2
\t\tis_auto_reconnect: True
\t\tcan_reconnect : False
\t\tnum_attempt : 0",
"stack": "---------------------------------------------------------------------------
RDError Traceback (most recent call last)
Cell In[10], line 1
----> 1 df = rd.get_data(
2 universe = ['GB10YT=RR'],
3 fields = ['CF_CLOSE']
4 )
6 display(df)
File ~\AppData\Roaming\Python\Python310\site-packages\refinitiv\data\_access_layer\get_data_func.py:126, in get_data(universe, fields, parameters, use_field_names_in_headers)
124 if exceptions and all(exceptions):
125 except_msg = "".join(exceptions)
--> 126 raise RDError(-1, except_msg)
128 hp_and_cust_inst_data = HPAndCustInstDataContainer(stream_columns, stream_data, stream_df)
129 adc_data = ADCDataContainer(adc_raw, adc_df, fields)
RDError: Error code -1 | Cannot prepare connection OMMStreamConnection
\t\tname : ThreadOMMSTREAMING_PRICING_0.4
\t\tstate : StreamCxnState.Disposed
\t\tsubprotocol : tr_json2
\t\tis_auto_reconnect: True
\t\tcan_reconnect : False
\t\tnum_attempt : 0"
}