กลับไปหน้ารวมไฟล์
youtube-subs-views-videos-counter-e250e3-en.md

This is a step-by-step guide that I have created for beginners and arduiNOOBS like me.

In this tutorial, we will go through the steps necessary to enable and obtain our API key from Google Cloud Resource Manager and use it to login and view our Youtube Channel Statistics by using a D1 Mini Board and a 16x02 LCD with I2C backpack.

I also want to say thank you to all the developers and programmers in the Arduino and Github Community who share their creations for free and for everyone to use. You guys are awesome!


NECESSARY LINKS:

ESP8266 LIBRARY: https://gist.github.com/carljdp/e6a3f5a11edea63c2c14312b534f4e53

ESP8266 BOARDS MANAGER URL: http://arduino.esp8266.com/stable/package_esp8266com_index.json

YOUTUBE API: https://github.com/witnessmenow/arduino-youtube-api

ARDUINO JSON: https://github.com/bblanchon/ArduinoJson

GOOGLE DEVELOPERS: https://developers.google.com/

GOOGLE CLOUD RESOURCE MANAGER: https://console.developers.google.com/cloud-resource-manager

WeMos WIKI: https://wiki.wemos.cc/products:d1:d1_mini


Social Media Links To Follow (I mean, if you want to):

Facebook - https://fb.me/HeathenHacks

Twitter - https://twitter.com/HeathenHacks

Instagram - https://instagr.am/HeathenHacks


Project Overview

"Tube-Stats" is a definitive application of Cloud-Data Forensics and Asynchronous RESTful Handshaking. In an era of high-velocity social metrics, manual tracking is inefficient. Tube-Stats leverages the Wemos D1 Mini’s ESP8266 core to establish a secured TLS link with Google’s Cloud Infrastructure. By parsing real-time JSON payloads from the YouTube Data API V3, the system provides a persistent, hardware-based HMI for monitoring subscriber growth, view counts, and video volume with industrial-grade precision.

My ESP8266 Board

Technical Deep-Dive

  • RESTful API Handshaking Forensics:
    • The HTTPS Security Layer: The D1 Mini must handle SHA-1 fingerprinting or modern Root-CA validation to establish a secure SSL/TLS tunnel to googleapis.com. The forensics involves the construction of a specific GET request containing the localized "Channel ID" and the unique "API Key," ensuring that the telemetry request is authenticated within Google’s quota-management diagnostics.
    • Recursive Polling Harmonics: To prevent excessive API unit consumption, the firmware implements a deterministic polling interval. This timing forensics ensures that the channel metrics are refreshed frequently enough for live-monitoring while remaining well within the developer-tier request limits.
  • JSON-Buffer Diagnostics:
    • ArduinoJson Memory Mapping: YouTube returns a complex, nested JSON object. The project utilizes the ArduinoJson library to perform Memory-Pool Forensics, dynamically allocating a specific buffer to extract key-value pairs (e.g., subscriberCount, viewCount). This process requires precise memory diagnostics to prevent heap-fragmentation on the ESP8266’s limited RAM.
    • Data-Type Quantization: Raw API strings are converted into 64-bit integers to handle large-scale metrics $(>1,000,000\text{ views})$, ensuring the HMI display does not suffer from integer-overflow artifacts.

Engineering & Implementation

  • I2C Bus & Visual Telemetry:
    • I2C Protocol Diagnostics: The 16x2 LCD is interfaced via an I2C backpack $(\text{Address: 0x27 or 0x3F})$. This reduces the required GPIO pin-count to just two (SDA/SCL), facilitating a clean mechatronic assembly. Resistor-pullup diagnostics on the backpack ensure that the signal-rise times are sufficient for high-speed bus communication.
    • Adaptive String Formatting: The LCD forensics includes a specialized routine to format large numbers with commas or "K/M" suffixes, maximizing the readability of the social metrics within the limited 32-character visual footprint.
  • API Security Best-Practices:
    • Credential Obfuscation: The project emphasizes the importance of managing API keys. Field diagnostics recommend storing credentials in a separate .h file or using environment variables to prevent accidental key-leakage during public code deployments.

This is my full time script writer, programmer and video editor.

Conclusion

Tube-Stats demonstrates the successful integration of Web-Services and Embedded I/O. By mastering API Forensics and JSON Diagnostics, Heathen_Hacks-v2 has delivered a robust, interactive social telemetry node that serves as a cornerstone for content creators and IoT engineers looking to bridge the gap between cloud-data and physical displays.

https://youtube.com/@HeathenHacks


Metric Mastery: Mastering social telemetry through RESTful forensics.

ข้อมูล Frontmatter ดั้งเดิม

apps:
  - "YouTube Data API V3"
  - "Google Cloud Console (API Key Management)"
  - "Arduino IDE"
author: "Heathen_Hacks-v2"
category: "Internet of Things, BT & Wireless"
components:
  - "1x Wemos D1 Mini (IoT Processor Node)"
  - "1x 16x2 Alphanumeric LCD with I2C Backpack (Visual Telemetry Hub)"
  - "1x Arduino Uno (Alternative Logic Engine)"
  - "1x Micro USB Data Cable (Logic Power Rail)"
description: "A professional-grade social telemetry node featuring YouTube Data API V3 integration, JSON-buffer forensics, and encrypted API-key handshaking diagnostics."
difficulty: "Easy"
documentationLinks: []
downloadableFiles:
  - "https://projects.arduinocontent.cc/6961d5b4-d201-4fdf-bc7c-1e9b32382f84.h"
  - "https://projects.arduinocontent.cc/6961d5b4-d201-4fdf-bc7c-1e9b32382f84.h"
  - "https://projects.arduinocontent.cc/ea9d717a-57b2-4fda-978a-43838fc41f18.cpp"
  - "https://projects.arduinocontent.cc/45f040e7-4789-498d-be8b-fadce3d6a248.h"
  - "https://projects.arduinocontent.cc/45f040e7-4789-498d-be8b-fadce3d6a248.h"
encryptedPayload: "U2FsdGVkX18ONg3r/tRuyW82RrjEkfxU69yorDGjHmLKV/fCoJAGvORZqYDDnRUrtntoBfCFY8lSbPM1phUQzUzUkmogX2bNpqKeIhmU4c6wz9HrqBMKTlibgUQA0fbFCh2MLxb/bMcz0QqF/lXX9g=="
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/youtube-subs-views-videos-counter-e250e3_cover.jpg"
lang: "en"
likes: 0
passwordHash: "ef1d85acd3b4f4246020078779d09d7fc9930684a42539268ff3fdf31a33c519"
price: 699
seoDescription: "Build a YouTube Subs, Views & Videos Counter with Arduino. A step-by-step guide for beginners and ArduiNOOBS."
tags:
  - "youtube-api-forensics"
  - "json-parsing-diagnostics"
  - "iot-telemetry"
  - "api-handshaking"
  - "social-metrics"
  - "wemos-d1-mini"
title: "Tube-Stats: RESTful API Forensics & JSON-Parsing Hub"
tools:
  - "Precision Screwdriver (for I2C contrast calibration)"
videoLinks:
  - "https://www.youtube.com/embed/aFUYtqzeBqI"
views: 3067