# Multiple user\_ids in streams endpoint

**URL:** <https://discuss.dev.twitch.com/t/multiple-user-ids-in-streams-endpoint/30968>\
**Category:** API\
**Created:** [March 23, 2021, 2:08pm UTC](https://discuss.dev.twitch.com/t/multiple-user-ids-in-streams-endpoint/30968 "2021-03-23T14:08:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meizu\_nakamura](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/meizu_nakamura/32/11141_2.png) [@Meizu\_nakamura](https://discuss.dev.twitch.com/u/Meizu_nakamura)\
**Post date:** [March 23, 2021, 2:08pm UTC](https://discuss.dev.twitch.com/t/multiple-user-ids-in-streams-endpoint/30968/1 "2021-03-23T14:08:59Z")

</div>

Hello,  
I’m trying to use the streams endpoint to get multiple stream information using only one request. According to documentation I can specify up to 100 ids in my request.  
I’m using python with requests lib:

> url = ‘[https://api.twitch.tv/helix/streams](https://api.twitch.tv/helix/streams)’  
> headers = {‘Client-ID’: client\_id’, ‘Authorization’:'Bearer '+access\_token}  
> payload = {‘user\_id’:‘user1’,‘user\_id’:‘user2’…}  
> r = requests.get(url,params=payload, headers=headers)

Using the above code the endpoint returns only one result, corresponding to the last user\_id specified in payload param, During my testing I made sure to request user ids of live streams

What’s the correct syntax to get mutliple results ?

Thank You

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [March 23, 2021, 2:10pm UTC](https://discuss.dev.twitch.com/t/multiple-user-ids-in-streams-endpoint/30968/2 "2021-03-23T14:10:53Z")

</div>

The correct URL construction is

```
https://api.twitch.tv/helix/streams?user_id=26610234&user_id=567803342

```

You might have to use _not params_ and string concantenate the URL instead

```
payload = {‘user_id’:‘user1’,‘user_id’:‘user2’…}

```

Creates and object of only on entry

```
payload = {‘user_id’:[‘user1’,‘user2']}

```

Make work but I’d not to familair with Python.

So building the URL manually instead of using `params` might be the way to go

---

<div class="post-metadata">

**Author:** ![Meizu\_nakamura](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/meizu_nakamura/32/11141_2.png) [@Meizu\_nakamura](https://discuss.dev.twitch.com/u/Meizu_nakamura)\
**Post date:** [March 23, 2021, 2:19pm UTC](https://discuss.dev.twitch.com/t/multiple-user-ids-in-streams-endpoint/30968/3 "2021-03-23T14:19:08Z")

</div>

Hi BarryCarlyon

Using payload = {‘user\_id’:[‘user1’,‘user2’]} works !

Thank you

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [April 22, 2021, 2:19pm UTC](https://discuss.dev.twitch.com/t/multiple-user-ids-in-streams-endpoint/30968/4 "2021-04-22T14:19:13Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
