Skip to content

Instantly share code, notes, and snippets.

View kuang-byte's full-sized avatar

Hao Kuang kuang-byte

  • Toronto
View GitHub Profile
@kuang-byte
kuang-byte / gist:d6b5940853cffeeebd39bbe595952b51
Created May 6, 2025 02:40
Peeking Behind the Curtain: Decoding YouTube's API Design Through Network Traffic
# Peeking Behind the Curtain: Decoding YouTube's API Design Through Network Traffic
## Ever Wonder How YouTube Works Under the Hood?
Let's face it, understanding massive systems like YouTube can feel like trying to solve a giant puzzle. But what if we could get some clues by just watching how it talks to itself? That's exactly what we did. We took a peek at the network traffic – the conversation between your browser and YouTube's servers – when loading the homepage and a video page. Think of it like eavesdropping on the system to understand its API design choices.
**How We Did It:** We used Playwright (a cool browser automation tool) to load YouTube in a controlled way and capture all the nitty-gritty details of the HTTP requests and responses. No special access needed, just observing what any browser does. (You could do something similar for YouTube Music or other platforms, too!)
**What We're Looking For:** This isn't about *every* single request. We're focusing on the *patterns* in the API calls Google