Twitch API2 | Rust library for talking with the new Twitch API aka. "Helix", TMI and more!
See documentation for more info.
You can see current unpublished docs here:
See examples for examples.
use twitch_api2:: { TwitchClient , helix:: channels:: GetChannelInformationRequest } ;
use twitch_oauth2:: { AccessToken , Scope , TwitchToken , tokens:: errors:: TokenError , UserToken , client:: reqwest_http_client} ;
#[ tokio:: main]
async fn main ( ) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync + ' static> > {
let client_id = twitch_oauth2:: ClientId :: new ( "validclientid" . to_string ( ) ) ;
let token = UserToken :: from_existing (
reqwest_http_client,
AccessToken :: new ( "mytoken" . to_string ( ) ) ,
None ,
)
. await ?;
let client: TwitchClient < reqwest:: Client > = TwitchClient :: default ( ) ;
let req = GetChannelInformationRequest :: builder ( )
. broadcaster_id ( "12826" )
. build ( ) ;
println ! ( "{:?}" , &client.helix.req_get( req, &token) .await ?.data.unwrap( ) .title) ;
Ok ( ( ) )
}
This crate aims to target
This crate should also be able to be used for
There are no current plans to support
Endpoint
✔ Check AutoMod Status
POST https://api.twitch.tv/helix/moderation/enforcements/status
✔ Get Banned Users
GET https://api.twitch.tv/helix/moderation/banned
✔ Get Banned Events
GET https://api.twitch.tv/helix/moderation/banned/events
✔ Get Moderators
GET https://api.twitch.tv/helix/moderation/moderators
✔ Get Moderator Events
GET https://api.twitch.tv/helix/moderation/moderators/events
Endpoint
✔ Start Commercial
POST https://api.twitch.tv/helix/channels/commercial
✔ Get Channel Information
GET https://api.twitch.tv/helix/channels
✔ Modify Channel Information
PATCH https://api.twitch.tv/helix/channels
Endpoint
🔨 Get Extension Analytics
GET https://api.twitch.tv/helix/analytics/extensions
🔨 Get Game Analytics
GET https://api.twitch.tv/helix/analytics/games
Endpoint
✔ Get Cheermotes
GET https://api.twitch.tv/helix/bits/cheermotes
✔ Get Bits Leaderboard
GET https://api.twitch.tv/helix/bits/leaderboard
Endpoint
🔨 Get Extension Transactions
GET https://api.twitch.tv/helix/extensions/transactions
Endpoint
🔨 Create Clip
POST https://api.twitch.tv/helix/clips
✔ Get Clips
GET https://api.twitch.tv/helix/clips
Endpoint
🔨 Create Entitlement Grants Upload URL
POST https://api.twitch.tv/helix/entitlements/upload
🔨 Get Code Status
GET https://api.twitch.tv/helix/entitlements/codes
🔨 Redeem Code
POST https://api.twitch.tv/helix/entitlements/code
Endpoint
✔ Get Top Games
GET https://api.twitch.tv/helix/games/top
✔ Get Games
GET https://api.twitch.tv/helix/games
Endpoint
✔ Search Categories
GET https://api.twitch.tv/helix/search/categories
✔ Search Channels
GET https://api.twitch.tv/helix/search/channels
Endpoint
🔨 Get Stream Key
https://api.twitch.tv/helix/streams/key
✔ Get Streams
GET https://api.twitch.tv/helix/streams
🔨 Create Stream Marker
POST https://api.twitch.tv/helix/streams/markers
🔨 Get Stream Markers
GET https://api.twitch.tv/helix/streams/markers
✔ Get Stream Tags
GET https://api.twitch.tv/helix/streams/tags
🔨 Replace Stream Tags
PUT https://api.twitch.tv/helix/streams/tags
Endpoint
✔ Get Broadcaster Subscriptions
GET https://api.twitch.tv/helix/subscriptions
Endpoint
✔ Get All Stream Tags
GET https://api.twitch.tv/helix/tags/streams
Endpoint
✔ Create User Follows
POST https://api.twitch.tv/helix/users/follows
✔ Delete User Follows
DELETE https://api.twitch.tv/helix/users/follows
✔ Get Users
GET https://api.twitch.tv/helix/users
✔ Get Users Follows
GET https://api.twitch.tv/helix/users/follows
🔨 Update User
PUT https://api.twitch.tv/helix/users
🔨 Get User Extensions
GET https://api.twitch.tv/helix/users/extensions/list
🔨 Get User Active Extensions
GET https://api.twitch.tv/helix/users/extensions
🔨 Update User Extensions
PUT https://api.twitch.tv/helix/users/extensions
Endpoint
✔ Get Videos
GET https://api.twitch.tv/helix/videos
Endpoint
🔨 Get Webhook Subscriptions
GET https://api.twitch.tv/helix/webhooks/subscriptions
Endpoint
🔨 Get Hype Train Events
GET https://api.twitch.tv/helix/hypetrain/events
Endpoint
✔ Get Chatters
https://tmi.twitch.tv/group/user/{broadcaster}/chatters
✔ Get Hosts
https://tmi.twitch.tv/hosts
Endpoint
Topic
🔨 Bits V1
channel-bits-events-v1.<channel ID>
✔ Bits V2
channel-bits-events-v2.<channel ID>
✔ Bits Badge Notificaton
channel-bits-badge-unlocks.<channel_id>
✔ Channel Points
channel-points-channel-v1.<channel_id>
✔ Channel Subscriptions
channel-subscribe-events-v1.<channel ID>
✔ Chat Moderator Actions
chat_moderator_actions.<channel ID>
✔ Chat Moderator Actions (undocumented)
chat_moderator_actions.<channel ID>.<user_id>
🔨 Whispers
whispers.<user ID>
✔ Channel Cheer Events
channel-cheer-events-public-v1.<user ID>
✔ Channel Sub Gifts V1
channel-sub-gifts-v1.<user ID>
✔ Following
following.<user ID>
✔ Hype Train Events V1
hype-train-events-v1.<user ID>
✔ Hype Train Events V1 Rewards
hype-train-events-v1.<user ID>
✔ Raid
raid.<user ID>
✔ Video Playback
video-playback.<username>
✔ Video Playback By ID
video-playback-by-id.<user ID>
Licensed under either of Apache License, Version
2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.