Email alert with wp_cron and wp_mail if new data (external API) – Pseudo code

My problem is that I don’t know how and where to stock the previous
list of movies? I thought about a global variable that I could call in
the function but from what i red so far, it seems that it is always
better to avoid global variable? Also I don’t know if it is possible
to update the global variable for the next task.

You better use a persistent memory, because your variable will die when a PHP script finishes its work. So you can store the old list somewhere in the database or in a special file.