Make a request to https://api.twitch.tv/kraken/channels/user_to_test.
If the user exists, you’ll get a whack of data about them:
{
"name": "user_to_test",
"game": "Dark Souls II",
"created_at": "2011-02-24T01:38:43Z",
"title": "user_to_test",
"updated_at": "2012-06-18T05:22:53Z",
"banner": "http://static-cdn.jtvnw.net/jtv_user_pictures/user_to_test-channel_header_image-7d10ec1bfbef2988-640x125.png",
"video_banner": "http://static-cdn.jtvnw.net/jtv_user_pictures/user_to_test-channel_offline_image-bdcb1260130fa0cb.png",
"background": "http://static-cdn.jtvnw.net/jtv_user_pictures/user_to_test-channel_background_image-eebc4eabf0686bb9.png",
"_links": {. . .},
"logo": "http://static-cdn.jtvnw.net/jtv_user_pictures/user_to_test-profile_image-7243b004a2ec3720-300x300.png",
"_id": 20694610,
"mature": true,
"url": "http://www.twitch.tv/user_to_test",
"display_name": "user_to_test"
}
If the user doesn’t exist, you’ll get a 404:
{
"error":"Not Found",
"status":404,
"message":"Channel 'user_to_test' does not exist"
}
The API endpoint can be found here.