Is there a way to uniquely identify the current stream?

Basically I need to save some data that needs to remain the same for the entire stream, but it should be updated on a new stream.

My idea was to somehow get an ID of the current stream and then compare it with the saved one, but from what I seen there isn’t an API that does that. Is there another way to identify the current stream?

get streams data[0]->id not sufficent?

barrycarlyon@Mac ~ % twitch api get 'streams?user_login=cohhcarnage'
{
  "data": [
    {
      "game_id": "344035090",
      "game_name": "Kingdom Come: Deliverance II",
      "id": "318736008317",
      "is_mature": false,
      "language": "en",
      "started_at": "2025-03-12T11:59:19Z",
      "tag_ids": [],
      "tags": [
        "SFW",
        "Parent",
        "Chill",
        "ADHD",
        "moderated",
        "NoPolitics",
        "NoReligion",
        "Interactive",
        "Overencumbered",
        "LootGoblin"
      ],
      "thumbnail_url": "https://static-cdn.jtvnw.net/previews-ttv/live_user_cohhcarnage-{width}x{height}.jpg",
      "title": "Peasant Dad plays KCD2! \\o/ - Cohh is !Sick cohhFeels - !Cohhvatars / !Emberville / !Wartorn",
      "type": "live",
      "user_id": "26610234",
      "user_login": "cohhcarnage",
      "user_name": "CohhCarnage",
      "viewer_count": 1324
    }
  ],
  "pagination": {
    "cursor": "eyJiIjp7IkN1cnNvciI6ImV5SnpJam94TXpJMExqTTJNemswT0RRM01USXpNRFVzSW1RaU9tWmhiSE5sTENKMElqcDBjblZsZlE9PSJ9LCJhIjp7IkN1cnNvciI6IiJ9fQ"
  }
}

So 318736008317 for the current stream of cohhcarnage if say I wanted to collate subs in real time to said stream.

This won’t match to a Vod.

I can’t correlate cohh to a vod as cohh’s vods don’t exist

barrycarlyon@Mac ~ % twitch api get 'videos?user_id=26610234&type=archive&first=1'
{
  "data": [
    {
      "created_at": "2025-01-28T12:44:33Z",
      "description": "",
      "duration": "3h49m42s",
      "id": "2365882528",
      "language": "en",
      "muted_segments": null,
      "published_at": "2025-01-28T12:44:33Z",
      "stream_id": "315292052477",
      "thumbnail_url": "https://static-cdn.jtvnw.net/cf_vods/d1m7jfoe9zdc1j/60b9960e73ea55ad8d9f_cohhcarnage_315292052477_1738068267//thumb/thumb0-%{width}x%{height}.jpg",
      "title": "Eternal Strands (Full release!) - !KCD2 Waiting Room! \\o/ - !Wartorn / !Cohhvatars / !Emberville",
      "type": "archive",
      "url": "https://www.twitch.tv/videos/2365882528",
      "user_id": "26610234",
      "user_login": "cohhcarnage",
      "user_name": "CohhCarnage",
      "view_count": 167391,
      "viewable": "public"
    }
  ],
  "pagination": {
    "cursor": "eyJiIjpudWxsLCJhIjp7Ik9mZnNldCI6MX19"
  }
}

Otherwise recieve stream start.
Then look in vods and get the most recent archive and check if it’s similar start time

Which you can see failed here as cohh’s vods are hidden

oh, so get streams data[0]->id is the id of the on going stream. I thought it was the id of the latest vod.
If that’s the case then my problem is resolved. Thank you very much

Get Streams has an ID that isn’t used anywhere else and only exists as a thing until the end of the stream.

But seems to fit you needs

Generally for something like a “Credits reel” I just collect data into a list until I get a stream offline then nuke the list.

And is there a way to get the Id or the username of the broadcaster that has installed the extension?

thats in the onAuthorized callback - Extensions Reference | Twitch Developers

Also encoded within the JWT - Extensions Reference | Twitch Developers