How to retrieve last subs actually in Twitch API?

Regardless of how you build the thing.

A persistent data storage would be optimal.

So that if the thing has to restart for whatever reason data is not lost whilst restarting. (OBS crashing, need to restart as the connection is being screwy etc)

A remote server that is web accessable behind SSL would be able to be online 99.9% and collect data as needed whether that is from any of the three soluitions/sources.

That is the optimal approach a server does the heavy lifting. And your thing just processes information from the server

For this you don’t need to know the last three subs, you just need to collect them in real time from one of the real time sources.

Since the API doesn’t tell you when a given user (re)subbed.

Twitch API: You call the Twitch API to get data.

EventSub: Twitch calls you (via HTTPS POST) with data when data occurs

Chat/PubSub: You connect to a socket, Twitch sends you data when data occurs

EventSub/Chat/PubSub: all trigger data when data occurs, the only difference is the delivery system.