Fetch any YouTube video’s metadata in 2 lines

Photo by Alexander Shatov on Unsplash

So, i was looking for a way to quickly get a YouTube video’s metadata without having to setup the developer account and get an API key since i just needed to integrate it as one small feature.

After doing a quick Google search, I came across the oembed API to fetch metadata for any video with using its link. So it goes like dis

tldr:

(• ◡ •)/

But after a bit of refactoring 🧹…

\(• ◡ •)/

The basic HTTP request looks like this…

Gives us a response like this…

That’s pretty neat :]

onw to 10x developer