Search code examples
twitchtwitch-api

How to fix "Bad Request","status":400"


I try to get twitch api with following website https://api.twitch.tv/kraken/streams/ chennal name ,but nothing happened and get error {"error":"Bad Request","status":400,"message":"No client id specified"}

I expect to get viewers count and follower count


Solution

  • it's necessary to include your client ID with the request. For example:

    curl -H 'Accept: application/vnd.twitchtv.v5+json' \
        -H 'Client-ID: uo6dggojyb8d6soh92zknwmi5ej1q2' \
        -X GET 'https://api.twitch.tv/kraken/streams/44322889'
    

    See here for details on setting up your client ID.