API request through home assistant

Is it possible to call the API and find out what the next programme that is next on the current channel but use the REST function in home assistant?

I want to make a picture elements card showing current programme and next.

Many thanks

Maybe the following will get you started.

I played around a little bit with Python and will give some ideas what to look for.

>>> g = requests.get('http://192.168.4.2:8089/devices/ANY/guide').json()

>>> g[0]['Channel']
{'CallSign': 'WCBSDT', 'Categories': ['directv'], 'ChannelID': 'CBS-WCBS', 'DeviceID': 'M3U-DirecTVStreamTuner', 'Favorite': True, 'Genres': [], 'HD': True, 'Hidden': False, 'Image': 'https://raw.githubusercontent.com/tv-logo/tv-logos/main/countries/united-states/us-local/cbs-2-wcbs-us.png', 'Name': 'CBS', 'Number': '2', 'Station': '16689', 'Tags': []}

>>> g[0]['Channel']['Number']
'2'

>>> current_program = g[0]['Airings'][0]['Title']
>>> current_program
'Entertainment Tonight'

>>> next_program = g[0]['Airings'][1]['Title']
>>> next_program
'FBI'

This is great! :slight_smile: Thanks for replying so quickly. I'll have a play with it later. Much apprenticed.