Google App Script - saving data from API to sheet with for function

I’m doing a small JS project as Google App Script where I call an API to send data from a Google Sheet column and return data into a different column of the same sheet.

I’m fine with calling the API and returning data, however I’m struggling to use the for function to send data from the next row and setValue to the corresponding next row. I suspect it involves some sort of nesting.

Input data is in column 10, starting at row 2 and output data should go into column 9, starting at row 2 as well.

I’m currently into the front-end with react course and really trying to put learned lessons into practice.