M
M
Mykola Ivashchuk2017-03-05 16:51:50
YouTube
Mykola Ivashchuk, 2017-03-05 16:51:50

How to get user videos?

As I understand it, there are 2 types of channels -
https://www.youtube.com/user/username
and https://www.youtube.com/channel/channelid
Data from channels can be obtained using YouTube Data API methods.
For example, I need to receive 11 videos from a channel

$videosResponse = $youtube->search->listSearch('id,snippet',
                        array(
                            'channelId' => $chanelId,
                            'maxResults' => 11,
                            'order' => 'date'
                        ));

But if you pass not the channel id, but the user id, then there will be an error:
{ "error": { "errors": [ { "domain": "youtube.search", "reason": "invalidChannelId", "message": "Invalid channel.", "locationType": "parameter", "location ": "channelId" } ], "code": 400, "message": "Invalid channel." } }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question