Using the following script:
import lseg.data as ld
from datetime import datetime
import pytz
import pandas as pd
ld.open_session()
# Define the EST and UTC timezones
est = pytz.timezone('US/Eastern')
utc = pytz.utc
# Create a datetime object in EST
est_time = est.localize(datetime(2025, 11, 5, 16, 50, 0)) # Year, Month, Day, Hour, Minute, Second
# Convert to UTC
utc_time = est_time.astimezone(utc)
RIC = "AUD1MOIS="
df_utc = ld.get_history(universe=RIC, fields="BID", end = utc_time, interval="1min", count = 1).reset_index()
df_utc['Timestamp'] = pd.to_datetime(df_utc['Timestamp']).dt.tz_localize('UTC')
df_utc['Timestamp_EST'] = df_utc['Timestamp'].dt.tz_convert('US/Eastern')
new_df = df_utc[['Timestamp_EST','BID']]
new_df
Getting error below:
"""LDError: Insufficient scope for key=/data/historical-pricing/v1/views/intraday-summaries/{universe}, method=GET.
Required scopes: {'trapi.data.historical-pricing.summaries.read'}
Available scopes: {}
Missing scopes: {'trapi.data.historical-pricing.summaries.read'}
"""
I tried it using both a platform session with my client_id and client_secret from RTO, and my Workspace Eikon Data API app-key.
Please advise how to solve this. Thank you.