azad education azad education

The next-generation blog, news about technology.

India (HQ)

[email protected]

Full YouTube API Tutorial get channel data

azad education
Azad Education Dec 02, 2022 · 12 min read
Full YouTube API Tutorial get channel data

YouTube API Tutorial Get Data from youtube.

You Tube Data API get list

1. Subscriber's count

2. Views Count.

3. Get All Video's ID

4. Get YouTube Video Comment's.

5. Get YouTube Video Thumbnail.

6. Get Perticular video full information.


How to create api for getting  youtube channel information?

If we don't have project on google cloud before you must be create a project then follow these step for api creation.

We need to create API key for getting youtube channel information.

login to your gooogle account then go to


Enable YouTube Data API & Reporting API.

Go Back and click on credentials from left side menu bar. Now click on create credentials and select api key this will be create api keys for our project.

1. YouTube Channel get subscriber's and view's count from the youtube API

Note: all of curl url that can be check in browser directly.

JavaScript code to store to get data in variable.



                function(data) {

                    subscribers = data.items[0].statistics.subscriberCount;

                    views = data.items[0].statistics.viewCount;


2. YouTube Channel get all video list.

Note: This will return 100 Video information one time. You can chnage according to your requirment's.

JavaScript code to store only video id in array.

 let YouTube= [];


                function(res) {

                    res.items.forEach(element => {

                        if ( != "" && != 'undefined')




3. YouTube Channel get Video Comment's.'&maxResults=50

Java Script code to geeting data in json format.


                    '' +

                    videoId + '&maxResults=50',

                    function(data) {

                        data.items.forEach((video, index) => {

                            commentData[index] = {

                                comment: video.snippet.topLevelComment.snippet.textDisplay,

                                author: video.snippet.topLevelComment.snippet.authorDisplayName,

                                profile: video.snippet.topLevelComment.snippet.authorProfileImageUrl,

                                created: video.snippet.topLevelComment.publishedAt


                            allVideoComment[videoId] = commentData;



4. How do I get a YouTube video thumbnail from the YouTube API?

Each YouTube video has four generated images. They are predictably formatted as follows:<insert-youtube-video-id-here>/0.jpg<insert-youtube-video-id-here>/1.jpg<insert-youtube-video-id-here>/2.jpg<insert-youtube-video-id-here>/3.jpg

The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (i.e., one of 1.jpg2.jpg3.jpg) is:<insert-youtube-video-id-here>/default.jpg

For the high quality version of the thumbnail use a URL similar to this:<insert-youtube-video-id-here>/hqdefault.jpg

There is also a medium quality version of the thumbnail, using a URL similar to the HQ:<insert-youtube-video-id-here>/mqdefault.jpg

For the standard definition version of the thumbnail, use a URL similar to this:<insert-youtube-video-id-here>/sddefault.jpg

For the maximum resolution version of the thumbnail use a URL similar to this:<insert-youtube-video-id-here>/maxresdefault.jpg

However, not every YouTube video contains all nine thumbnails. Also, the thumbnails' image sizes depends on the video (the numbers below are based on one). There are some thumbnails guaranteed to exist:

Width | Height | URL
120   | 90     |<VIDEO ID>/1.jpg
120   | 90     |<VIDEO ID>/2.jpg
120   | 90     |<VIDEO ID>/3.jpg
120   | 90     |<VIDEO ID>/default.jpg
320   | 180    |<VIDEO ID>/mq1.jpg
320   | 180    |<VIDEO ID>/mq2.jpg
320   | 180    |<VIDEO ID>/mq3.jpg
320   | 180    |<VIDEO ID>/mqdefault.jpg
480   | 360    |<VIDEO ID>/0.jpg
480   | 360    |<VIDEO ID>/hq1.jpg
480   | 360    |<VIDEO ID>/hq2.jpg
480   | 360    |<VIDEO ID>/hq3.jpg
480   | 360    |<VIDEO ID>/

How to make auto youtube  subscription link?  

do follow the steps for gaining subscribers.

  1. Just go to your YouTube channel
  2. Past this code at the end of URL of your YouTube channel


3. Then copy complete link

4. Go to any link shortened URL or you can google.

5. Paste complete link of YouTube channel and along with above bold text to shortened.

6. Share this link instead sharing whole link.



Azad Mohammed

An editor at AzadEducation
View Articles

I'am Azad, These blogs, tech skills and programing news, I am sharing with my exprience. I have 4+ year experiece in the web development. Also we are learning investing ideas. I believe in "big mind big dream", that will convert in smart mind. You can follow me on Linkedin profile.

Java Script
Quick Hack Solution Tips

Subscribe to our mailing list!

We don't spam