Get Hosts of target channel
Description
This endpoint returns a "host" record for each channel hosting the channel with the provided targetId. It does not return the login of the target, only of the hosts. Therefore getTargetLogin will return null for each Host in HostList.getHosts().
warning
Twitch removed host mode in October 2022, rendering this endpoint as decommissioned.
Method Definition
@RequestLine("GET /hosts?include_logins=1&target={id}")
HystrixCommand<HostList> getHostsOf(
@Param("id") String targetId
);
Required Parameters
Name | Type | Description |
---|---|---|
targetId | text | The user ID of the channel for which to get host information. |
Optional Parameters
None
Code-Snippets
print who is hosting a channel
- Java
- Kotlin
- Groovy
HostList hosts = twitchClient.getMessagingInterface().getHostsOf("29829912").execute();
hosts.getHosts().forEach(host -> {
System.out.println(host.getHostDisplayName());
});
val hosts = twitchClient.messagingInterface.getHostsOf("29829912").execute()
hosts.hosts.each { host ->
println(host.hostDisplayName);
}
def hosts = twitchClient.messagingInterface.getHostsOf("29829912").execute()
hosts.hosts.each { host ->
System.out.println(host.hostDisplayName);
}