Help with a script (multiple keyframes)

Hi, I need help with a script, to be honest my knowledge about scripting are 0…

I have multiple animated object that moves only in one axis, I need to set Y location every 20 frames, so manually the work is:

Select object A
select frame 0
location Y 10cm
insert keyframe
select frame 20
location Y 13cm
insert keyframe
select frame 40
location Y 22cm
insert keyframe
etc

This for thousands of times! (around 40 times for 30 objects), and the risk of making errors is enormous when you get tired.
What the script should do is speed up the process, for example, by inserting only the location Y the script should automatically set a keyframe every 20 frames, Maybe inserting the values in this format: 0 15 17 17 25
But even insert the value one at a time and press enter would speed up the process.

Any help is appreciated.