How to get subscriber count and videos count for a given YouTube channel?

rsk82

Until now I've been using this URL to retrieve subscriber count for a channel:

http://gdata.youtube.com/feeds/api/users/<channel_id>?v=2&alt=json

And this URL to get channel videos count:

https://gdata.youtube.com/feeds/api/users/<channel_id>/uploads?v=2&alt=jsonc&max-results=0

But from this day Google discontinued using it's v2 API and I can't find replacement options for this data.

JAL

You're going to want to use the Channels/list endpoint as pass in statistics for the part parameter.

Request:

HTTP GET: GET https://www.googleapis.com/youtube/v3/channels?part=statistics&id={CHANNEL_ID}&key={YOUR_API_KEY}

Response (with id=UCt7iVnJwjBsof8IPLJHCTgQ):

{
 "kind": "youtube#channelListResponse",
 "etag": "\"dhbhlDw5j8dK10GxeV_UG6RSReM/WNxXCvycTyqTjTn9sLJ5toVjBRY\"",
 "pageInfo": {
  "totalResults": 1,
  "resultsPerPage": 1
 },
 "items": [
  {

   "kind": "youtube#channel",
   "etag": "\"dhbhlDw5j8dK10GxeV_UG6RSReM/jijTuA_iWn2Kv9aRnqeAWNAcQ6I\"",
   "id": "UCt7iVnJwjBsof8IPLJHCTgQ",
   "statistics": {
    "viewCount": "796662",
    "commentCount": "20",
    "subscriberCount": "257",
    "hiddenSubscriberCount": false,
    "videoCount": "126"
   }
  }
 ]
}

You can pass in a comma-separated list of Channel IDs for the id parameter. Because I only passed in one id, the first object of the items array will have the values you need. Get the object for the subscriberCount and videoCount values in the statistics dictionary for the data you want.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Count only published videos

From Dev

How to get the total number of videos in a YouTube channel?

From Dev

Get Youtube publish channel playlist videos in android

From Dev

How can I get a count of rows that match a given year in Rails?

From Dev

Get videos from youtube api from channel

From Dev

Get youtube channel videos of particular channel using PHP Code

From Dev

How can I stream Youtube videos in my Roku Channel?

From Dev

How to get the youtube channel ID and name, given a video ID

From Dev

Get all youtube videos from a channel (some videos are missing)

From Dev

youtube api: get view count of videos in a 'search list' request

From Dev

Get youtube username given a channel id

From Dev

Given a YouTube video, programmatically get its channel?

From Dev

How to get a count of certain entity per minute in a given dataframe in pandas?

From Dev

How do I get total text and voice channel count in numbers

From Dev

How to get YouTube videos in order of date uploaded

From Dev

Youtube Data API retrieve channel subscribers count for past dates

From Dev

How to get a empty value column count in a given row in My SQL

From Dev

How can I get a count of rows that match a given year in Rails?

From Dev

Get videos from youtube api from channel

From Dev

How can I stream Youtube videos in my Roku Channel?

From Dev

How to get Facebook subscriber count + friend count

From Dev

How to get view count from YouTube APIs for android

From Dev

How to get the count of records with the highest date as a given date in mysql query

From Dev

Is there a javascript bookmarklet to play all videos from a given video's channel on Youtube?

From Dev

How to download newly uploaded videos from a youtube channel?

From Dev

How to get Youtube videos uploaded since a particular date, with view count, in a particular location using youtube data api?

From Dev

how to get the count for the given Json response in swift 3?

From Dev

How to get all the substrings matching given word along with their count in mongodb?

From Dev

How can I get the directory count of a given directory in bash?

Related Related

  1. 1

    Count only published videos

  2. 2

    How to get the total number of videos in a YouTube channel?

  3. 3

    Get Youtube publish channel playlist videos in android

  4. 4

    How can I get a count of rows that match a given year in Rails?

  5. 5

    Get videos from youtube api from channel

  6. 6

    Get youtube channel videos of particular channel using PHP Code

  7. 7

    How can I stream Youtube videos in my Roku Channel?

  8. 8

    How to get the youtube channel ID and name, given a video ID

  9. 9

    Get all youtube videos from a channel (some videos are missing)

  10. 10

    youtube api: get view count of videos in a 'search list' request

  11. 11

    Get youtube username given a channel id

  12. 12

    Given a YouTube video, programmatically get its channel?

  13. 13

    How to get a count of certain entity per minute in a given dataframe in pandas?

  14. 14

    How do I get total text and voice channel count in numbers

  15. 15

    How to get YouTube videos in order of date uploaded

  16. 16

    Youtube Data API retrieve channel subscribers count for past dates

  17. 17

    How to get a empty value column count in a given row in My SQL

  18. 18

    How can I get a count of rows that match a given year in Rails?

  19. 19

    Get videos from youtube api from channel

  20. 20

    How can I stream Youtube videos in my Roku Channel?

  21. 21

    How to get Facebook subscriber count + friend count

  22. 22

    How to get view count from YouTube APIs for android

  23. 23

    How to get the count of records with the highest date as a given date in mysql query

  24. 24

    Is there a javascript bookmarklet to play all videos from a given video's channel on Youtube?

  25. 25

    How to download newly uploaded videos from a youtube channel?

  26. 26

    How to get Youtube videos uploaded since a particular date, with view count, in a particular location using youtube data api?

  27. 27

    how to get the count for the given Json response in swift 3?

  28. 28

    How to get all the substrings matching given word along with their count in mongodb?

  29. 29

    How can I get the directory count of a given directory in bash?

HotTag

Archive