method-videos-search
Last edited: May 12th, 2009 by Colin DevroeSearch Viddler for videos and people (or Viddler users). Can also be used to search a specific user’s videos.
Note: Not all arguments are required, though some are required for certain query types. Please review all of the documentation.
Authenication
This method requires user authentication to search through a specific user’s videos but does not require authentication to search all videos or for Viddler users.
Arguments
- method
- Should be set to “viddler.videos.search”
- api_key
- Assigned Viddler API Key
- type
- The type of search (e.g. “myvideos”, “friendsvideos”, “allvideos”, “relevant”, “recent”, “popular”, “timedtags”, “globaltags”. (The “timedtags” and “globetags” sorting argument should be used in conjunction with an actual tag being given for the query argument.))
- query
- What to search for (e.g. “iPhone”, “Pennsylvania”, or “Windows XP”)
- page (optional)
- The “page number” of results to retrieve (e.g. 1, 2, 3).
- per_page (optional)
- The number of results to retrieve per page (maximum 100). If not specified, the default value equals 20.
- sessionid(optional)
- The sessionid for a specific user’s account – only used for the “myvideos” type.
Example Call
http://www.viddler.com/rest/v1/?method=viddler.videos.search&api_key=key&type=allvideos&query=iphone
Example Video List Response
This method returns set of video tag elements. Each tag element has the same structure as viddler.videos.getDetails response.
<?xml version="1.0" encoding="UTF-8"?> <video_list> <video> <author>username</author> <id>32104119</id> <title>My video</title> <length_seconds>188</length_seconds> <description></description> <view_count>121</view_count> <upload_time>1195445607000</upload_time> <comment_count>0</comment_count> <url>http://www.viddler.com/explore/username/videos/111/</url> <thumbnail_url>http://cdn-ll-79.viddler.com/e2/thumbnail_2_25304271.jpg</thumbnail_url> </video> <video> ... </video> ... </video_list>
Error Codes
Standard errors apple. Also “missing required parameter” will be the response if type is myvideos or friendsvideos and no valid sessionid is provided.