Check products from a live database

There is an external database with a list of products, I would like to implement this updated list in my function.
Any idea how I can achieve this, knowing that this list is subject to change at any time.