If you can go through this page I believe you will find an api that looks like: await octokit.request('GET /repos/{owner}/{repo}/commits/{ref}'.
I believe we can fetch the lines added and deleted using this but we have to figure out the {ref} part in the api.
The API I used is not fetching lines added and deleted. There is a similar API for commits in the GitHub api documentation: https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28
If you can go through this page I believe you will find an api that looks like: await octokit.request('GET /repos/{owner}/{repo}/commits/{ref}'. I believe we can fetch the lines added and deleted using this but we have to figure out the {ref} part in the api.