GraphQL
Experimental / Unofficial
The GraphQL API is as unofficial as it can be. It only works by emulating the twitch website (clientId
and accessToken
matching the clientId
of the twitch site itself).
Therefore you need to use the client id of the twitch site and a auth token of the twitch site - a self generated token will not work.
Twitch's GraphQL API is not intended for third-party use, is not officially documented, and is not officially supported. Use at your own risk.
Twitch deployed additional restrictions to GraphQL in September 2022 that has broken most mutations. Some queries that don't require authentication may continue to function.
As Module: Twitch4J
To use GraphQL you need to enable the GraphQL Module when building the Twitch4J Instance, as shown below:
- Java
- Kotlin
- Groovy
TwitchClient twitchClient = TwitchClientBuilder.builder()
...
.withEnableGraphQL(true)
...
.build();
val twitchClient = TwitchClientBuilder.builder()
...
.withEnableGraphQL(true)
...
.build()
def twitchClient = TwitchClientBuilder.builder()
...
.withEnableGraphQL(true)
...
.build()
Standalone
Initialize the GraphQL as Standalone Module:
- Java
- Kotlin
- Groovy
TwitchGraphQL client = TwitchGraphQLBuilder.builder().build();
val client = TwitchGraphQLBuilder.builder().build()
def client = TwitchGraphQLBuilder.builder().build()
API Methods
User: