The example code I presented and the URL you used in OP, checks for a Live Stream, if the user is not live, no data is returned.
Do you perhaps mean the users API instead
https://api.twitch.tv/helix/users?login=somename
The example code I presented and the URL you used in OP, checks for a Live Stream, if the user is not live, no data is returned.
Do you perhaps mean the users API instead
https://api.twitch.tv/helix/users?login=somename