Hack #11. Find Video from Across the Web

The Yahoo! Video Search can help you find video clips that have been posted to the Web.

As Yahoo! Search scours the Web, it indexes not only the documents, text, and images it finds, but also video clips. Video files don't show up in a standard Yahoo! Web Search, but you can visit the Yahoo! Video Search to find clips from every corner of the Web.

Simple Video Searching

To start finding videos, browse to http://video.yahoo.com (or type video search! into any Yahoo! Search form), enter a word or phrase, and click Search Video. Say you're interested in learning more about NASA's robotic vehicle for exploring Mars and you'd like to see the rover in action. You can find thumbnails of videos from across the Web by searching with the phrase mars rover, as shown in Figure 1-30.

Results of a Video Search for "mars rover"

Figure 1-30. Results of a Video Search for "mars rover"

Among the hundreds of results are clips from professional television news stories about the Mars rover, clips from NASA itself with video from the Mars rover, and amateur videos about the Mars rover. Yahoo! displays a single frame from the video, the name of the file, the video's dimensions, and the URL that contains a link to the video clip. To view a video, just click the thumbnail. The video will open from its original site within a Yahoo! frame, like the clip shown in Figure 1-31.

The top frame of a search result detail contains the video thumbnail, a link to play the video within your browser, and a link to send an email with a link to the clip. The bottom frame shows the page where the video was found, so you can see the video in its original context.


The videos you find through Yahoo! Video Search might be protected by copyright laws, so you'll need to be mindful of how you use any materials you find.

A Video Search result detail showing the video in context

Figure 1-31. A Video Search result detail showing the video in context

Advanced Video Searching

As with a Yahoo! Web Search, there's an advanced video search form (http://video.search.yahoo.com/video/advanced). You can use the advanced search form to limit results to specific video formats, one of three sizes of videos— small, medium, or large—and videos that are longer or shorter than one minute. As with the Web Search, you can also limit your search to a specific site or adjust the SafeSearch features for the search.

As an example of a specific search, you could still use the phrase mars rover, but limit the search to MPEG and Quicktime files that are shorter than a minute long, small in size, and found on a government domain. Instead of hundreds of results to sort through in a broad mars rover search, you'll find five clips from a NASA site with the narrowly defined advanced search.

If the advanced search controls still don't provide enough control over your query, there are several special search keywords you can use to refine your video searches further.


At the time of this writing, these video keywords aren't documented on Yahoo!, so thanks go to Stig Sæther Bakken and David Hall from Yahoo! for sharing the syntax elements listed here.

Here's a look at each of the special syntax keywords and how they'll refine a search. Note that a keyword is followed by a colon and a value with no space in between.


Limits search results to files of a specific size, in bytes. You can use this in combination with a greater-than sign (>) or less-than sign (<)to find files that are larger or smaller than the specified amount, respectively. For example, filesize:<1073741824 limits results to video files that are smaller than one gigabyte.


Limits results to videos that have been last modified on, before, or after a certain date. You need to use a Unix-style date, which is the time in seconds since January 1, 1970. So a query that includes date:>1107803581 returns results with videos that have been modified after February 7, 2005.


Finds videos of a specific width in pixels. A query with width:640 finds videos that are 640 pixels wide.


Finds videos of a specific height in pixels. So height:480 finds videos that are 480 pixels tall.


Finds clips of a certain length in seconds. As you'd expect, duration:>30 limits results to videos longer than 30 seconds, and duration:<30 limits results to videos that are shorter than 30 seconds.


Finds videos that are hosted on a specific top-level domain (a phrase for which the keyword tld is an abbreviation), such as .org, .com, .gov, .edu, or a specific county top-level domain, such as .jp for Japan.


Narrows results to videos that have been referenced on a page at a specific top-level domain, because some sites can link to videos on other domains. So even though a particular video might reside at .com address, Yahoo! might have indexed the video via a page at an .edu domain that linked to the video. The syntax fromtld:edu finds videos that have been referenced in pages at .edu domains.


Searches for videos at a specific site. The syntax site:nasa.gov limits results to videos hosted at http://www.nasa.gov.


Limits search results to pages that reference videos at the specified site. While the site specified might not host videos, this special syntax still ensures that pages with links to videos from the site are included.


Limits search results to video clips with specific words in the video's filename. A search with title:rover returns only videos with rover in the filename or link text.


Limits results to words in a referring document's title. The syntax fromtitle:rover finds videos that have been referenced on pages with rover in the filename, even though the word rover might not appear in the name of the video file.

A final special keyword, aspect, lets you limit search results to video files with a specific aspect ratio. The aspect ratio refers to a video's display width divided by its height. A standard television screen is almost square, but its width is a bit longer than its height. The aspect ratio of a standard television screen is noted as 4:3. The newer high-definition television screens are much longer than they are wide, and their aspect ratio is noted as 16:9. Naturally, the video for each of these devices matches the proper aspect ratio.

The aspect keyword expects a standard single integer to represent an aspect ratio, so you'll need to do a little math before you use it. The formula is the video width multiplied by 100, then divided by the height and rounded down if necessary. To make things easy, here are the most common aspect ratios, along with the computed value you'd use with the aspect keyword:

Table 1-4. 

Aspect ratio

Computed value

Television (4:3)


Computer monitors (5:4)


Widescreen movies and HDTV (16:9)


For example, using aspect:177 in a video search query limits the results to files that are in a widescreen format.


You can also use the special video syntax with the Yahoo! Video Web Services if you want programmatic access to video search results. Read the full documentation for the service at http://developer.yahoo.net/video/V1/videoSearch.html.

You can use these special syntax elements in combination to build some fairly sophisticated queries. Yahoo! Movies (http://movies.yahoo.com) hosts hundreds of movie previews and clips, and you can find a full listing at http://movies.yahoo.com/trailers. The site doesn't offer thumbnail browsing of its archive, but you can easily see thumbnails of the clips available with an advanced Yahoo! Video Search. Search for site:yahoo.com matrix to see thumbnails of video clips and trailers from the three Matrix movies.

Get Yahoo! Hacks now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.