A shields.io API for your youtube channel to protect your api key

Youtube-Channel-Badge

A shields.io API for your youtube channel to protect your api key.

Table of contents

Why

You can't publicly access the google/youtube api without an api key. That's why there is no shields.io badge for youtube channels. This repo aims to be the solution to this, because you deploy your own public api which only fetches your channel.

Features

  • Cache time to prevent rate limiting
  • Secure api key due env variable

Examples

Urls

Name Example Description URL
Subscriber count Custom badge Shows the amount of subscribers /subscriber
View count Custom badge Shows the amount of views of all videos of the channel /views
Video count Custom badge Shows the amount of videos on the channel /videos
Comment count Custom badge Shows the amount of youtube comments of the channel /comments

Styles

Name Examples
plastic Custom badge
flat Custom badge
flat-square Custom badge
for-the-badge Custom badge
social Custom badge

All examples are live and based on my youtube channel: ntec.io

Configuration

Variable Name Description Required
API_KEY Your google api key. See section below on how to get one TRUE
CHANNEL_ID The youtube channel id of which the stats should be processed TRUE
CACHE_TIME Time in seconds on how long the last result is cached. Default is 300. FALSE

Getting a google api key & activate youtube api

  1. Go to google developer console

  2. Log In to your google account

  3. Click on Select a project (Looks like a dropdown button)

    url image

  4. Create a new project by clicking on the New Project button

    url image

  5. Give your project a name (or leave it to the generated one) and create your project by pressing on CREATE

    url image

  6. On the next window, click on + ENABLE APIS AND SERVICES in the top

    url image

  7. Search for Youtube in the search bar and click on YoTube Data API v3

    url image

  8. Enable the API by clicking on ENABLE

    url image

  9. Click on the 3 lines in the top left corner to open the side menu and hover over APIs & Services and then click on Credentials

    url image

  10. Click on CREATE CREDENTIALS and then on API key

    url image

  11. Copy your API key

    url image

Find your youtube channel id

  1. Goto your advanced account settings

  2. Copy your channel id

    url image

Deployment

It is neccessary to deploy this repo by yourself to get a domain for the desired youtube channel. An easy and free way to deploy this repo is by using vercel. Just use the button below.

Deploy with Vercel

Step by step

  1. Click on the deploy button above or click here

  2. Click on Continue

    url image

  3. Click on no

    url image

  4. Select your user account and click on continue

    url image

  5. Fork the repo with a click on continue

    url image

  6. Click again on Continue

    url image

  7. Enter your API_KEY, CHANNEL_ID and CACHE_TIME. Check Configuration if you need help getting those things.

    url image

  8. Click on Deploy and your deployment should finish after a short time

    url image

Usage

  1. Deploy the repo and get your url from domains

    Example in vercel:

    url image

  2. Go to shields.io/endpoint and scroll down

    url image

  3. Add your vercel url to the url field

  4. Add your wanted url suffix:

    • to get the subscriber count: add api/subscriber

    • to get the view count: add api/views

    • to get the comment count: add api/comments

    • to get the video count: add api/videos

    It should look like this:

    url image

  5. Override the labels/colors/logo if you want (optional)

  6. Click on the button to copy the badge url

    url image

  7. Enjoy! :)

Similar Resources

cluster-api-state-metrics (CASM) is a service that listens to the Kubernetes API server and generates metrics about the state of custom resource objects related of Kubernetes Cluster API.

Overview cluster-api-state-metrics (CASM) is a service that listens to the Kubernetes API server and generates metrics about the state of custom resou

Oct 27, 2022

Supporting your devops by shortening your strings using common abbreviations and clever guesswork

abbreviate Shorten your strings using common abbreviations. Supported by Tidelift Motivation This tool comes out of a frustration of the name of resou

Dec 14, 2022

💓 小米手环实时心率数据采集 - Your Soul, Your Beats!

💓 mebeats 小米手环实时心率数据采集 - Your Soul, Your Beats! cmd/mebeats-client: the mebeats client. It collects the heart rate data from Mi Band and reports to s

Dec 31, 2022

A simple download file manager that sorts your files into your desired folders, This was meant to be a small project and nothing big.

GoDFM Simply go to the tags and download the .exe file (or compile it yourself by running go build). Add it to your environment paths by going to sett

Aug 9, 2022

Testcontainers is a Golang library that providing a friendly API to run Docker container. It is designed to create runtime environment to use during your automatic tests.

When I was working on a Zipkin PR I discovered a nice Java library called Testcontainers. It provides an easy and clean API over the go docker sdk to

Jan 7, 2023

Converts your k8s YAML to a cdk8s Api Object.

kube2cdk8s Converts your k8s YAML to a cdk8s Api Object. Uses Pulumi's kube2pulumi as a base. Dependencies 1. pulumi cli 2. pulumi kubernetes provider

Oct 18, 2022

Kubernetes OS Server - Kubernetes Extension API server exposing OS configuration like sysctl via Kubernetes API

KOSS is a Extension API Server which exposes OS properties and functionality using Kubernetes API, so it can be accessed using e.g. kubectl. At the moment this is highly experimental and only managing sysctl is supported. To make things actually usable, you must run KOSS binary as root on the machine you will be managing.

May 19, 2021

Pokete api - An API to get (Pokete, Attack etc.) data from Pokete

Pokete API An API to get (Pokete, Attack etc.) data from Pokete. Usage To lauch

Jun 16, 2022

Go-Mongodb API - A sample REST API ( CRUD operations ) created using Golang

Go-Mongodb_API This is a sample REST API ( CRUD operations ) created using the G

May 31, 2022
A simple go application that uses Youtube Data API V3 to show the real-time stats for a youtube channel such as the subs, views, avg. earnings etc.
A simple go application that uses Youtube Data API V3 to show the real-time stats for a youtube channel such as the subs, views, avg. earnings etc.

Youtube-channel-monitor A simple go application that uses Youtube Data API V3 to show the real-time stats for a youtube channel such as the subs, view

Dec 30, 2021
CetusGuard is a tool that allows to protect the Docker daemon socket by filtering the calls to its API endpoints.

CetusGuard CetusGuard is a tool that allows to protect the Docker daemon socket by filtering the calls to its API endpoints. Some highlights: It is wr

Dec 23, 2022
The Ultimate Engineer Toolbox YouTube 🔨 🔧
 The Ultimate Engineer Toolbox YouTube 🔨 🔧

The Ultimate Engineer Toolbox YouTube ?? ??

Jan 8, 2023
A go (golang) library to search videos in YouTube.

YT Search A go (golang) library to search videos in YouTube. Installation go get github.com/AnjanaMadu/YTSearch Usage package main import ( "fmt"

Oct 1, 2022
YouTube'da altyazısı olan veya otomatik olarak oluşturulmuş altyazılı videolarda istediğiniz kelimenin hangi saat, dakika ve saniye de geçtiğini size gösterip aradığınız şeyi hızlıca bulmanızı sağlar.

YouTube Subtitles YouTube'da altyazısı olan veya otomatik olarak oluşturulmuş altyazılı videolarda istediğiniz kelimenin hangi saat, dakika ve saniye

Mar 4, 2022
A long-running Go program that watches a Youtube playlist for new videos, and downloads them using yt-dlp or other preferred tool.

ytdlwatch A long-running Go program that watches a Youtube playlist for new videos, and downloads them using yt-dlp or other preferred tool. Ideal for

Jul 25, 2022
Parallel processing through go routines, copy and delete thousands of key within some minutes

redis-dumper CLI Parallel processing through go routines, copy and delete thousands of key within some minutes copy data by key pattern from one redis

Dec 26, 2021
Tiny Go program to set Elgato Key Light options

Elgato Key Light Controller This is a tiny Go program to control the power, brightness, and temperature settings for Elgato Key Lights with known IP a

Feb 8, 2022
Monitor your Website and APIs from your Computer. Get Notified through Slack, E-mail when your server is down or response time is more than expected.
Monitor your Website and APIs from your Computer. Get Notified through Slack, E-mail when your server is down or response time is more than expected.

StatusOK Monitor your Website and APIs from your computer.Get notified through Slack or E-mail when your server is down or response time is more than

Dec 27, 2022
Kusk makes your OpenAPI definition the source of truth for API resources in your cluster
Kusk makes your OpenAPI definition the source of truth for API resources in your cluster

Kusk - use OpenAPI to configure Kubernetes What is Kusk? Developers deploying their REST APIs in Kubernetes shouldn't have to worry about managing res

Dec 16, 2022