Phyton formula to get data for future contracts both active and expired. ie ESU25, ESU24^2

Options

I am attempting to do that I hope you can provide guidance on. This will all be done using Python, which it is good to go. As an example, we can focus on the S&P E-mini (ES).
1) Is there a way to get all contracts for a future instrument? For example, expired, active, and future contracts.
2) Once we get the contracts, is there a way to get the last price for those contracts from first trade date to last trade date/ latest?
3) For the same contracts, is there a way to pull security masters information such as expiry date, first notice date, contract size, etc.