Instantiate GameObject while Camera Moving

Hello, I am working on my 2D game where I have my main camera moving horizontally from left to right. Instead of instantiate all game objects at the start of the scene, I want to spawn them as the camera moves close to their x positions.
I have a JSON like this to store the position of each GO that need to be spawned during runtime:

{
    "apple":{
        "xpos":13,
        "ypos":2
    },
    "banana":{
        "xpos":40,
        "ypos":2
    },
    "pear":{
        "xpos":25,
        "ypos":2
    }
}

Does anyone have a solution to trigger the instantiation when the camera’s x position is equal or greater than the x position of each of the items? Suppose the camera starts moving from a x position of 0. Thank you in advance!

foreach( var item in items)
{
  if (item.x < cameraRightPoint.x)
  {
    // TODO : instnatiate
  }
}

Do you mean putting a loop like this in the update?

You can put it wherever and whenever you want in order to consider those objects to see if they are ready to be spawned yet. Or you can sort them by position and then you only need to consider the current next object, knowing that all before it have been spawned, and all beyond it are not yet ready for spawning.