how do I get youtube shorts from youtube api data v3

One way of detecting if a YouTube video ID is a Short without even using the API is to try a HEAD HTTP request to the /shorts/ version of the URL and see if it redirects you.

https://www.youtube.com/shorts/hKwrn5-7FjQ is a Short and if you visit that URL, you’ll get an HTTP status code of 200 and the URL won’t change.

https://www.youtube.com/watch?v=B-s71n0dHUk is not a Short, and if you visit https://www.youtube.com/shorts/B-s71n0dHUk, you get a 303 redirect back to the original URL.

Keep in mind, that this behavior might change down the line, but it works as of May 2022.

Leave a Comment