You can use the streams endpoint https://dev.twitch.tv/docs/api/reference/#get-streams
The stream object contains a started_at field which is the timestamp of when the stream started, you can calculate the duration from that.
You can use the streams endpoint https://dev.twitch.tv/docs/api/reference/#get-streams
The stream object contains a started_at field which is the timestamp of when the stream started, you can calculate the duration from that.