A
A
Andrey Frolov2017-08-12 02:48:30
Google
Andrey Frolov, 2017-08-12 02:48:30

How to get the last video of a channel with the number of views in YouTube api?

How to get the last video of a channel with the number of views in YouTube api?
Can this be done in one request?
now done through https://www.googleapis.com/youtube/v3/search...
but there is no number of views

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem0071, 2017-08-12
@farpram

I myself recently did a project related to YouTube. They actually
have some kind of confusing scheme.
Here is the answer to your question from my code:

if ($params[1] == 'channel') {
                $method = 'channel_id';
            } elseif ($params[1] == 'user') {
                $method = 'user';
            } else {
                $method = 'user';
            }

$url = "https://www.youtube.com/feeds/videos.xml?{$method}={$name}";

They have channels there where exactly the id is in the form of a unique string, or in the form of a title
In general, something like this
Well, there you will already figure out how to find likes, they are listed there in<media:community>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question