Eikon Python Data API migration to lseg-data. get_history() request empty result

igorg
igorg Advocate
edited April 10 in Eikon Data APIs

Hello,

The second problem with get_history(): sometimes, for some requests the function returns nothing. Empty DataFrame. There is no way to get any details on what happened.

The behavior is not consistent. Right now I see an empty DataFrame for this request:

dataFrame = ld.get_history(            universe= ["INDJ25"],            fields=['ACVOL_UNS', 'OPEN_PRC', 'TRDPRC_1', 'HIGH_1', 'LOW_1'],            start="2025-04-08",            end="2025-04-09",            interval="1D",            header_type=ld.HeaderType.NAME)

The logs:

HTTP Request id 2
url = http://localhost:9000/api/rdp/data/historical-pricing/v1/views/interday-summaries/INDJ25?interval=P1D&start=2025-04-08T00%3A00%3A00.000000000Z&end=2025-04-09T00%3A00%3A00.000000000Z&fields=ACVOL_UNS%2COPEN_PRC%2CTRDPRC_1%2CHIGH_1%2CLOW_1%2CDATE

HTTP Response id 2
status_code = 200
text = [{"universe":{"ric":"INDJ25"},"interval":"P1D","summaryTimestampLabel":"endPeriod","adjustments":["exchangeCorrection","manualCorrection","CCH","CRE","RTS","RPO"],"defaultPricingField":"SETTLE","qos":{"timeliness":"delayed"},"headers":[{"name":"DATE","type":"string"},{"name":"TRDPRC_1","type":"number","decimalChar":"."},{"name":"OPEN_PRC","type":"number","decimalChar":"."},{"name":"HIGH_1","type":"number","decimalChar":"."},{"name":"LOW_1","type":"number","decimalChar":"."},{"name":"ACVOL_UNS","type":"number","decimalChar":"."}],"data":[]}]

print(dataFrame) returns:

Empty DataFrame
Columns: []
Index: []

First question is: why no data in http response?

Second: why dataFrame is empty? How can I recognize that the response was good or bad if nothing is returned?

The example of "bad" request : if I include 'VWAP' in the requested fields, the log shows

"status":{"code":"TSCC.QS.UserRequestError.90006","message":"The universe does not support the following fields: [VWAP]."}}

but the dataFrame is empty. And I don't see a way to extract this info.

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @igorg

    Thank you for reaching out to us.

    It may relate to this question.

    Please try this one.

    response1 = historical_pricing.summaries.Definition(
        "INDJ25", 
        interval=Intervals.DAILY,    
        start = '2025-04-09', 
        end = '2025-04-10',
        fields=['ACVOL_UNS', 'OPEN_PRC', 'TRDPRC_1', 'HIGH_1', 'LOW_1'],
        extended_params={"summaryTimestampLabel":"startPeriod"}
    ).get_data()
    response1.data.df
    
    image.png
  • igorg
    igorg Advocate

    Thank you for your response. I will test this more and let you know. I created 2 different posts because I saw this as 2 separate problems. I will post an update later.