Use the API to find a username based on an email?

There is nothing magical here, just do the action in your admin web UI and watch the f12 network console in the browser. Those are the API calls necessary.