Can i still create api at this moment?

Hello,

Im trying to create api and get some informations from channel, is it still possible to do ? because when im trying connect to api i get answer:

{“error”:“Not Found”,“status”:404,“message”:"The v5 API is deprecated and will be shutdown on February 28, 2022. Applications that have not accessed v5 before July 15, 2021 no longer have access to v5. For more information on the v5 API shutdown plan, see Redirecting... and the Twitch API documentation at https://dev.twitch.tv/docs/api."}

This is how im doing this:

$channelsApi = 'https://api.twitch.tv/kraken/channels/';
$channelName = 'kraken';
$clientId = 'clientID';
$ch = curl_init();

curl_setopt_array($ch, array(
    CURLOPT_HTTPHEADER => array(
        'Accept: application/vnd.twitchtv.v5+json',
        'Client-ID: ' . $clientId,
        'Authorization: secretID'
    ),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_URL => $channelsApi . $channelName
));

$response = curl_exec($ch);
curl_close($ch);
echo $response;

Kraken, the V5 API, is deprecated and will be shut down completely soon. Please refer to the Helix api for whichever endpoints you need Twitch API | Twitch Developers

Thank you for answer, i didnt know there is different between kraken and helix and now i know.

But still i have error when trying connect:

{"error":"Unauthorized","status":401,"message":"OAuth token is missing"}

I’ve added my secret token on httpheader like this:

'Authorization: OAuth secrettoken'

Your Client Secret is not an OAuth token. You need to go through the OAuth process to get a token Authentication | Twitch Developers

Thank you very much, your answer help me alot, anyway is there chance to embed clip video ? or any other way to display it on website ? because nothing i try works.

This data i get from api:

    [id] => PuzzledChillyAniseStoneLightning-cF4cI6V_iJFMqnRR
    [url] => https://clips.twitch.tv/PuzzledChillyAniseStoneLightning-cF4cI6V_iJFMqnRR
    [embed_url] => https://clips.twitch.tv/embed?clip=PuzzledChillyAniseStoneLightning-cF4cI6V_iJFMqnRR
    [broadcaster_id] => 102098555
    [broadcaster_name] => Kasix
    [creator_id] => 684419179
    [creator_name] => xyzmacix
    [video_id] => 1109078194
    [game_id] => 
    [language] => pl
    [title] => Stream bezdomnej Kasi
    [view_count] => 23
    [created_at] => 2021-08-06T21:24:44Z
    [thumbnail_url] => https://clips-media-assets2.twitch.tv/vod-1109078194-offset-0-preview-480x272.jpg
    [duration] => 10

For clips Video & Clips | Twitch Developers

For Video/Streams Everything | Twitch Developers

It doesn’t work for me, i have error on console:

The "X-Frame-Options" directive set to "SAMEORIGIN" refused to load „https://clips.twitch.tv/embed-error.html?errorCode=InvalidCharInParent&content=clips.twitch.tv%2Fembed%3Fclip%3DPuzzledChillyAniseStoneLightning-cF4cI6V_iJFMqnRR%26parent%3Dhttps%3A%2F%2Fwww.website.pl%2F” in frame.

Ok i finally have it done, generally the address in parent parameter need to be without https so something like that worked for me:

 <iframe
   src="https://clips.twitch.tv/embed?clip=IncredulousAbstemiousFennelImGlitch&parent=www.website.pl"
   height="360"
   width="640"
   allowfullscreen="true">
</iframe>

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