prasad
prasad

Reputation: 2026

Get list of channels subscribed by user using userid, without authorization

Previously we are using GData V2 api to get list of channels subscribed by user using userid as follows,

https://gdata.youtube.com/feeds/api/users/userid/subscriptions?v=2&alt=json&max-results=50

But in V3 api, to get list of channels subscribed by user, authorization is compulsory, anyone know any other approach for this. Thanks.

Upvotes: 0

Views: 2029

Answers (2)

ssi-anik
ssi-anik

Reputation: 3714

In V3 API, if you have the access token, and the channel id. Make a GET request like

https://www.googleapis.com/youtube/v3/subscriptions?part=snippet&channelId=**channel_id**&access_token=**access_token**&maxResults=**max_results_between_0_to_50_default_5**


I'm not an expert or anything, but I'm getting the result correctly now for what I'm working on.
Edit:
@prasad's answer is correct though, but the request will not work with api_key. Just replaced his api_key with access_token.

Upvotes: 1

prasad
prasad

Reputation: 2026

In V3 Api you can get list of subscriptions by using channel id of that user.

GET https://www.googleapis.com/youtube/v3/subscriptions?part=snippet&channelId=*channelid*&maxResults=20&key={YOUR_API_KEY}

Upvotes: 2

Related Questions