~/tutorials/45-youtube-rest-api-response-details.md

Youtube Rest API response details

2 min readFebruary 27, 2018by Gorav Singal#youtube-rest-api#youtube-response#automation
// 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" } } ] } } ] ```

$ subscribe --weekly

One deep dive a week, in your inbox

System design, AI engineering, trading systems and interview prep. Tested code, real numbers. Free, and you can unsubscribe any time.

or read it on gyanbyte.substack.com

Share

Related Posts

Claude Code Skills — Build a Better Engineering Workflow

Claude Code Skills — Build a Better Engineering Workflow

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

How to Stay Valuable as a Software Engineer in the AI Era: A Practical Playbook

How to Stay Valuable as a Software Engineer in the AI Era: A Practical Playbook

In the previous article I argued that AI is not killing software engineering…

How to Review AI-Generated Code: A Checklist for Catching What the Model Missed

How to Review AI-Generated Code: A Checklist for Catching What the Model Missed

A few months back I approved a PR that was almost entirely AI-generated. It…

How to Debug AI-Generated Code: Understand First, Fix Last

How to Debug AI-Generated Code: Understand First, Fix Last

In the last article I wrote about reviewing AI code before it goes in. This one…

The Future of Software Engineering: What AI Changes, What Stays, and Where the Jobs Go

The Future of Software Engineering: What AI Changes, What Stays, and Where the Jobs Go

Every few weeks somebody sends me a scary headline — “AI will replace all…

The Transactional Outbox Pattern: Never Lose an Event Again

The Transactional Outbox Pattern: Never Lose an Event Again

This is one of those patterns that looks like nothing until you get burnt once…

Event Sourcing, Explained: Store What Happened, Not Just the Final State

Event Sourcing, Explained: Store What Happened, Not Just the Final State

Here is a question I like to ask in interviews: your bank account shows a…