lseg.data for specific futures contracts

I am converting some older python coding from your eikon API to lseg.data. When I run this script for a continuous future series (such as 'Cc1' for corn) it works as expected and I can access years of historical data. However, when I run the same script for a specific futures contract, I can only get historical data going back 30 days. I'm not really sure where I'm going wrong. I appreciate your help. —Kevin

import lseg.data as ld

ld.open_session()

test = ld.get_history('CK25', start='2024-01-01', interval='daily')

test2 = ld.get_history('CH25', start='2024-01-01', interval='daily')

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @kevin_witt

    Thank you for reaching out to us.

    You can specify the end or count parameter.

    test = ld.get_history('CK25', start='2024-01-01', interval='daily', end='2025-02-25')
    
    test2 = ld.get_history('CH25', start='2024-01-01', interval='daily', count=300)
    
  • kevin_witt
    kevin_witt Newcomer

    This works, thank you.