Displaying API results inside a WordPress page template
I see three things

I'm not too terribly familiar with custom wordpress tempaltes, but I'm fairly certain you shouldn avoid doing the API logic in the view. You should call the API in a controller and pass the result to the view, if at all possible. This is a standard separation of concerns.

Additionally, you shouldn't assume the API call will work. If they're server or dns has issues, or they make a breaking change to their API, you should handle it gracefully and inform the user that there are issues. Right now it appears foreach($response-&gt;body-&gt;members as $member) would fail if the API failed.

Finally, it's a good idea to keep the "Basic KEY" in a config or something, so you don't need to touch the code to update the key.