YouTube API v3 Subs Count with JavaScript

By Raddy in JavaScript ·

In this video, we will learn how to use the YouTube API v3 to grab some data and display it on the screen. I will keep everything in one file to keep it simple and straight to the point.

First you need to get your YouTube API key from the link below, and once you do that make sure you find your YouTube ID too. Reference the video to see how you can find your YouTube channel ID.

YouTube API:

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>YouTube API</title>
    YouTube Subscribers
    <div id="subCount"></div>


    // Get Subscribers
    const youtubeKey = ' ADD YOUR KEY HERE';
    const youtubeUser = ' ADD YOUR USER ID HERE';
    const subCount = document.getElementById('subCount');

    let getSubscribers = () => {

        .then(response => {
            return response.json()
        .then(data => {
            subCount.innerHTML = data["items"][0].statistics.subscriberCount;




Leave a Reply

Your email address will not be published. Required fields are marked *