Anton
Anton

Reputation: 1502

How to get count of youtube likes, dislikes and comments per Channel

Does anyone know how to get Count of ALL Likes, Dislikes, Comments per Channel. ( not per video ). Of course workaround could be make a lot of calls and gathering all information by every video, but there should be more smarter way.

For now i am able to grab only:

{
    "kind": "youtube#channelListResponse",
    "etag": "\"DuHzAJ-eQIiCIp7p4ldoVcVAOeY/gV5INvDRXUuR7M5HU7r3Vgp9KxI\"",
    "pageInfo": {
        "totalResults": 1,
        "resultsPerPage": 5
    },
    "items": [
        {
            "kind": "youtube#channel",
            "etag": "\"DuHzAJ-eQIiCIp7p4ldoVcVAOeY/Bsi6Hb1DkT1a7bnIhxS6aHiWymQ\"",
            "id": "UC9gzynCiyB7tQmdZ-p2a_nw",
            "snippet": {
                "title": "Дмитрий Шилов",
                "description": "Зайди и подпишись на наш развлекательный канал, подними себе настроение)",
                "customUrl": "Budenyi80",
                "publishedAt": "2010-02-01T00:44:44.000Z",
                "thumbnails": {
                    "default": {
                        "url": "https://yt3.ggpht.com/-r6mSusF_X50/AAAAAAAAAAI/AAAAAAAAAAA/26VcgWvTFPQ/s88-c-k-no-mo-rj-c0xffffff/photo.jpg",
                        "width": 88,
                        "height": 88
                    },
                    "medium": {
                        "url": "https://yt3.ggpht.com/-r6mSusF_X50/AAAAAAAAAAI/AAAAAAAAAAA/26VcgWvTFPQ/s240-c-k-no-mo-rj-c0xffffff/photo.jpg",
                        "width": 240,
                        "height": 240
                    },
                    "high": {
                        "url": "https://yt3.ggpht.com/-r6mSusF_X50/AAAAAAAAAAI/AAAAAAAAAAA/26VcgWvTFPQ/s800-c-k-no-mo-rj-c0xffffff/photo.jpg",
                        "width": 800,
                        "height": 800
                    }
                },
                "localized": {
                    "title": "Дмитрий Шилов",
                    "description": "Зайди и подпишись на наш развлекательный канал, подними себе настроение)"
                },
                "country": "RU"
            },
            "contentDetails": {
                "relatedPlaylists": {
                    "likes": "LL9gzynCiyB7tQmdZ-p2a_nw",
                    "uploads": "UU9gzynCiyB7tQmdZ-p2a_nw",
                    "watchHistory": "HL",
                    "watchLater": "WL"
                }
            },
            "statistics": {
                "viewCount": "212372633",
                "commentCount": "0",
                "subscriberCount": "596586",
                "hiddenSubscriberCount": false,
                "videoCount": "893"
            }
        }
    ]
}

Upvotes: 2

Views: 2468

Answers (2)

ReyAnthonyRenacia
ReyAnthonyRenacia

Reputation: 17623

You can use the Videos.list pass the videoId and use the 'statistics' for the 'part' property. That should retrieve these metrics: viewCount, likeCount, dislikeCount, favoriteCount, commentCount. Sample response:

{
  "kind": "youtube#videoListResponse",
  "etag": "\"DuHzAJ-eQIiCIp7p4ldoVcVAOeY/q1X2B1932H2A6Az8KDm_LQxz62c\"",
  "pageInfo": {
    "totalResults": 1,
    "resultsPerPage": 1
  },
  "items": [
    {
      "kind": "youtube#video",
      "etag": "\"DuHzAJ-eQIiCIp7p4ldoVcVAOeY/ZQMr9x4Jyv8XjT9IF6WYDNod-bc\"",
      "id": "nj1TosUqJCI",
      "statistics": {
        "viewCount": "9187",
        "likeCount": "93",
        "dislikeCount": "5",
        "favoriteCount": "0",
        "commentCount": "27"
      }
    }
  ]
}

Upvotes: 1

Tamas Szoke
Tamas Szoke

Reputation: 5542

You can use the youtube Reporting API.

The other aproach is to loop over the videos, just in case, example.

Upvotes: 2

Related Questions