question

Upvotes
Accepted
1 0 0 0

Python Refinitiv module missing scope

Im working on retrieving Refinitiv data using my local Python IDE.


I managed to install the refinitiv module and configure a json file - but some scope is missing:


What is the problem here?


Python code:


import os
import refinitiv.data as rd

os.environ["RD_LIB_CONFIG_PATH"] = "[Local Path]"
rd.open_session()
df = rd.get_data(universe ='EUR=',fields = 'BASE_CCY')

Error message:

Traceback (most recent call last):

File "C:\Users\jesv\AppData\Roaming\JetBrains\PyCharmEdu2022.2\scratches\Refinitiv.py", line 21, in <module>

df = rd.get_data(universe ='EUR=',fields = 'BASE_CCY')

File "C:\Users\jesv\PycharmProjects\pythonProject\lib\site-packages\refinitiv\data\_access_layer\get_data_func.py", line 126, in get_data

raise RDError(-1, except_msg)

refinitiv.data._errors.RDError: Error code -1 | Error code -1 | Insufficient scope for key=/streaming/pricing/v1/, method=GET.

Required scopes: {'trapi.streaming.pricing.read'}

Available scopes: {'trapi.alerts.preferences.crud', 'trapi.alerts.history.crud', 'trapi.data.historical-pricing.summaries.read', 'trapi.synthetic.crud', 'trapi.search.explore.read', 'trapi.user-framework.recently-used.crud', 'trapi.user-framework.application-metadata.raplib', 'trapi.searchcore.read', 'trapi.streaming.prcperf.read', 'trapi.user-framework.mobile.crud', 'trapi.data.get.data.read', 'trapi.user-framework.workspace.crud', 'trapi.search.lookup.read', 'trapi.frtb.sentimarization', 'trapi.searchcore.metadata.read', 'trapi.searchcore.lookup.read', 'trapi.streaming.synthetic.read', 'trapi.alerts.publication.crud', 'trapi.sdbold', 'trapi.graphql.subscriber.access', 'trapi.auth.cloud-credentials', 'trapi.alerts.subscription.crud', 'trapi.search.read', 'trapi.data.quantitative-analytics.read', 'trapi.data.historical-pricing.events.read', 'trapi.search.metadata.read'}

Missing scopes: {'trapi.streaming.pricing.read'}



Json file:


Note: I havent filled "url" : "YOUR DEPLOYED HOST:PORT GOES HERE!" or "username" : "YOUR DACS ID GOES HERE!",

{

"logs": {

"level": "debug",

"transports": {

"console": {

"enabled": false

},

"file": {

"enabled": false,

"name": "refinitiv-data-lib.log"

}

}

},

"sessions": {

"default": "platform.rdp",

"platform": {

"rdp": {

"signon_control":true,

"app-key": "[My_KEY]",

"username": "[My_user_name]",

"password": "[My_password]"

},

"deployed": {

"app-key":"[My_KEY]",

"realtime-distribution-system": {

"url" : "YOUR DEPLOYED HOST:PORT GOES HERE!",

"dacs" : {

"username" : "YOUR DACS ID GOES HERE!",

"application-id" : 256,

"position" : ""

}

}

}

},

"desktop": {

"workspace": {

"app-key": "[My_KEY]"

}

}

}

}






#productapi
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.

Any comment here please :)
Any comment here - please :)

1 Answer

· Write an Answer
Upvotes
Accepted
83.1k 281 53 77

@thel

Thank you for reaching out to us.

The message indicates that your account doesn't have permission to access the streaming pricing service.

Missing scopes: {'trapi.streaming.pricing.read'}

The library gets the data of the real-time fields (no TR. prefixed) from the streaming pricing service.

Please contact your Refinitv account team or sales team to verify the permission.

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.

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.