Also, take a look at ib_insync. While Python, it's very simple without callbacks, so perfect for beginners. They have an example on that page to do exactly what you wanted.
Can you share how you download say historical 5minute intraday prices for SPX constituents? That would be very helpful.