tutorials|February 27, 2018|2 min read

Youtube Rest API response details

TL;DR

YouTube API responses contain parts like snippet (title, description, thumbnails), contentDetails (duration, dimension), and statistics (views, likes) that you request via the part parameter.

Youtube Rest API response details

Here, we give exact response from youtube apis.

Basics

Youtube provides details of video depend upon how much we ask. Youtube provides following types of information types:
  • Snippet
    It includes details like published date, channel Id, title, description, thumbnail images of different sizes, title of channel, tags etc.
  • ContentDetails
    It has information like duration, dimension, definition, caption etc
  • TopicDetails
    Topic information, some links from wiki of the category of video.
  • Statistics
    View count, like count, dislike count, favorite count, comment count

Information example for a Video, Information level: (snippet, contentDetails, topicDetails, statistics)

{
   "kind": "youtube#videoListResponse",
   "etag": "etag of video",
   "pageInfo": {
      "totalResults": 1,
      "resultsPerPage": 1
   },
   "items": [
      {
         "kind": "youtube#video",
         "etag": "etag of video",
         "id": "video id",
         "snippet": {
            "publishedAt": "2017-08-07T10:11:04.000Z",
            "channelId": "channel id",
            "title": "title ",
            "description": "description of video",
            "thumbnails": {
               "default": {
                  "url": "direct image url",
                  "width": 120,
                  "height": 90
               },
               "medium": {
                  "url": "direct image url",
                  "width": 320,
                  "height": 180
               },
               "high": {
                  "url": "direct image url",
                  "width": 480,
                  "height": 360
               },
               "standard": {
                  "url": "direct image url",
                  "width": 640,
                  "height": 480
               }
            },
            "channelTitle": "Channel title",
            "tags": [
               "bunch of tags, if given"
            ],
            "categoryId": "26",
            "liveBroadcastContent": "none",
            "defaultLanguage": "en-GB",
            "localized": {
               "title": "title",
               "description": "description"
            },
            "defaultAudioLanguage": "en-GB"
         },
         "contentDetails": {
            "duration": "PT3M9S",
            "dimension": "2d",
            "definition": "hd",
            "caption": "false",
            "licensedContent": true,
            "projection": "rectangular"
         },
         "statistics": {
            "viewCount": "7808",
            "likeCount": "79",
            "dislikeCount": "4",
            "favoriteCount": "0",
            "commentCount": "2"
         },
         "topicDetails": {
            "relevantTopicIds": [
               "/m/019_rr",
               "/m/03glg",
               "/m/019_rr",
               "/m/03glg"
            ],
            "topicCategories": [
               "https://en.wikipedia.org/wiki/Lifestyle_(sociology)",
               "https://en.wikipedia.org/wiki/Hobby"
            ]
         }
      }
   ]
}

Response for comment

```js [ { "kind": "youtube#commentThread", "etag": "\"_gJQceDMxJ8gP-8T2HLXUoURK8c/PpbEormnuWTQWMoRKEAbm9cLjjU\"", "id": "UgxlmZtbyZ7m6Fk46fR4AaABAg", "snippet": { "videoId": "pV_XHKYhRgw", "topLevelComment": { "kind": "youtube#comment", "etag": "\"_gJQceDMxJ8gP-8T2HLXUoURK8c/yg0P6VX_GhIUPHK_GaiwR-ujZm8\"", "id": "UgxlmZtbyZ7m6Fk46fR4AaABAg", "snippet": { "authorDisplayName": "Afrozkanpur Afrozkanpur", "authorProfileImageUrl": "https://yt3.ggpht.com/-Uw6ZLZNnZL4/AAAAAAAAAAI/AAAAAAAAAAA/ZOcnswHwIPA/s28-c-k-no-mo-rj-c0xffffff/photo.jpg", "authorChannelUrl": "http://www.youtube.com/channel/UCp0MUsTZH1ltLNC9gkW1OKg", "authorChannelId": { "value": "UCp0MUsTZH1ltLNC9gkW1OKg" }, "videoId": "pV_XHKYhRgw", "textDisplay": "sir hme leminets door ka disain cahiye", "textOriginal": "sir hme leminets door ka disain cahiye", "canRate": true, "viewerRating": "none", "likeCount": 0, "publishedAt": "2018-02-17T08:56:20.000Z", "updatedAt": "2018-02-17T08:56:20.000Z" } }, "canReply": true, "totalReplyCount": 0, "isPublic": true } }, { "kind": "youtube#commentThread", "etag": "\"_gJQceDMxJ8gP-8T2HLXUoURK8c/btHcdg53wX3hhxluWaNjmnFvsRQ\"", "id": "Ugz8GM8E0ZAuiezU2ZR4AaABAg", "snippet": { "videoId": "pV_XHKYhRgw", "topLevelComment": { "kind": "youtube#comment", "etag": "\"_gJQceDMxJ8gP-8T2HLXUoURK8c/4WDl1bqg1ZnE49vVwLOuD4sbsC4\"", "id": "Ugz8GM8E0ZAuiezU2ZR4AaABAg", "snippet": { "authorDisplayName": "imran ali", "authorProfileImageUrl": "https://yt3.ggpht.com/-xsrhPbh8lwk/AAAAAAAAAAI/AAAAAAAAAAA/vketWZ-cMQg/s28-c-k-no-mo-rj-c0xffffff/photo.jpg", "authorChannelUrl": "http://www.youtube.com/channel/UC-TLzrg6yuZ4oF2hcljXPxw", "authorChannelId": { "value": "UC-TLzrg6yuZ4oF2hcljXPxw" }, "videoId": "pV_XHKYhRgw", "textDisplay": "nyc", "textOriginal": "nyc", "canRate": true, "viewerRating": "none", "likeCount": 1, "publishedAt": "2018-01-06T13:25:25.000Z", "updatedAt": "2018-01-06T13:25:25.000Z" } }, "canReply": true, "totalReplyCount": 1, "isPublic": true }, "replies": { "comments": [ { "kind": "youtube#comment", "etag": "\"_gJQceDMxJ8gP-8T2HLXUoURK8c/0rBPE5BM07jw_ElUQvzIs9C9aPU\"", "id": "Ugz8GM8E0ZAuiezU2ZR4AaABAg.8b4WpG33XE58cGpxNxZcvG", "snippet": { "authorDisplayName": "Plan n Design", "authorProfileImageUrl": "https://yt3.ggpht.com/-jOyekwseTi0/AAAAAAAAAAI/AAAAAAAAAAA/Kx-yMDRdmcc/s28-c-k-no-mo-rj-c0xffffff/photo.jpg", "authorChannelUrl": "http://www.youtube.com/channel/UCNNxPxH_zIPxvWy5QMFkruA", "authorChannelId": { "value": "UCNNxPxH_zIPxvWy5QMFkruA" }, "videoId": "pV_XHKYhRgw", "textDisplay": "Thank you so much!!", "textOriginal": "Thank you so much!!", "parentId": "Ugz8GM8E0ZAuiezU2ZR4AaABAg", "canRate": true, "viewerRating": "none", "likeCount": 0, "publishedAt": "2018-02-05T04:43:34.000Z", "updatedAt": "2018-02-05T04:43:34.000Z" } } ] } } ] ```

Related Posts

Claude Code Skills — Build a Better Engineering Workflow with AI-Powered Code Reviews, Security Scans, and More

Claude Code Skills — Build a Better Engineering Workflow with AI-Powered Code Reviews, Security Scans, and More

Most developers use Claude Code like a search engine — ask a question, get an…

Curl - Your friend for Rest APIs/Calls - Basic Commands

Curl - Your friend for Rest APIs/Calls - Basic Commands

Curl is a wonderful tool for initiate REST APIs or calls. Or, you can literally…

php55w-common conflicts with php-common-5.* | Php issues while installing libraries

php55w-common conflicts with php-common-5.* | Php issues while installing libraries

I was trying to install mongo extension with pecl. It gave me error: Then, I…

Drupal Helpful codes for database queries

Drupal Helpful codes for database queries

Being a drupal user from last around 5 years, I used to know small codes for…

Docker image for Drupal 7, and Php extension MongoDB installed.

Docker image for Drupal 7, and Php extension MongoDB installed.

You have drupal 7 image from docker hub, and want to connect tomongo db via php…

Docker Push: How to push your docker image to your organization in hub.docker.com

Docker Push: How to push your docker image to your organization in hub.docker.com

Tag the image, by seeing its image id, from docker images command docker tag 04d…

Latest Posts

Claude Code Skills — Build a Better Engineering Workflow with AI-Powered Code Reviews, Security Scans, and More

Claude Code Skills — Build a Better Engineering Workflow with AI-Powered Code Reviews, Security Scans, and More

Most developers use Claude Code like a search engine — ask a question, get an…

Building an AI Voicebot for Visitor Check-In — A Practical Guide to Handling the Messy Parts

Building an AI Voicebot for Visitor Check-In — A Practical Guide to Handling the Messy Parts

Every office lobby has the same problem: a visitor walks in, nobody’s at the…

Server Security Best Practices — Complete Hardening Guide for Production Systems

Server Security Best Practices — Complete Hardening Guide for Production Systems

Every breach post-mortem tells the same story: an unpatched service, a…

Staff Engineer Study Plan for MAANG Interviews — The Complete 12-Week Roadmap

Staff Engineer Study Plan for MAANG Interviews — The Complete 12-Week Roadmap

If you’re a Senior Engineer (L5) preparing for Staff (L6+) roles at MAANG…

XSS and CSRF Explained — The Complete Guide with Real Attack Examples and Defenses

XSS and CSRF Explained — The Complete Guide with Real Attack Examples and Defenses

XSS and CSRF have been in the OWASP Top 10 for over a decade. They’re among the…

OWASP Top 10 (2021) — Every Vulnerability Explained with Code

OWASP Top 10 (2021) — Every Vulnerability Explained with Code

The OWASP Top 10 is the industry standard for web application security risks. If…