I know I can use the file permissions to see with who a file was shared with, but how can use the api to find who was the user that shared the file?
You cant. When a file is shared who did the sharing is not abaliable.
Anyone with access to the file can technically share it. There are a few exceptions with who you can share a file to if the file is part of a domain or a group.
So there is really no way of knowing who did the sharing.
this is true with both the google drive web app and with the api.