Scraping youtube urls

Abhinav Rai
Nov 7 · 1 min read

I wanted to get a long list of any youtube urls for an experiment I was performing. There is no easy way by any softwares. I tried half an hour with them but it yielded me no results. The only solution was to use youtube APIs. It’s pretty fair and easy and their Try this API support is amazing.

Here is the link for all apis to get youtube data: https://developers.google.com/youtube/v3/docs/search/list?apix_params=%7B%22part%22%3A%22snippet%22%2C%22maxResults%22%3A50%2C%22q%22%3A%22travel%22%7D

I needed some 400 urls. I used the list by keyword and entered the keywords (coldplay / imagine dragons / …) and set the maxResults to 50. I stored the result in a json file and made a python script to get a list of those 400 urls.

We can create api client key(for self use in code) or use OAuth 2, if we want other person’s access. We need to create an App and then enable this on the app (Just like gmail OAuth 2). Don’t forget to enable it.

Am thinking of making a App where you can enter the key and get the results. That is the only way I could find. Other apps are either outdated or don’t work! Get your hands dirty!

Abhinav Rai

Written by

Product Engineer at Go-Jek | Guitarist | Traveller | Entrepreneur

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade