You can use the method projects.serviceAccounts.list
from the Cloud IAM API which:
Lists the ServiceAccounts for a project
Try it in this link:
https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/list
On the right side of the page you will see a Try this API. In the name field, input your project name this way:
projects/my-project-name
And the output will be a json similar to this:
{
"accounts": [
{
"name": "projects/my-project-name/serviceAccounts/my-project-name@appspot.gserviceaccount.com",
"projectId": "my-project-name",
"uniqueId": "111111111111111111111",
"email": "my-project-name@appspot.gserviceaccount.com",
"displayName": "App Engine app default service account",
"etag": "abcdefghi="
},
////
{
"name": "projects/my-project-name/serviceAccounts/some-account-name@my-project-name.iam.gserviceaccount.com",
"projectId": "my-project-name",
"uniqueId": "222222222222222222222",
"email": "some-account-name@my-project-name.iam.gserviceaccount.com",
"displayName": "some-account-name",
"etag": "abcdefghi=",
"oauth2ClientId": "333333333333333333333"
}
]
}