Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Youtube subscriber count with Youtube Data Api V3

So previously i was getting a youtube channel subscriber count with youtube data api v2.

I used the following (I am using TED channel for demo purposes)

http://gdata.youtube.com/feeds/api/users/TEDtalksDirector?alt=json&callback=jQuery111202977260369807482_1433828589506&jsonp&_=1433828589507 

However with the new v3 api, there is no subscriber count in the result.

https://www.googleapis.com/youtube/v3/subscriptions?part=snippet%2CcontentDetails&channelId=UCAuUUnT6oDeKwE6v1NGQxug&key=fhjfshdjfhsjdhfjshdjfhsjdfhsjdhfjshdjfhsjdhs 

Is there a way in which I can get the subscriber count value?

like image 368
kianmeng Avatar asked Jun 09 '15 05:06

kianmeng


People also ask

Is YouTube data API v3 free?

Yes, using the YouTube API does not incur any monetary cost for the entity calling the API. If you go over your quota an 403 Error will be returned by the API.

How do I find my subscriber data on YouTube?

Find your subscriber countSign in to YouTube Studio. In the left Menu, select Analytics. On the Overview tab, find the Realtime card. Click View live count to view your subscriber count over time.


2 Answers

Use it like this:

https://www.googleapis.com/youtube/v3/channels?part=statistics&id=channel_id&key=your_key 

You can try your API request here: https://developers.google.com/youtube/v3/docs/channels/list#try-it

like image 152
Muhamed Avatar answered Oct 05 '22 13:10

Muhamed


One other thing to be aware of is that there is a boolean: Statistics.HiddenSubscriberCount. If set to true then SubscriberCount will be null.

An example channel is CBS New York:

https://www.youtube.com/channel/UCNZyLULUQBp5e9Q1cKtvk6Q/

I don't know why somebody would want to hide their subscriber count - usually it's a badge of honour. I'd guestimate that 7% of channels hide subscriber count, so it might really confuse you if you're testing your API calls on a channel that does!

like image 25
BrettB Avatar answered Oct 05 '22 13:10

BrettB