Can the API be used to set/unset host mode and if so how?

Just spit balling here, but I’m 99% sure API is read only for end users. So you can not change a setting in it remotely. What I would probably do is make something, like a PHP IRC bot or something that queries the API for your (the host) oauth token, connect to the chat and send a host command. Maybe make a list of streamers to check if they are live, and then based on the order the list is, the first one it finds online, when you are offline, do the host command. Then add it to like a crontab that checks if your stream is live every 5-10 minutes. Voila.