Twitch API calling VAR

Hello everyone!

I’m currently working on a project which basically is my own dashboard to a degree with the possibility of expansion for others to use. The idea is to be lightweight and not bloat it up with unnessarcy things while streaming.

So I have figured thus far how to call the API’s via PHP using cURL. My question is, is there a way of turning most of the API calls in to vars so that I can basically make life a little easier so I can basically go $api, $streammeta which basically pulls https://api.twitch.tv/helix/streams/metadata

Also is it entirely possibly to pull a rolling chat log via python to php?

One solution would be to create a function which you could call to grab the latest api data.

function api($api_call) {
    switch($api_call) {
        case "metadata":
            curl...
            break;
        case "api_next":
            curl...
            break;
        default:
            //error
            break;
    }
}

In regards to your other question, if python saves the log to a text file you can have php open the file.