Follow another user using Twitch api v5

def followChannel(name):
    username, userId = user(oauth)
    channelId = getChannelId(name)

    URL = f"{userId}&to_id={channelId}"
    Headers = {"Accept": "application/vnd.twitchtv.v5+json", "Client-ID": clientId, "Authorization": "Bearer 
    " + oauth}

    r = requests.get(URL, headers=Headers)

    data = r.json()

I tried using this code to follow a user but it didn’t work. I get this response:
{'total': 0, 'data': [], 'pagination': {}}
How do you follow another account using the twitch api?


No need to ping barry about this :wink:

As per the Docs you need to send a POST request for this, not GET - change your requests.get to and, if you have the correct scopes and token, it should work.

Also, you are sending the v5/kraken Accept header - you don’t need that when using Helix.

Duplicate of


Additionally you say “v5” in the topic but called helix

Closing as a duplicate.