Build Communities with the Twitch API
With the launch of Communities, streamers can reach the most relevant audiences, and viewers will discover and engage with new content they love. In conjunction with the official announcement, the Twitch developer APIs are receiving a new set of endpoints to programmatically make use of Communities.
To get started, see the Communities API reference. The API offers the standard operations you would expect (e.g. create, update, delete), as well as commands to manage moderators, a ban list, and timed-out users. Authentication to these endpoints are required as they manipulate data.
There are a handful of commands that do not require authentication. These include retrieving a Community by name and retrieving a list of the top communities. Here’s an example call and response for the latter.
{% raw %}
$ curl -H ‘Client-ID: uo6dggojyb8d6soh92zknwmi5ej1q2’ \
-H ‘Accept: application/vnd.twitchtv.v5+json’ \
-X GET ‘https://api.twitch.tv/kraken/communities/top'
{% endraw %}
{% raw %}
{
“_total”: 100,
“_cursor”: “MTA=”,
“communities”: [
...
{
“_id”: “1cf7bf9d-2e2b-4552–8d8e-4c028f44d11f”,
“name”: “crochet”,
“viewers”: 0,
“channels”: 0,
“avatar_image_url”: “https://static-cdn.jtvnw.net/twitch-community-images-production/defaults/avatar.png"
},
...
]
}
{% endraw %}
We look forward to hearing how you take advantage of Communities in your development. Share your work with us by mentioning @TwitchDev on Twitter! And as always, if you have any questions about how to use the Communities API, feel free to post on the Twitch Developers forums.