How to specify movie trailers using Youtube API
Asked Answered
K

2

12

I'm trying to get just official movie trailers from the Youtube API, but it's difficult to get consistent results.

The closest I seem to get is using the following url:

http://gdata.youtube.com/feeds/api/videos/-/MOVIE-TITLE?max-results=1

It sometimes works well:

http://gdata.youtube.com/feeds/api/videos/-/The-A-Team?max-results=1

Other times, not as well, for example:

gdata.youtube.com/feeds/api/videos/-/The-Twilight-Saga:-Eclipse-[DVD]-The-Twilight-Saga:-Eclipse?max-results=1

I'm wondering if anyone knows of a good way to specify official movie trailers? I'd rather have no match than an irrelevant one ;)

Kelleykelli answered 17/9, 2010 at 4:35 Comment(0)
T
8

If you append "-trailer" to the MOVIE-TITLE you should get better results.

Tankoos answered 18/2, 2011 at 0:43 Comment(1)
Looks like it's deprecated. Any other solutions??Rampage
L
1

I have also found improvements using the Version 2 API and restricting result to only include High def ones.

eg http://gdata.youtube.com/feeds/api/videos?q=kung+fu+panda-trailer&start-index=1&max-results=1&v=2&alt=json&hd

full parameters available for V2 are here https://developers.google.com/youtube/2.0/developers_guide_protocol_api_query_parameters#hdsp

Let answered 8/1, 2013 at 1:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.