How to get username from twitch API

Their issue is that they don’t know how to get the display_name. Their first example shows them accessing the URL in a browser, but that’s just the response body that the browser renders and only helps them know where the display_name is within the structure of the response body, it doesn’t in any way help them figure out where that body is within the response object.

Depending on the HTTP library used, the response object may just be the body (OP said the response differs from what they see in a browser, so that’s unlikely here), it may be nested in a res.body (which is coming back as undefined so in this case it’s not that), some libraries may return a Buffer that needs to be joined/parsed first to give a body, etc…

We can’t help them because we don’t know the structure of the response they are getting from their HTTP library as we don’t know what their HTTP library of choice is. We can tell them where in the body the display_name, but if they don’t know how to get the body that wont help them.