API: get username from email

I’m trying to find which API can be used to get username from the email address.

This one works fine:

However, it works only when logged in.

Anyone has any idea if there is any API which sends back username from the provided email?