A
A
Abra Kadabra2016-09-30 16:29:37
YouTube
Abra Kadabra, 2016-09-30 16:29:37

How to get the number of likes and views for a youtube video?

Hello.
I would like to know how can I get the number of likes and views for a youtube video using javascript.
I'm trying to do this using the DATA API .
How I do it now:

var channelName = 'RAYWILLIAMJOHNSON';

  $.get(
    "https://www.googleapis.com/youtube/v3/channels",{
      part: 'contentDetails',
      forUsername: channelName,
      key: '**some_key**',
      function(data){
        console.log(data)
      }
    }
  );


I get 403
in the console. I took the key in the 'Credentials' tab in the console.
What is the problem?
Perhaps you need to use a different API?
403 suggests that you need permission from the YouTuber / YouTuber?
How to fix this error?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael, 2016-09-30
@Jmaster

Check out the Calling the API chapter.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question