cannyboy
cannyboy

Reputation: 24426

Search Youtube and return JSON

Is there a url I can use the search for 'foo' on YouTube, and return JSON with a list of videos?

Upvotes: 1

Views: 7231

Answers (4)

Santiago Ramirez
Santiago Ramirez

Reputation: 111

yt-dlp can help you out.

yt-dlp --print-json ytsearch:'foo'

Then you could redirect the output of the command to a file, it would be the best option, you could also use the lib instead of the command line.

Upvotes: 2

Abhishek Ekaanth
Abhishek Ekaanth

Reputation: 2567

On latest update:

https://www.googleapis.com/youtube/v3/search?part=snippet&q=SEARCHPARAMATER&maxResults=25&key=key

By using this URL you will be able to give the search parameter and get the desired JSON.

Upvotes: 4

Hanno
Hanno

Reputation: 563

The YouTube JSON API Page can help you out.

Some research on the API Page points out that http://gdata.youtube.com/feeds/api/videos?q=foo&alt=json is all you need...

Upvotes: 4

SLaks
SLaks

Reputation: 887479

As their API docs clearly state, just add ?alt=json:

http://gdata.youtube.com/feeds/api/videos?q=foo&alt=json

Upvotes: 7

Related Questions