Changing only one axis location

hi there

i have autogenerated a bunch of objects that are to the right of the camera.
i want to code them to change location to the centre of the camera in a staggered order.

i think i can input keyframes when the items are at different locations using a loop involving something like

bpy.data.objects[start + str(x).zfill(3)].keyframe_insert(data_path="cube")

but im wondering how i move each object on one axis only

do i have to read the location of each object and then send it back or can i change only the x axis for example?

.keyframe_insert(data_path='location', index=1)

This inserts keyframe for location y