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

Python - How to apply patch to Python and Install Python via Pyenv

Python - How to apply patch to Python and Install Python via Pyenv

Introduction In this post, we will see how we can apply a patch to Python and…

Lets Encrypt SSL Error: The client lacks sufficient authorization 403 Forbidden

Lets Encrypt SSL Error: The client lacks sufficient authorization 403 Forbidden

This is due to our web server are configured to deny accessing this directory…

How to run ElasticSearch cluster on Docker with Kibana on Linux

How to run ElasticSearch cluster on Docker with Kibana on Linux

Introduction This post is about hosting ElasticSearch cluster on dockerised…

How to show a block of html or div to the bottom of a web page

How to show a block of html or div to the bottom of a web page

To download this code from git: See: Gyanblog Github

Visual Studio Code - How to associate file extension to a known programming language

Visual Studio Code - How to associate file extension to a known programming language

Problem Statement I have a drupal module, where there is a file of extension…

Jira Rest APIs common usages

Jira Rest APIs common usages

This article shows some of common usages of JIRA rest apis. Note: This article…

Latest Posts

System Design Patterns for Managing Long-Running Tasks

System Design Patterns for Managing Long-Running Tasks

Introduction Some operations simply can’t finish in the time a user is willing…

System Design Patterns for Real-Time Updates at High Traffic

System Design Patterns for Real-Time Updates at High Traffic

The previous articles in this series covered scaling reads and scaling writes…

System Design Patterns for Handling Large Blobs

System Design Patterns for Handling Large Blobs

Introduction Every non-trivial application eventually needs to handle large…

Explaining SAGA Patterns with Examples

Explaining SAGA Patterns with Examples

In a monolith, placing an order is a single database transaction — deduct…

System Design Patterns for Scaling Writes

System Design Patterns for Scaling Writes

In the companion article on scaling reads, we covered caching, replicas, and…

Serverless vs Containers — The Decision I Keep Revisiting

Serverless vs Containers — The Decision I Keep Revisiting

Every time I start a new service, I have the same argument with myself. Lambda…