1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Youtube stats embedding?

Discussion in 'Graphics & Multimedia' started by Sycrid, Feb 18, 2020.

  1. #1
    Hi everyone,

    Just a simple question I hope. I've searched and I can't find the right answer.

    I can embed videos from YouTube into WordPress, but I'm wondering if it's possible to embed the total view count from my youtube channel into wordpress.
    SEMrush
    Does anyone know how to do this?

    Kind regards
    Sycrid.
     
    Sycrid, Feb 18, 2020 IP
    SEMrush
  2. Ayoub benali01

    Ayoub benali01 Active Member

    Messages:
    190
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    63
    Digital Goods:
    1
    Articles:
    2
    #2
    This is not possible unfortunately
     
    Ayoub benali01, Jul 27, 2020 IP
  3. olmix

    olmix Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    11
    #3
    Actually there is a way by using YouTube API

    something like this :

    
    <?php  
    $video_ID = 'lB8uQ_zO-o8';
    $JSON = file_get_contents("https://gdata.youtube.com/feeds/api/videos/{$video_ID}?v=2&alt=json");
    $JSON_Data = json_decode($JSON);
    $views = $JSON_Data->{'entry'}->{'yt$statistics'}->{'viewCount'};
    echo $views.' views';
    ?>
    
    PHP:
     
    olmix, Aug 4, 2020 IP