Dear LSEG Developer Community,
I am encountering an "insufficient scope" error when using the LSEG Data Library for Python (version 2.1.1) to retrieve snapshot pricing data for EUR= and GBP= via ld.get_data. Despite successful authentication and session opening, the request fails with a 403 Forbidden error due to missing the trapi.streaming.pricing.read scope. I would appreciate your guidance on resolving this issue.
Environment
- LSEG Data Library: 2.1.1
- Python: 3.12.3
- OS: Linux (Ubuntu)
- Configuration: Using platform.rdp session with lseg-data.config.json
- Client ID: [MASKED]
Source Code
Below is the Python script (test_jpy.py) I am running, based on LD Lib. Python Tutorial 3 - get_data.ipynb:
Error Log
Here is the relevant error output from the latest run (sensitive information masked):
textCopyOpening session...[2025-05-11T02:56:16.019846+08:00] - [DEBUG] - [ld] - [132973301784704] | MainThreadLD version is 2.1.1; Python version is 3.12.3[2025-05-11T02:56:16.071211+08:00] - [DEBUG] - [ld] - [132973301784704] | MainThreadRead configs: /home/ian/rdp_v2_project/lseg-data.config.json, /home/ian/lseg-data.config.json[2025-05-11T02:56:17.011363+08:00] - [DEBUG] - [sessions.platform.rdp.0] - [132973027874496] | AuthManager-ThreadHTTP Response id 0 status_code = 200 text = { "expires_in":7199, "token_type":"Bearer", "access_token":"[MASKED]"}[2025-05-11T02:56:17.030189+08:00] - [DEBUG] - [sessions.platform.rdp.0] - [132973301784704] | MainThreadOpened sessionSession opened successfully.Fetching data for EUR= and GBP=...[2025-05-11T02:56:18.122872+08:00] - [DEBUG] - [sessions.platform.rdp.0] - [132972705924800] | OpenUniverseStreams-Thread_0HTTP Response id 1 status_code = 403 text = {"error":{"id":"9a1ea292-7db7-497f-983c-b9674afa8d65","code":"insufficient_scope","message":"access denied. Scopes required to access the resource: [trapi.streaming.pricing.read]. Missing scopes: [trapi.streaming.pricing.read]","status":"Forbidden"}}[2025-05-11T02:56:18.135051+08:00] - [DEBUG] - [sessions.platform.rdp.0] - [132973301784704] | MainThreadFailure retrieving data for ['EUR=', 'GBP=']: Insufficient scope for key=/streaming/pricing/v1/, method=GET.Required scopes: {'trapi.streaming.pricing.read'}Available scopes: {}Missing scopes: {'trapi.streaming.pricing.read'}An error occurred: Insufficient scope for key=/streaming/pricing/v1/, method=GET.Required scopes: {'trapi.streaming.pricing.read'}Available scopes: {}Missing scopes: {'trapi.streaming.pricing.read'}Closing session...Session closed.
Issue Description
- Problem: The script fails at ld.get_data with a 403 Forbidden error, indicating that my account lacks the trapi.streaming.pricing.read scope required for the /streaming/pricing/v1/ endpoint.
- Observations:
- Authentication succeeds, and the session opens correctly.
- The error occurs when requesting pricing data for EUR= and GBP= with fields BID and ASK.
- Previous attempts with other RICs (e.g., JPY=) yielded the same error.
- Multiple config files are loaded (/home/ian/rdp_v2_project/lseg-data.config.json and /home/ian/lseg-data.config.json), which may cause conflicts.
- Previous Attempts:
- Verified lseg-data.config.json with signon_control: true.
- Updated lseg-data to 2.1.1 and fixed setuptools warnings.
- Syntax errors (e.g., unclosed lists, try-except issues) were resolved based on Pylance feedback.
Questions
- How can I obtain the trapi.streaming.pricing.read scope for my account? Do I need a specific subscription for real-time forex data (EUR=, GBP=)? Whom should I contact to update my account permissions?
- Is there a workaround to retrieve BID and ASK for EUR= and GBP= without this scope (e.g., using historical pricing or another endpoint)?
- Does lseg-data 2.1.1 support the Pricing interface for streaming data? If so, what is the correct import path (e.g., lseg.data.streaming.Pricing)?
- Could the multiple config files cause this issue? Should I remove /home/ian/lseg-data.config.json?