Skip to content

Instantly share code, notes, and snippets.

@Chronophylos
Last active November 6, 2023 14:53
Show Gist options
  • Save Chronophylos/512675897009f26472dd3cfc6b6744cb to your computer and use it in GitHub Desktop.
Save Chronophylos/512675897009f26472dd3cfc6b6744cb to your computer and use it in GitHub Desktop.
Doc for gql.twitch.tv

gql.twitch.tv

All Requests seem to be POST request. All request go to https://gql.twitch.tv/gql.

Authentication

Authentication is done with headers. You'll need a Client ID and a OAuth token.

Available Scopes are:

scope description
chat_login (Deprecated — cannot be requested by new clients.) Log into chat and send messages.
user_presence_friends_read Read current online friends?
user_read Read nonpublic user information, like email address.
user_subscriptions Read a user’s subscriptions.
channel_commercial Trigger commercials on channel.
channel_editor Write channel metadata (game, status, etc).
channel_feed_edit Add posts and reactions to a channel feed.
channel_feed_read View a channel feed.
channel_feed_report
channel_read Read nonpublic channel information, including email address and stream key.
collections_edit Manage a user’s collections (of videos).
communities_edit Manage a user’s communities.
communities_moderate Manage community moderators.
user_edit Manage a user object.
user_entitlements_read
user_follows_edit Manage a user's follows?
user_friends_edit Manage a user's friends?
user_friends_read Read a user's friends?
user_presence_edit Manage a users's online status?
user_subscriptions_edit Manage a users's subscriptions?

? means unconfirmed. These are also the scopes a token used on the website has.

Required Headers:

Client-Id: <client id>
Authorization: OAuth <token>

POST Data

[{
"operationName": <operation>,
"variables": {<variables>},
"extensions": {
    "perisistendQuery": {
        "version": 1,
        "sha256sum": "b78cdb8306c3b485be4493d6ebcd50143a28c7fbfc42bf2675cff40d9f8e2ca6"
    }
}}]

You can append multiple operations.

Operations

ViewerCardModLogsMessagesBySender

Get historical messages sent by a user in a channel. You need to be moderator in the channel for this.

Required Scopes

None? I dunno.

Variables

key type value
senderID number sender user id
channelLogin string channel login name
cursor string a cursor or null
includeAutoModCaughtMessages boolean whether to include messages caught by automod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment