R wrapper for the Twitch API.
http://localhost
.Renviron
to add these valuesusethis::edit_r_environ()
in the RStudio R consoleTWITCH_CLIENT_ID=YOUR CLIENT ID
TWITCH_SECRET=YOUR SECRET
Read about getting authorization tokens here.
Get auth token by using twitch_auth()
. This will be appended to future API calls
Look up a user by their display name to get user information. This is userful to obtain broadcaster_id
for other functions
user <- get_users(login = "KowAndToilet")
user
#> # A tibble: 1 x 10
#> id login display~1 type broad~2 descr~3 profi~4 offli~5 view_~6
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <int>
#> 1 613890167 kowandtoilet kowandto~ "" affili~ Kyle a~ https:~ https:~ 4989
#> # ... with 1 more variable: created_at <dttm>, and abbreviated variable names
#> # 1: display_name, 2: broadcaster_type, 3: description, 4: profile_image_url,
#> # 5: offline_image_url, 6: view_count
#> # i Use `colnames()` to see all variable names
Display who is currently in a broadcasters chat
chatters <- get_chatters("KowAndToilet")
I have covered most of the Twitch API endpoints which can be viewed here. If there are any you would like added please create an issue! :)