Find step difference of row values

Am getting values from API in rows, i want to find the difference value of each row. for example I want column B, 2nd row of which display the difference of row 2- row1 of column A, 3rd row display difference of row3 - row 2

What ia your data source

am using API which gets data from our db postgres db