How to know which "stream/segment" is live?

For an “eventsub only” solution"

The order of operations is this

  • streamer, before going live, will change the title (and/or category) - this raises a channel.update event
  • you collect the title and category from this message and store it
  • the streamer (later) goes live triggering a stream.online
  • you use the previously collected title/game to do whatever you need

then during a strimg the streamer may

  • change the title (and/or category) - this raises a channel.update event

You know the streamer is already live from the earier stream.online event retained in your system

later

  • the streamer ends the stream and this sends a stream.offline event

So this would involve retaining “state”.
But if you can’t retain state then yes you would call the API after you get a stream.online event