avatar

ShīnChvën ✨

Effective Accelerationism

Powered by Druid

Fetch YouTube Video Info Via oEmbed

Wed Aug 18 2021

oEmbed is a format for allowing an embedded representation of a URL on third party sites. The simple API allows a website to display embedded content (such as photos or videos) when a user posts a link to that resource, without having to parse the resource directly.

Since YouTube supports oEmbed, it's easy to fetch YouTube video/music info via oEmbed api.

Format

https://www.youtube.com/oembed?url=<YOUTUBE_CONTENT_URL>&format=json

Example

https://www.youtube.com/oembed?url=https%3A//youtube.com/watch%3Fv%3DM3r2XDceM6A&format=json

https://www.youtube.com/oembed?url=https://music.youtube.com/watch?v=AtD-HOiAIc4&list=RDAMVMAtD-HOiAIc4&format=json