Check the existence of a Prestashop product in an API result

Hello, I have already consulted several topics that address more or less what I am trying to do but I have not really seen a topic that talks about my case, because I have to work with an API result that loops because of a result limit of 50 lines per request.

In my scenario, I receive from the “Shippingbo” module an API response on which I loop on several pages.

I want to make sure that if a product does not exist on this module, then I create it (I will take care of this part later). I am having difficulty checking the SKUs existing on Prestashop to see if they exist in my Shippingbo API, am I going in the right direction?

Here the array aggregators are mainly used to see if I get the desired result, I will replace them with the actions according to the case. But maybe there are optimizations that I can make?

Many thanks !