Getting data for multiple videos using the YouTube API

In: Uncategorized

8 Mar 2012

This took me a lot longer then it should have to figure out and I thought I’d throw it up here in case anyone else wanted to do it.

The issue was that I had a list of YouTube video IDs and I wanted to see what category they were all in. I didn’t want to do a request for each video ID so I wanted to find a way to get data using one request. The way to do it is to use the YouTube API Batch Processing.

Post this XML:
<feed xmlns="" xmlns:media=""
xmlns:batch="" xmlns:yt="">

<batch:operation type="query" />

to this URL:

and that’s it. Notice the URL in each ID node: the last path item is the ID of the YouTube video.

2 Responses to Getting data for multiple videos using the YouTube API



June 20th, 2012 at 12:30 pm

hey dude!
thanks a lot!
i was looking for this solution!

do u have any idea how i cant do it with jquery $.post?

somthing like:










how should i pass the xml as key:value object?
thanks a lot!



June 21st, 2012 at 2:23 pm

Thanks for the script, this helped out quite a bit. How do you pass a developers key into this batch process?

Will return the data by itself. But when I append the key/value pair as part of the request string, my script bottoms out.

Comment Form

About this blog

Nothing that notable about this blog. It's just going to be a place where we post random stuff.


  • free cccam: Ola great share. I think the best cccam server are those from fishbone cloud I would like to see [...]
  • FirstSam: I see you don't monetize your blog, don't waste your traffic, you can earn additional cash every m [...]
  • Arv: In else case it should invoke: super.writeText(writer, text); NOT writer.write(text); [...]
  • Chand: Hi could any one suggest, if few childs should be CDATA and dynamic value... How to get this with X [...]
  • Andrew: This is definitely a great start to the solution I need, but I need CDATA tags to be added dynamical [...]