Getting Users Info from more than 1 User by ID

Hey,

i’m searching for a way to get all users info from more than one id (like you can get it with:

curl -H 'Accept: application/vnd.twitchtv.v5+json' \
-H 'Client-ID: xxx' \
-X GET https://api.twitch.tv/kraken/users?login=dallas,dallasnchains

for the usernames). I tried it:

curl -H ‘Accept: application/vnd.twitchtv.v5+json’ -H ‘Client-ID: xxx’ -X GET “https://api.twitch.tv/kraken/users/122393233,84594371

but this endpoint doesn’t support more than 1 id :frowning:

Background: I have a user database with id, displayname, twitchname and update it once per day. Since users are allowed to change their names it is difficult to update their infos with the wrong twitchname (also you don’t get 'non existent usernames with the 1st curl). so i update it with their id and right now i have to make an api call for every single user.

Hey,

I also work on something similar and with the new id as primary key, it would be nice to have something like that. Updating the twitchnames of users is a great deal since the new system of usernamechanges are enabled.

Using a keep-alive connection the overhead from additional requests should be manageable.

even with keep-alive 90000 api calls need much more time instead of 900 (90000 cause my database has 90000 users right now in it)

If this is just to update any usernames that might have been changed, rather than using an ID and looking up 1 user at a time, can you not just use the first method you mentioned with usernames? If you request users a,b,c,d etc… and only get back a,b and d, you know c must have changed and then can do a single lookup using the stored ID you have for that old username to retrieve their new username. It’s not perfect, but it’s less calls that doing it 1 user at a time.

Would be an idea, thanks, but the other way would be nicer :slight_smile:
So it’s a bit tricky if i request 100 users, get only 97 back and check which 3 ids i didnt get. it’s definitly a workaround, but expanding the endpoint would also be nice.

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