Posted on Leave a comment

YouTube Trends PHP Script API V3 Country Wise Trending Video List PHP jQuery

If you want to list YouTube Trending Videos on your web page, you need to access the Google API V3 YouTube Data API library. In this video tutorial, you can watch hot to create API and also create php YouTube Trends web page with simple ways YouTube trends php script API v3 country wise trending video list use php jQuery.

In this example, I have created YouTube Trending videos what people look watching now this video list shows on my website. YouTube via the YouTube Data API V3 library and get the list of videos. Then, I formed a video gallery with the resultant video list.

HTML Blank Table for show results

I have created a HTML table to show trending YouTube videos by recent by people watch right now.

<head><title>YoutTube Trends</title>
<script src=""></script>
<link rel="stylesheet" href="">
<thead id="result">

Create jQuery function get video to show on html table

In the following jQuery script, I have requested the YouTube Data API V3 access to get the popular videos by the just now trending and what video people love to watch right now. I am sending the request throuth API call to request a YouTube video list related to the keyword.

After fetching the data, the jQuery response will return the video data. The jQuery function response will be parsed to get the video title and the description in the gallery. The video thumbnail is embedded.

var url=`${API_KEY}`;
function displayVideo(data){
var videoData="";
<a href="video_play.php?vidid=${}" target="_blank">${item.snippet.title}</a>
<a target="_blank" href=""></a>
<img src="${item.snippet.thumbnails.high.url}" width="200" height="200">

YouTube Play Video through video id

Create video_play.php file and paste this code.

echo '<iframe width="552px" height="310px" src="'.$vidid.'?" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>';

I Hope you liked YouTube Trends PHP Script API V3 Country Wise Trending Video List which I create feel Free to Download and use it, Don’t forget to Subscribe my YouTube Channel TECHboto.
I hope you enjoyed this tutorial, and maybe got some inspiration for your next project.

Leave a Reply

Your email address will not be published. Required fields are marked *