Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

I want to get life watchtime of a channel using youtube api 3

$
0
0

i want to fetch lifetime watch time of a channel. i actually get all data but unable to fetch watch time

    $API_KEY = 'my secret key';    $API_URL = 'https://www.googleapis.com/youtube/v3/';    $channelid=$request->url;    $prams=array    ('part' => 'status,snippet,contentDetails,statistics','id' =>$channelid,'key'=>$API_KEY    );    $url = $API_URL.'channels?'.http_build_query($prams);    $channelDetails = json_decode(file_get_contents($url),true);    $title = $channelDetails['items'][0]['snippet']['title'];    $country = $channelDetails['items'][0]['snippet']['country'];    $thumb = $channelDetails['items'][0]['snippet']['thumbnails']['medium']['url'];    $subs= $channelDetails['items'][0]['statistics']['subscriberCount'];    $views=$channelDetails['items'][0]['statistics']['viewCount'];    $video = $channelDetails['items'][0]['statistics']['videoCount'];

Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>